Class: Andrake::Commands
- Inherits:
-
Object
- Object
- Andrake::Commands
- Defined in:
- lib/andrake/commands.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.run!(argv) ⇒ Object
28 29 30 |
# File 'lib/andrake/commands.rb', line 28 def run!(argv) self.new.run(argv) end |
Instance Method Details
#aliases ⇒ Object
9 10 11 |
# File 'lib/andrake/commands.rb', line 9 def aliases {"g" => "generate", "d" => "destroy" } end |
#parse(argv = nil) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/andrake/commands.rb', line 2 def parse(argv = nil) return {:command => "new"} if argv.nil? command = argv.shift command = aliases[command] || command {:command => command} end |