isolate core HostsFile module code into its own class
This commit is contained in:
		
							parent
							
								
									d60018ad1d
								
							
						
					
					
						commit
						22af89a8de
					
				|  | @ -3,6 +3,23 @@ require 'tempfile' | |||
| module VagrantPlugins | ||||
|   module HostManager | ||||
|     module HostsFile | ||||
| 
 | ||||
|       def update_guest(machine) | ||||
|         Updater.new(@global_env, @config, @provider).update_guest(machine) | ||||
|       end | ||||
| 
 | ||||
|       def update_host | ||||
|         Updater.new(@global_env, @config, @provider).update_host | ||||
|       end | ||||
| 
 | ||||
|       class Updater | ||||
| 
 | ||||
|         def initialize(global_env, config, provider) | ||||
|           @global_env = global_env | ||||
|           @config = config | ||||
|           @provider = provider | ||||
|         end | ||||
| 
 | ||||
|         def update_guest(machine) | ||||
|           return unless machine.communicate.ready? | ||||
| 
 | ||||
|  | @ -192,4 +209,5 @@ module VagrantPlugins | |||
|         end | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Paulo Bittencourt
						Paulo Bittencourt