Class: VagrantPlugins::StartCloud::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-startcloud/plugin.rb

Class Method Summary collapse

Class Method Details

.componentsObject



87
88
89
90
91
92
93
94
95
# File 'lib/vagrant-startcloud/plugin.rb', line 87

def components
  @components ||= begin
    c = Vagrant::Plugin::V2::Components.new
    c.configs[:top].register(:startcloud) { Config }
    c.configs[:provisioner].register(:startcloud) { Config }
    c.provisioners.register(:startcloud) { Provisioner }
    c
  end
end

.config_builderObject



97
98
99
100
# File 'lib/vagrant-startcloud/plugin.rb', line 97

def config_builder
  require_relative 'config_builder'
  ConfigBuilder
end

.init!Object

Initialize plugin



113
114
115
# File 'lib/vagrant-startcloud/plugin.rb', line 113

def self.init!
  setup_i18n
end

.register(name) ⇒ Object



79
80
81
# File 'lib/vagrant-startcloud/plugin.rb', line 79

def register(name)
  registered << name unless registered?(name)
end

.registeredObject



71
72
73
# File 'lib/vagrant-startcloud/plugin.rb', line 71

def registered
  @registered ||= []
end

.registered?(name) ⇒ Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/vagrant-startcloud/plugin.rb', line 75

def registered?(name)
  registered.include?(name)
end

.setup_i18nObject

Initialize I18n



107
108
109
110
# File 'lib/vagrant-startcloud/plugin.rb', line 107

def self.setup_i18n
  I18n.load_path << File.expand_path('../../locales/en.yml', __dir__)
  I18n.reload!
end

.versionObject



83
84
85
# File 'lib/vagrant-startcloud/plugin.rb', line 83

def version
  VERSION
end