class Billy::Commands

Attributes

pool[RW]

Public Class Methods

load_pool!() click to toggle source
# File lib/billy/commands.rb, line 8
def load_pool!
  self.pool ||= Hash.new
  commands_path = File.expand_path( File.dirname(__FILE__) + '/commands/**/*.rb' )
  Dir[ commands_path ].each do |file|
    require file
  end
end
register_command!( command ) click to toggle source
# File lib/billy/commands.rb, line 16
def register_command!( command )
  load_pool! unless !pool.nil?
  ( pool[ command.name ] = command ) unless pool.values.include?( command )
end