lib/rvm/environment/utility.rb in rvm-1.11.3.5 vs lib/rvm/environment/utility.rb in rvm-1.11.3.6
- old
+ new
@@ -48,28 +48,30 @@
def self.reset_current!
@current_environment = nil
end
# Lets you build a command up, without needing to see the output.
- # As an example,
+ # Examples:
#
# rvm :use, "ree@rails3", :install => true
+ # > rvm use ree@rails3 --install
#
- # Will call the following:
+ # rvm :install, "ree@rails3", :rvm_by_path => true
+ # > $rvm_path/bin/rvm install ree@rails3
#
- # rvm use ree@rails3 --install
- #
def rvm(*args)
options = extract_options!(args)
silent = options.delete(:silent)
+ rvm_by_path = options.delete(:rvm_by_path)
rearrange_options!(args, options)
args += hash_to_options(options)
args.map! { |a| a.to_s }
+ program = rvm_by_path ? "#{self.class.default_rvm_path}/bin/rvm" : "rvm"
if silent
- run_silently('rvm', *args)
+ run_silently(program, *args)
else
- run('rvm', *args)
+ run(program, *args)
end
end
# Run commands inside the given directory.
def chdir(dir)