class PBM::AllCommands

Public Class Methods

load(interpreter) click to toggle source
# File lib/pbm/all_commands.rb, line 4
def load(interpreter)
  Hash[Dir[File.dirname(__FILE__) + '/commands/*.rb'].map do |file|
    require file
    command = file.split('/').last.split('.').first
    class_name = "PBM::Commands::#{command.capitalize}"
    [command.to_sym, Object.const_get(class_name).new(interpreter)]
  end]
end