class VagrantPlugins::HostManager::Action::UpdateHost

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-hostmanager/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::update_host')
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-hostmanager/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