Class: RVM::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/rvm/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorsObject (readonly)

Returns the value of attribute errors.



3
4
5
# File 'lib/rvm/shell.rb', line 3

def errors
  @errors
end

#outputObject (readonly)

Returns the value of attribute output.



3
4
5
# File 'lib/rvm/shell.rb', line 3

def output
  @output
end