2013-06-08 02:37:02 +00:00
|
|
|
module VagrantPlugins
|
2013-05-22 22:38:26 +00:00
|
|
|
module Cachier
|
|
|
|
class Bucket
|
|
|
|
def self.inherited(base)
|
|
|
|
@buckets ||= []
|
|
|
|
@buckets << base
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.auto_detect(env)
|
|
|
|
@buckets.each do |bucket|
|
|
|
|
if env[:machine].guest.capability?(bucket.capability)
|
|
|
|
env[:machine].config.cache.enable bucket.bucket_name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.bucket_name
|
2013-07-17 11:45:02 +00:00
|
|
|
class_name = self.name.split('::').last
|
|
|
|
class_name.scan(/[A-Z][a-z]*/).map{|x| x.downcase}.join("_")
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.install(name, env, configs)
|
2013-07-17 09:50:44 +00:00
|
|
|
bucket = const_get(name.to_s.split("_").map{|x| x.capitalize}.join(""))
|
2013-05-22 22:38:26 +00:00
|
|
|
bucket.new(name, env, configs).install
|
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(name, env, configs)
|
|
|
|
@name = name
|
|
|
|
@env = env
|
|
|
|
@configs = configs
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
require_relative "bucket/apt"
|
2013-06-11 19:43:42 +00:00
|
|
|
require_relative "bucket/chef"
|
2013-05-22 22:38:26 +00:00
|
|
|
require_relative "bucket/gem"
|
|
|
|
require_relative "bucket/pacman"
|
|
|
|
require_relative "bucket/yum"
|
2013-06-17 21:22:38 +00:00
|
|
|
require_relative "bucket/rvm"
|
2013-10-13 20:14:05 +00:00
|
|
|
require_relative "bucket/apt_cacher"
|
2014-02-14 02:28:12 +00:00
|
|
|
require_relative "bucket/apt_lists"
|
2013-10-21 09:17:59 +00:00
|
|
|
require_relative "bucket/composer"
|
2013-10-23 12:44:49 +00:00
|
|
|
require_relative "bucket/npm"
|
2013-11-05 14:00:39 +00:00
|
|
|
require_relative "bucket/zypper"
|