Class: Rbdock::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/rbdock/command.rb,
lib/rbdock/command/options.rb

Defined Under Namespace

Modules: Options

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Command

Returns a new instance of Command.



10
11
12
# File 'lib/rbdock/command.rb', line 10

def initialize argv
  @argv = argv
end

Class Method Details

.run(argv) ⇒ Object



6
7
8
# File 'lib/rbdock/command.rb', line 6

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

Instance Method Details

#executeObject



14
15
16
17
18
19
20
21
22
# File 'lib/rbdock/command.rb', line 14

def execute
  options = Options.parse!(@argv)
  if options[:app]
    options[:app_path] = Rbdock.clone_app_to_local(options[:app])
  end
  Rbdock::Generate.run(options)
rescue => e
  abort "Error: #{e.message}"
end