Method: Cloudit::Command.load

Defined in:
lib/cloudit/command.rb

.loadObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cloudit/command.rb', line 10

def self.load
  Dir[File.join(File.dirname(__FILE__), "command", "*.rb")].each do |file|
    require file
    com = file.split('/')[-1].chomp('.rb')
    if com == 'index' || com == 'base'
      next
    end
    desc = Object.const_get("Cloudit::Command::#{com.capitalize}::DESCRIPTION")
    self.commands << com
    self.descriptions << {command: com, description: desc}
  end
end