2013-06-08 02:37:02 +00:00
|
|
|
module VagrantPlugins
|
2013-05-22 22:38:26 +00: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 03:15:43 +00:00
|
|
|
prefix = gemdir_path.split('/').last
|
|
|
|
bucket_path = "/tmp/vagrant-cache/#{@name}/#{prefix}"
|
|
|
|
gem_cache_path = "#{gemdir_path}/cache"
|
2013-05-22 22:38:26 +00:00
|
|
|
|
2014-02-14 03:15:43 +00:00
|
|
|
symlink(gem_cache_path, bucket_path)
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
else
|
2013-08-03 17:26:10 +00:00
|
|
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'RubyGems')
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|