Class: AnnotateRb::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/annotate_rb/runner.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(args) ⇒ Object



6
7
8
# File 'lib/annotate_rb/runner.rb', line 6

def run(args)
  new.run(args)
end

Instance Method Details

#run(args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/annotate_rb/runner.rb', line 11

def run(args)
  config_file_options = ConfigLoader.load_config
  parser = Parser.new(args, {})

  parsed_options = parser.parse
  remaining_args = parser.remaining_args

  options = config_file_options.merge(parsed_options)

  @options = Options.from(options, {working_args: remaining_args})
  AnnotateRb::RakeBootstrapper.call(@options)

  if @options[:command]
    @options[:command].call(@options)
  else
    # TODO
    raise "Didn't specify a command"
  end
end