renaming rvmdir -> rvm_path
This commit is contained in:
parent
58c8b40faf
commit
d4f96f3f75
3 changed files with 13 additions and 13 deletions
|
@ -3,21 +3,21 @@ module VagrantPlugins
|
||||||
class Bucket
|
class Bucket
|
||||||
class Rvm < Bucket
|
class Rvm < Bucket
|
||||||
def self.capability
|
def self.capability
|
||||||
:rvmdir
|
:rvm_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
machine = @env[:machine]
|
machine = @env[:machine]
|
||||||
guest = machine.guest
|
guest = machine.guest
|
||||||
|
|
||||||
if guest.capability?(:rvmdir)
|
if guest.capability?(:rvm_path)
|
||||||
if rvmdir_path = guest.capability(:rvmdir)
|
if rvm_path = guest.capability(:rvm_path)
|
||||||
prefix = rvmdir_path.split('/').last
|
prefix = rvm_path.split('/').last
|
||||||
bucket_path = "/tmp/vagrant-cache/#{@name}/#{prefix}"
|
bucket_path = "/tmp/vagrant-cache/#{@name}/#{prefix}"
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
comm.execute("mkdir -p #{bucket_path}")
|
comm.execute("mkdir -p #{bucket_path}")
|
||||||
|
|
||||||
rvm_cache_path = "#{rvmdir_path}/archives"
|
rvm_cache_path = "#{rvm_path}/archives"
|
||||||
|
|
||||||
@env[:cache_dirs] << rvm_cache_path
|
@env[:cache_dirs] << rvm_cache_path
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,16 @@ module VagrantPlugins
|
||||||
module Cachier
|
module Cachier
|
||||||
module Cap
|
module Cap
|
||||||
module Linux
|
module Linux
|
||||||
module Rvmdir
|
module RvmPath
|
||||||
def self.rvmdir(machine)
|
def self.rvm_path(machine)
|
||||||
rvmdir = nil
|
rvm_path = nil
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
return unless comm.test('rvm info')
|
return unless comm.test('rvm info')
|
||||||
comm.execute 'echo $rvm_path' do |buffer, output|
|
comm.execute 'echo $rvm_path' do |buffer, output|
|
||||||
rvmdir = output.chomp if buffer == :stdout
|
rvm_path = output.chomp if buffer == :stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return rvmdir
|
return rvm_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -13,9 +13,9 @@ module VagrantPlugins
|
||||||
Cap::Linux::Gemdir
|
Cap::Linux::Gemdir
|
||||||
end
|
end
|
||||||
|
|
||||||
guest_capability 'linux', 'rvmdir' do
|
guest_capability 'linux', 'rvm_path' do
|
||||||
require_relative 'cap/linux/rvmdir'
|
require_relative 'cap/linux/rvm_path'
|
||||||
Cap::Linux::Rvmdir
|
Cap::Linux::RvmPath
|
||||||
end
|
end
|
||||||
|
|
||||||
guest_capability 'debian', 'apt_cache_dir' do
|
guest_capability 'debian', 'apt_cache_dir' do
|
||||||
|
|
Loading…
Reference in a new issue