Class: Billy::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/billy/session.rb

Class Method Summary collapse

Class Method Details

.proceed_command!(command_name, arguments) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/billy/session.rb', line 17

def proceed_command!( command_name, arguments )
  cmd = Billy::Commands.pool[ command_name.to_s ]
  if cmd.nil?
    Billy::Util::UI.err "Billy doesn't know this command: #{command_name}. Say billy hello."
    return 1
  end
  cmd.proceed!( arguments )
  0
end

.run!(args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/billy/session.rb', line 5

def run!( args )
  Billy::Commands.load_pool!
  command = ARGV.shift
  arguments = ARGV
  if command.nil?
    Billy::Util::UI.succ "Billy has nothing to do. Yay!"
    exit 0
  end
  status = proceed_command!( command, arguments )
  exit status
end