vagrant-cachier-ng/lib/vagrant-cachier/cap/linux/rvm_path.rb

22 lines
498 B
Ruby
Raw Normal View History

module VagrantPlugins
module Cachier
module Cap
module Linux
2013-06-25 19:51:59 +00:00
module RvmPath
def self.rvm_path(machine)
rvm_path = nil
machine.communicate.tap do |comm|
return unless comm.test('rvm info')
comm.execute 'echo $rvm_path' do |buffer, output|
2013-06-25 19:51:59 +00:00
rvm_path = output.chomp if buffer == :stdout
end
end
2013-06-25 19:51:59 +00:00
return rvm_path
end
end
end
end
end
end