2013-02-03 02:42:04 +00:00
|
|
|
require "pathname"
|
|
|
|
|
|
|
|
require "vagrant/action/builder"
|
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module CommandPlugin
|
|
|
|
module Action
|
2017-05-09 16:13:14 +00:00
|
|
|
# This middleware sequence will remove all plugins.
|
2016-11-04 15:00:43 +00:00
|
|
|
def self.action_expunge
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
|
|
|
b.use ExpungePlugins
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-05-09 16:13:14 +00:00
|
|
|
# This middleware sequence will install a plugin.
|
2013-02-03 02:42:04 +00:00
|
|
|
def self.action_install
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
|
|
|
b.use InstallGem
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-04 18:22:15 +00:00
|
|
|
# This middleware sequence licenses paid addons.
|
|
|
|
def self.action_license
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
2014-01-06 04:50:25 +00:00
|
|
|
b.use PluginExistsCheck
|
2013-02-04 18:22:15 +00:00
|
|
|
b.use LicensePlugin
|
|
|
|
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 ListPlugins
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-11-02 17:37:29 +00:00
|
|
|
# This middleware sequence will repair installed plugins.
|
|
|
|
def self.action_repair
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
|
|
|
b.use RepairPlugins
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-18 20:45:15 +00:00
|
|
|
# This middleware sequence will repair installed local plugins.
|
|
|
|
def self.action_repair_local
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
|
|
|
b.use RepairPluginsLocal
|
|
|
|
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|
|
2014-01-06 00:03:00 +00:00
|
|
|
b.use PluginExistsCheck
|
2013-02-03 18:47:01 +00:00
|
|
|
b.use UninstallPlugin
|
|
|
|
end
|
|
|
|
end
|
2013-02-03 21:03:00 +00:00
|
|
|
|
2013-09-02 16:31:26 +00:00
|
|
|
# This middleware sequence will update a plugin.
|
|
|
|
def self.action_update
|
|
|
|
Vagrant::Action::Builder.new.tap do |b|
|
2014-01-06 06:33:05 +00:00
|
|
|
b.use UpdateGems
|
2013-09-02 16:31:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-03 02:42:04 +00:00
|
|
|
# The autoload farm
|
|
|
|
action_root = Pathname.new(File.expand_path("../action", __FILE__))
|
2016-11-04 15:00:43 +00:00
|
|
|
autoload :ExpungePlugins, action_root.join("expunge_plugins")
|
2013-02-03 02:42:04 +00:00
|
|
|
autoload :InstallGem, action_root.join("install_gem")
|
2013-02-04 18:41:35 +00:00
|
|
|
autoload :LicensePlugin, action_root.join("license_plugin")
|
2013-02-03 07:52:34 +00:00
|
|
|
autoload :ListPlugins, action_root.join("list_plugins")
|
2013-09-02 16:31:26 +00:00
|
|
|
autoload :PluginExistsCheck, action_root.join("plugin_exists_check")
|
2016-11-02 17:37:29 +00:00
|
|
|
autoload :RepairPlugins, action_root.join("repair_plugins")
|
2018-07-18 20:45:15 +00:00
|
|
|
autoload :RepairPluginsLocal, action_root.join("repair_plugins")
|
2013-02-03 18:47:01 +00:00
|
|
|
autoload :UninstallPlugin, action_root.join("uninstall_plugin")
|
2014-01-06 06:33:05 +00:00
|
|
|
autoload :UpdateGems, action_root.join("update_gems")
|
2013-02-03 02:42:04 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|