File: action.rb

package info (click to toggle)
vagrant 2.2.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,072 kB
  • sloc: ruby: 80,731; sh: 369; makefile: 9; lisp: 1
file content (79 lines) | stat: -rw-r--r-- 2,433 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
require "pathname"

require "vagrant/action/builder"

module VagrantPlugins
  module CommandPlugin
    module Action
      # This middleware sequence will remove all plugins.
      def self.action_expunge
        Vagrant::Action::Builder.new.tap do |b|
          b.use ExpungePlugins
        end
      end

      # This middleware sequence will install a plugin.
      def self.action_install
        Vagrant::Action::Builder.new.tap do |b|
          b.use InstallGem
        end
      end

      # This middleware sequence licenses paid addons.
      def self.action_license
        Vagrant::Action::Builder.new.tap do |b|
          b.use PluginExistsCheck
          b.use LicensePlugin
        end
      end

      # This middleware sequence will list all installed plugins.
      def self.action_list
        Vagrant::Action::Builder.new.tap do |b|
          b.use ListPlugins
        end
      end

      # This middleware sequence will repair installed plugins.
      def self.action_repair
        Vagrant::Action::Builder.new.tap do |b|
          b.use RepairPlugins
        end
      end

      # 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

      # This middleware sequence will uninstall a plugin.
      def self.action_uninstall
        Vagrant::Action::Builder.new.tap do |b|
          b.use PluginExistsCheck
          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 :ExpungePlugins, action_root.join("expunge_plugins")
      autoload :InstallGem, action_root.join("install_gem")
      autoload :LicensePlugin, action_root.join("license_plugin")
      autoload :ListPlugins, action_root.join("list_plugins")
      autoload :PluginExistsCheck, action_root.join("plugin_exists_check")
      autoload :RepairPlugins, action_root.join("repair_plugins")
      autoload :RepairPluginsLocal, action_root.join("repair_plugins")
      autoload :UninstallPlugin, action_root.join("uninstall_plugin")
      autoload :UpdateGems, action_root.join("update_gems")
    end
  end
end