renaming rvmdir -> rvm_path

This commit is contained in:
Bill Cromie 2013-06-25 15:51:59 -04:00
parent 58c8b40faf
commit d4f96f3f75
3 changed files with 13 additions and 13 deletions

View file

@ -3,21 +3,21 @@ module VagrantPlugins
class Bucket
class Rvm < Bucket
def self.capability
:rvmdir
:rvm_path
end
def install
machine = @env[:machine]
guest = machine.guest
if guest.capability?(:rvmdir)
if rvmdir_path = guest.capability(:rvmdir)
prefix = rvmdir_path.split('/').last
if guest.capability?(:rvm_path)
if rvm_path = guest.capability(:rvm_path)
prefix = rvm_path.split('/').last
bucket_path = "/tmp/vagrant-cache/#{@name}/#{prefix}"
machine.communicate.tap do |comm|
comm.execute("mkdir -p #{bucket_path}")
rvm_cache_path = "#{rvmdir_path}/archives"
rvm_cache_path = "#{rvm_path}/archives"
@env[:cache_dirs] << rvm_cache_path

View file

@ -2,16 +2,16 @@ module VagrantPlugins
module Cachier
module Cap
module Linux
module Rvmdir
def self.rvmdir(machine)
rvmdir = nil
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|
rvmdir = output.chomp if buffer == :stdout
rvm_path = output.chomp if buffer == :stdout
end
end
return rvmdir
return rvm_path
end
end
end

View file

@ -13,9 +13,9 @@ module VagrantPlugins
Cap::Linux::Gemdir
end
guest_capability 'linux', 'rvmdir' do
require_relative 'cap/linux/rvmdir'
Cap::Linux::Rvmdir
guest_capability 'linux', 'rvm_path' do
require_relative 'cap/linux/rvm_path'
Cap::Linux::RvmPath
end
guest_capability 'debian', 'apt_cache_dir' do