Class: RVM::Shell
- Inherits:
-
Object
- Object
- RVM::Shell
- Defined in:
- lib/rvm/shell.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(command) ⇒ Shell
constructor
A new instance of Shell.
Constructor Details
#initialize(command) ⇒ Shell
Returns a new instance of Shell.
5 6 7 8 9 10 11 12 |
# File 'lib/rvm/shell.rb', line 5 def initialize(command) @command = (command =~ /^rvm /) ? command : "rvm #{command}" Open4::popen4("/bin/bash -l -c '#{@command.tr("'","\\'")}'") do |pid, stdin, stdout, stderr| stdin.close @output = stdout.readlines.join @errors = stderr.readlines.join end end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/rvm/shell.rb', line 3 def errors @errors end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
3 4 5 |
# File 'lib/rvm/shell.rb', line 3 def output @output end |