lib/rvm/shell.rb in rvm-0.1.41 vs lib/rvm/shell.rb in rvm-0.1.42

- old
+ new

@@ -1,14 +1,25 @@ module RVM - class Shell - attr_reader :errors, :output + # Provides Generic access to a more ruby-like shell interface. + # For more details, see AbstractWrapper. + module Shell - 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 + autoload :AbstractWrapper, 'rvm/shell/abstract_wrapper' + autoload :SingleShotWrapper, 'rvm/shell/single_shot_wrapper' + # Current unimplemented + #autoload :PersistingWrapper, 'rvm/shell/persisting_wrapper' + autoload :TestWrapper, 'rvm/shell/test_wrapper' + autoload :Utility, 'rvm/shell/utility' + autoload :Result, 'rvm/shell/result' + + # Returns the default shell wrapper class to use + def self.default_wrapper + @@default_wrapper ||= SingleShotWrapper end + + # Sets the default shell wrapper class to use. + def self.default_wrapper=(wrapper) + @@default_wrapper = wrapper + end + end end