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