Class: Mutante::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/mutante/cli.rb

Constant Summary collapse

DEFAULT_INITIALIZER_PATHS =
[
  "config/initializers/mutante.rb",
  ".mutante.rb"
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CLI

Returns a new instance of CLI.



14
15
16
17
# File 'lib/mutante/cli.rb', line 14

def initialize(argv)
  @argv    = argv.dup
  @options = { verbose: false, config: nil }
end

Class Method Details

.start(argv) ⇒ Object



10
11
12
# File 'lib/mutante/cli.rb', line 10

def self.start(argv)
  new(argv).run
end

Instance Method Details

#runObject



19
20
21
22
23
24
# File 'lib/mutante/cli.rb', line 19

def run
  target = parse!
  load_configuration
  ok = Runner.new(verbose: @options[:verbose]).call(target)
  exit(ok ? 0 : 1)
end