Class: Rvm2::Shell::Runner::Local
- Inherits:
-
Object
- Object
- Rvm2::Shell::Runner::Local
- Defined in:
- lib/rvm2/shell/runner/local.rb
Instance Attribute Summary collapse
-
#last_status ⇒ Object
readonly
Returns the value of attribute last_status.
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
- #execute(command) ⇒ Object
-
#initialize(shell = "sh") ⇒ Local
constructor
A new instance of Local.
- #shell_session ⇒ Object
Constructor Details
#initialize(shell = "sh") ⇒ Local
Returns a new instance of Local.
6 7 8 |
# File 'lib/rvm2/shell/runner/local.rb', line 6 def initialize(shell = "sh") @shell = shell end |
Instance Attribute Details
#last_status ⇒ Object (readonly)
Returns the value of attribute last_status.
4 5 6 |
# File 'lib/rvm2/shell/runner/local.rb', line 4 def last_status @last_status end |
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
4 5 6 |
# File 'lib/rvm2/shell/runner/local.rb', line 4 def shell @shell end |
Instance Method Details
#execute(command) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rvm2/shell/runner/local.rb', line 10 def execute(command) @last_status = nil shell_session.execute(command) do |out, err| yield(out, err) end @last_status = shell_session.status end |
#shell_session ⇒ Object
18 19 20 |
# File 'lib/rvm2/shell/runner/local.rb', line 18 def shell_session @shell_session ||= Session::Sh.new(:prog => shell) end |