"Fossies" - the Fresh Open Source Software Archive

Member "vagrant-2.2.14/plugins/commands/plugin/action.rb" (20 Nov 2020, 2433 Bytes) of package /linux/misc/vagrant-2.2.14.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 require "pathname"
    2 
    3 require "vagrant/action/builder"
    4 
    5 module VagrantPlugins
    6   module CommandPlugin
    7     module Action
    8       # This middleware sequence will remove all plugins.
    9       def self.action_expunge
   10         Vagrant::Action::Builder.new.tap do |b|
   11           b.use ExpungePlugins
   12         end
   13       end
   14 
   15       # This middleware sequence will install a plugin.
   16       def self.action_install
   17         Vagrant::Action::Builder.new.tap do |b|
   18           b.use InstallGem
   19         end
   20       end
   21 
   22       # This middleware sequence licenses paid addons.
   23       def self.action_license
   24         Vagrant::Action::Builder.new.tap do |b|
   25           b.use PluginExistsCheck
   26           b.use LicensePlugin
   27         end
   28       end
   29 
   30       # This middleware sequence will list all installed plugins.
   31       def self.action_list
   32         Vagrant::Action::Builder.new.tap do |b|
   33           b.use ListPlugins
   34         end
   35       end
   36 
   37       # This middleware sequence will repair installed plugins.
   38       def self.action_repair
   39         Vagrant::Action::Builder.new.tap do |b|
   40           b.use RepairPlugins
   41         end
   42       end
   43 
   44       # This middleware sequence will repair installed local plugins.
   45       def self.action_repair_local
   46         Vagrant::Action::Builder.new.tap do |b|
   47           b.use RepairPluginsLocal
   48         end
   49       end
   50 
   51       # This middleware sequence will uninstall a plugin.
   52       def self.action_uninstall
   53         Vagrant::Action::Builder.new.tap do |b|
   54           b.use PluginExistsCheck
   55           b.use UninstallPlugin
   56         end
   57       end
   58 
   59       # This middleware sequence will update a plugin.
   60       def self.action_update
   61         Vagrant::Action::Builder.new.tap do |b|
   62           b.use UpdateGems
   63         end
   64       end
   65 
   66       # The autoload farm
   67       action_root = Pathname.new(File.expand_path("../action", __FILE__))
   68       autoload :ExpungePlugins, action_root.join("expunge_plugins")
   69       autoload :InstallGem, action_root.join("install_gem")
   70       autoload :LicensePlugin, action_root.join("license_plugin")
   71       autoload :ListPlugins, action_root.join("list_plugins")
   72       autoload :PluginExistsCheck, action_root.join("plugin_exists_check")
   73       autoload :RepairPlugins, action_root.join("repair_plugins")
   74       autoload :RepairPluginsLocal, action_root.join("repair_plugins")
   75       autoload :UninstallPlugin, action_root.join("uninstall_plugin")
   76       autoload :UpdateGems, action_root.join("update_gems")
   77     end
   78   end
   79 end