class Andrake::Commands
Public Class Methods
run!(argv)
click to toggle source
# File lib/andrake/commands.rb, line 28 def run!(argv) self.new.run(argv) end
Public Instance Methods
aliases()
click to toggle source
# File lib/andrake/commands.rb, line 9 def aliases {"g" => "generate", "d" => "destroy" } end
parse(argv = nil)
click to toggle source
# 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
run(argv)
click to toggle source
# File lib/andrake/commands.rb, line 13 def run(argv) command = parse(argv) case command[:command] when 'generate' puts 'generate' when 'destroy' puts 'destroy' when 'new' Andrake::Generator::Rakefile.run! else puts "hogehoge" end end