2013-06-07 22:37:02 -04:00
|
|
|
module VagrantPlugins
|
2013-05-22 19:38:26 -03:00
|
|
|
module Cachier
|
|
|
|
class Bucket
|
|
|
|
class Gem < Bucket
|
|
|
|
def self.capability
|
|
|
|
:gemdir
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
if guest.capability?(:gemdir)
|
|
|
|
if gemdir_path = guest.capability(:gemdir)
|
2014-02-14 01:15:43 -02:00
|
|
|
prefix = gemdir_path.split('/').last
|
|
|
|
bucket_path = "/tmp/vagrant-cache/#{@name}/#{prefix}"
|
|
|
|
gem_cache_path = "#{gemdir_path}/cache"
|
2013-05-22 19:38:26 -03:00
|
|
|
|
2014-02-14 01:15:43 -02:00
|
|
|
symlink(gem_cache_path, bucket_path)
|
2013-05-22 19:38:26 -03:00
|
|
|
end
|
|
|
|
else
|
2013-08-03 14:26:10 -03:00
|
|
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'RubyGems')
|
2013-05-22 19:38:26 -03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|