Class: Cliqr::Command::ShellCommand Private
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Cliqr::Command::ShellCommand
- Defined in:
- lib/cliqr/command/shell_command.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The default command executed to run a shell action
Instance Method Summary collapse
-
#execute(context) ⇒ Integer
private
Start a shell in the context of some other command.
-
#initialize(shell_config) ⇒ ShellCommand
constructor
private
Create a new shell command handler.
Constructor Details
#initialize(shell_config) ⇒ ShellCommand
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new shell command handler
13 14 15 |
# File 'lib/cliqr/command/shell_command.rb', line 13 def initialize(shell_config) @shell_config = shell_config end |
Instance Method Details
#execute(context) ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Start a shell in the context of some other command
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cliqr/command/shell_command.rb', line 20 def execute(context) validate_environment(context) root_context = context.root(:shell) context.puts (root_context, build_proc(@shell_config.)) context.invoke(:shell_start) exit_code = build_runner(context, root_context).run context.invoke(:shell_stop) context.puts "shell exited with code #{exit_code}" exit_code end |