Skip to content

Commit

Permalink
Rename Krane::CLI::Krane to Krane::CLI::Commands to avoid name conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Soares de Andrade committed Oct 8, 2019
1 parent cf1cb9b commit d661cfc
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions exe/krane
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'krane/cli/krane'
Krane::CLI::Krane.start(ARGV)
require 'krane/cli/commands'
Krane::CLI::Commands.start(ARGV)
5 changes: 2 additions & 3 deletions lib/krane/cli/krane.rb → lib/krane/cli/commands.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'krane'
require 'thor'
require 'krane/cli/version_command'
require 'krane/cli/restart_command'
Expand All @@ -10,11 +9,11 @@

module Krane
module CLI
class Krane < Thor
class Commands < Thor
TIMEOUT_EXIT_CODE = 70
FAILURE_EXIT_CODE = 1

package_name "Krane"
package_name "Commands"

def self.expand_options(task_options)
task_options.each { |option_name, config| method_option(option_name, config) }
Expand Down
6 changes: 3 additions & 3 deletions test/exe/deploy_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'test_helper'
require 'krane/cli/krane'
require 'krane/cli/commands'
require 'krane/bindings_parser'

class DeployTest < Krane::TestCase
Expand Down Expand Up @@ -70,7 +70,7 @@ def test_deploy_passes_filename
end

def test_deploy_fails_without_filename
krane = Krane::CLI::Krane.new(
krane = Krane::CLI::Commands.new(
[deploy_task_config.namespace, deploy_task_config.context],
[]
)
Expand All @@ -91,7 +91,7 @@ def set_krane_deploy_expectations(new_args: {}, run_args: {})

def krane_deploy!(flags: '')
flags += ' -f /tmp' unless flags.include?('-f')
krane = Krane::CLI::Krane.new(
krane = Krane::CLI::Commands.new(
[deploy_task_config.namespace, deploy_task_config.context],
flags.split
)
Expand Down
2 changes: 1 addition & 1 deletion test/exe/krane_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'test_helper'
require 'krane/cli/krane'
require 'krane/cli/commands'

class KraneTest < Krane::TestCase
def test_help_success_as_black_box
Expand Down
4 changes: 2 additions & 2 deletions test/exe/render_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'test_helper'
require 'krane/cli/krane'
require 'krane/cli/commands'

class RendertTest < Krane::TestCase
include EnvTestHelper
Expand Down Expand Up @@ -41,7 +41,7 @@ def install_krane_render_expectations(new_args = {})
end

def krane_render!(flags = '-f /dev/null')
krane = Krane::CLI::Krane.new(
krane = Krane::CLI::Commands.new(
[],
flags.split
)
Expand Down
4 changes: 2 additions & 2 deletions test/exe/restart_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'test_helper'
require 'krane/cli/krane'
require 'krane/cli/commands'

class RestartTest < Krane::TestCase
def test_restart_with_default_options
Expand Down Expand Up @@ -56,7 +56,7 @@ def set_krane_restart_expectations(new_args: {}, deployments: nil, run_args: {})
end

def krane_restart!(flags: '')
krane = Krane::CLI::Krane.new(
krane = Krane::CLI::Commands.new(
[restart_task_config.namespace, restart_task_config.context],
flags.split
)
Expand Down
4 changes: 2 additions & 2 deletions test/exe/run_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'test_helper'
require 'krane/cli/krane'
require 'krane/cli/commands'

class RunTest < Krane::TestCase
def test_run_with_default_options
Expand Down Expand Up @@ -73,7 +73,7 @@ def set_krane_run_expectations(new_args: {}, run_args: {})
end

def krane_run!(flags: '')
krane = Krane::CLI::Krane.new(
krane = Krane::CLI::Commands.new(
[run_task_config.namespace, run_task_config.context],
flags.split
)
Expand Down
4 changes: 2 additions & 2 deletions test/exe/version_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'test_helper'
require 'krane/cli/krane'
require 'krane/cli/commands'

class VersionTest < Krane::TestCase
def test_version_prints_current_version
Expand All @@ -24,6 +24,6 @@ def test_version_failure_as_black_box
private

def krane
Krane::CLI::Krane.new
Krane::CLI::Commands.new
end
end

0 comments on commit d661cfc

Please sign in to comment.