From f46b0aa9843ad3eadea280271222f210f14a4047 Mon Sep 17 00:00:00 2001 From: Paulo Bittencourt Date: Sun, 1 Jun 2014 16:52:23 -0400 Subject: [PATCH] migrate UpdateHost action to use Updater class --- lib/vagrant-hostmanager/action/update_host.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/vagrant-hostmanager/action/update_host.rb b/lib/vagrant-hostmanager/action/update_host.rb index ae945f8..233e471 100644 --- a/lib/vagrant-hostmanager/action/update_host.rb +++ b/lib/vagrant-hostmanager/action/update_host.rb @@ -1,24 +1,25 @@ -require 'vagrant-hostmanager/hosts_file' +require 'vagrant-hostmanager/hosts_file/updater' require 'vagrant-hostmanager/util' module VagrantPlugins module HostManager module Action class UpdateHost - include HostsFile def initialize(app, env) @app = app - @global_env = env[:global_env] - @provider = env[:provider] - @config = Util.get_config(@global_env) + + 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 def call(env) if @config.hostmanager.manage_host? env[:ui].info I18n.t('vagrant_hostmanager.action.update_host') - update_host + @updater.update_host end @app.call(env) @@ -26,5 +27,4 @@ module VagrantPlugins end end end -end - +end \ No newline at end of file