Class: Cerberus::CLI
- Inherits:
-
Object
- Object
- Cerberus::CLI
- Defined in:
- lib/cerberus/cli.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize(*args) ⇒ CLI
Returns a new instance of CLI.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/cerberus/cli.rb', line 7 def initialize(*args) say HELP if args.empty? command = args.shift = (args) case command when 'add' path = args.shift || Dir.pwd command = Cerberus::AddCommand.new(path, ) command.run when 'remove' command = Cerberus::RemoveCommand.new(args.shift, ) command.run when 'build' say HELP if args.empty? application_name = args.shift command = Cerberus::BuildCommand.new(application_name, ) command.run when 'buildall' command = Cerberus::BuildAllCommand.new() command.run when 'list' command = Cerberus::ListCommand.new() command.run when 'status' command = Cerberus::StatusCommand.new() command.run else say HELP end end |