2013-02-03 02:42:04 +00:00
|
|
|
require "pathname"
|
|
|
|
|
|
|
|
require "vagrant/action/builder"
|
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module CommandPlugin
|
|
|
|
module Action
|
|
|
|
# This middleware sequence will install a plugin.
|
|
|
|
def self.action_install
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
|
|
|
b.use BundlerCheck
|
|
|
|
b.use InstallGem
|
2013-02-03 18:15:46 +00:00
|
|
|
b.use PruneGems
|
2013-02-03 02:42:04 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-03 07:52:34 +00:00
|
|
|
# This middleware sequence will list all installed plugins.
|
|
|
|
def self.action_list
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
|
|
|
b.use BundlerCheck
|
|
|
|
b.use ListPlugins
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-03 18:47:01 +00:00
|
|
|
# This middleware sequence will uninstall a plugin.
|
|
|
|
def self.action_uninstall
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
|
|
|
b.use BundlerCheck
|
|
|
|
b.use UninstallPlugin
|
|
|
|
b.use PruneGems
|
|
|
|
end
|
|
|
|
end
|
2013-02-03 02:42:04 +00:00
|
|
|
# The autoload farm
|
|
|
|
action_root = Pathname.new(File.expand_path("../action", __FILE__))
|
|
|
|
autoload :BundlerCheck, action_root.join("bundler_check")
|
|
|
|
autoload :InstallGem, action_root.join("install_gem")
|
2013-02-03 07:52:34 +00:00
|
|
|
autoload :ListPlugins, action_root.join("list_plugins")
|
2013-02-03 18:15:46 +00:00
|
|
|
autoload :PruneGems, action_root.join("prune_gems")
|
2013-02-03 18:47:01 +00:00
|
|
|
autoload :UninstallPlugin, action_root.join("uninstall_plugin")
|
2013-02-03 02:42:04 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|