Class: VagrantPlugins::HostManager::Action::UpdateHost
- Inherits:
-
Object
- Object
- VagrantPlugins::HostManager::Action::UpdateHost
- Defined in:
- lib/vagrant-hostmanager-rethinc/action/update_host.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ UpdateHost
constructor
A new instance of UpdateHost.
Constructor Details
#initialize(app, env) ⇒ UpdateHost
Returns a new instance of UpdateHost.
9 10 11 12 13 14 15 16 17 |
# File 'lib/vagrant-hostmanager-rethinc/action/update_host.rb', line 9 def initialize(app, env) @app = app global_env = env[:global_env] @config = Util.get_config(global_env) @updater = HostsFile::Updater.new(global_env, env[:provider]) @logger = Log4r::Logger.new('vagrant::hostmanager-rethinc::update_host') end |
Instance Method Details
#call(env) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/vagrant-hostmanager-rethinc/action/update_host.rb', line 19 def call(env) if @config.hostmanager.manage_host? env[:ui].info I18n.t('vagrant_hostmanager.action.update_host') @updater.update_host end @app.call(env) end |