Class: VagrantPlugins::ProxyConf::Action::Base
- Inherits:
-
Object
- Object
- VagrantPlugins::ProxyConf::Action::Base
- Defined in:
- lib/vagrant-proxyconf/action/base.rb
Overview
Base class for proxy configuration Actions
Direct Known Subclasses
ConfigureAptProxy, ConfigureDockerProxy, ConfigureEnvProxy, ConfigureGitProxy, ConfigureNpmProxy, ConfigurePearProxy, ConfigureSvnProxy, ConfigureYumProxy
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#config_name ⇒ String
The name of the configuration section.
-
#initialize(app, env) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(app, env) ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/vagrant-proxyconf/action/base.rb', line 10 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/vagrant-proxyconf/action/base.rb', line 14 def call(env) @machine = env[:machine] if !config.enabled? logger.info I18n.t("vagrant_proxyconf.#{config_name}.not_enabled") elsif !supported? logger.info I18n.t("vagrant_proxyconf.#{config_name}.not_supported") else env[:ui].info I18n.t("vagrant_proxyconf.#{config_name}.configuring") configure_machine end @app.call env end |
#config_name ⇒ String
Returns the name of the configuration section.
30 31 32 |
# File 'lib/vagrant-proxyconf/action/base.rb', line 30 def config_name raise NotImplementedError, "Must be implemented by the inheriting class" end |