Module: ORS::Commands::Base::ClassMethods

Included in:
ORS::Commands::Base
Defined in:
lib/ors/commands/base.rb

Instance Method Summary collapse

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ors/commands/base.rb', line 11

def run
  command = new
  command.setup

  # now that the command has had a chance at the args
  # we let our config finish its setup of variables
  ORS.config.finalize!

  if ORS.config.valid?
    # now execute the command
    command.execute
  else
    info "ERROR: Invalid options given."
    ORS::Commands::Help.run_without_setup
  end
end

#run_without_setupObject



7
8
9
# File 'lib/ors/commands/base.rb', line 7

def run_without_setup
  new.execute
end