class VagrantPlugins::Cachier::Bucket::Gem

Public Class Methods

capability() click to toggle source
# File lib/vagrant-cachier/bucket/gem.rb, line 5
def self.capability
  :gemdir
end

Public Instance Methods

install() click to toggle source
# File lib/vagrant-cachier/bucket/gem.rb, line 9
def install
  if guest.capability?(:gemdir)
    if gemdir_path = guest.capability(:gemdir)
      prefix         = gemdir_path.split('/').last
      bucket_path    = "/tmp/vagrant-cache/#{@name}/#{prefix}"
      gem_cache_path = "#{gemdir_path}/cache"

      symlink(gem_cache_path, bucket_path)
    end
  else
    @env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'RubyGems')
  end
end