Child UIs successfully set environment to themselves

This commit is contained in:
Mitchell Hashimoto 2010-08-25 22:30:57 -07:00
parent 5e0a7d946e
commit b21fae99c5
2 changed files with 8 additions and 3 deletions

View File

@ -138,8 +138,13 @@ module Vagrant
# Returns the {UI} for the environment, which is responsible
# for talking with the outside world.
def ui
return parent.ui if parent
@ui ||= UI.new(self)
@ui ||= if parent
result = parent.ui.clone
result.env = self
result
else
UI.new(self)
end
end
#---------------------------------------------------------------

View File

@ -5,7 +5,7 @@ module Vagrant
# through a shell). They must respond to the typically logger methods
# of `warn`, `error`, `info`, and `confirm`.
class UI
attr_reader :env
attr_accessor :env
def initialize(env)
@env = env