vagrant/plugins/commands/plugin/action.rb

56 lines
1.6 KiB
Ruby
Raw Normal View History

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 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|
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
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 PluginExistsCheck
2013-02-03 18:47:01 +00:00
b.use UninstallPlugin
end
end
# This middleware sequence will update a plugin.
def self.action_update
Vagrant::Action::Builder.new.tap do |b|
b.use UpdateGems
end
end
# The autoload farm
action_root = Pathname.new(File.expand_path("../action", __FILE__))
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")
autoload :PluginExistsCheck, action_root.join("plugin_exists_check")
2013-02-03 18:47:01 +00:00
autoload :UninstallPlugin, action_root.join("uninstall_plugin")
autoload :UpdateGems, action_root.join("update_gems")
end
end
end