Class: Lock::Gemfile::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(args) ⇒ Object



8
9
10
# File 'lib/lock/gemfile/cli.rb', line 8

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

Instance Method Details

#run(args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/lock/gemfile/cli.rb', line 12

def run(args)
  options = parse_options(args)

  case options[:command]
  when 'report'
    Report.generate
  when 'rewrite'
    rewrite_gemfile(options)
  else
    puts "Unknown command: #{options[:command]}"
    exit 1
  end
end