Class: Regolith::CLI
- Inherits:
-
Object
- Object
- Regolith::CLI
- Defined in:
- lib/regolith/cli.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ CLI
Returns a new instance of CLI.
10 11 12 13 14 15 |
# File 'lib/regolith/cli.rb', line 10 def initialize(args) @args = args @command = args[0] @subcommand = args[1] @name = args[2] end |
Instance Method Details
#run ⇒ Object
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 42 43 44 |
# File 'lib/regolith/cli.rb', line 17 def run case @command when 'new' create_new_app(@subcommand) when 'generate' generate_resource(@subcommand, @name) when 'server' start_server when 'stop' stop_services when 'down' down_services when 'restart' restart_services when 'logs' show_logs(@subcommand) when 'status' show_status when 'start' start_service(@subcommand) when 'console' open_console(@subcommand) when 'version' puts "Regolith #{Regolith::VERSION}" else show_help end end |