Class: Rascal::CLI::Main
- Inherits:
-
Thor
- Object
- Thor
- Rascal::CLI::Main
- Defined in:
- lib/rascal/cli/main.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_run(environment_name = nil, *command) ⇒ Object
- #_shell(environment_name = nil) ⇒ Object
- #clean(environment_name = nil) ⇒ Object
- #environments ⇒ Object
- #help(subcommand = false) ⇒ Object
- #update(environment_name = nil) ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
20 21 22 23 |
# File 'lib/rascal/cli/main.rb', line 20 def self.exit_on_failure? # return non-zero exit code for failures true end |
Instance Method Details
#_run(environment_name = nil, *command) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/rascal/cli/main.rb', line 50 def _run(environment_name = nil, *command) handle_error do command = command.drop(1) if command.first == '--' Run.new(self, , environment_name, command).run end end |
#_shell(environment_name = nil) ⇒ Object
33 34 35 36 37 |
# File 'lib/rascal/cli/main.rb', line 33 def _shell(environment_name = nil) handle_error do Shell.new(self, , environment_name).run end end |
#clean(environment_name = nil) ⇒ Object
60 61 62 63 64 |
# File 'lib/rascal/cli/main.rb', line 60 def clean(environment_name = nil) handle_error do Clean.new(self, , environment_name).run end end |
#environments ⇒ Object
40 41 42 43 44 |
# File 'lib/rascal/cli/main.rb', line 40 def environments handle_error do Environments.new(self, ).run end end |
#help(subcommand = false) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rascal/cli/main.rb', line 4 def help(subcommand = false) if subcommand super else say say 'Usage:' say ' rascal <command> <args>' say 'For example:' say ' rascal shell 2.6' say super say 'For Further information about the commands, you can use "rascal help <command>".' say end end |