Class: Chef::Provider::ChefMirror::CopyListener

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/provider/chef_mirror.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mirror) ⇒ CopyListener

Returns a new instance of CopyListener.



139
140
141
142
# File 'lib/chef/provider/chef_mirror.rb', line 139

def initialize(mirror)
  @mirror = mirror
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



145
146
147
# File 'lib/chef/provider/chef_mirror.rb', line 145

def errors
  @errors
end

#mirrorObject (readonly)

Returns the value of attribute mirror.



144
145
146
# File 'lib/chef/provider/chef_mirror.rb', line 144

def mirror
  @mirror
end

Instance Method Details

#error(str) ⇒ Object



158
159
160
161
162
# File 'lib/chef/provider/chef_mirror.rb', line 158

def error(str)
  mirror.converge_by "ERROR: #{str}" do
  end
  @errors << str
end

#output(str) ⇒ Object

TODO output is not always indicative of a change. We may want to give ChefFS the ability to tell us that info. For now though, assuming any output means change is pretty damn close to the truth.



150
151
152
153
# File 'lib/chef/provider/chef_mirror.rb', line 150

def output(str)
  mirror.converge_by str do
  end
end

#warn(str) ⇒ Object



154
155
156
157
# File 'lib/chef/provider/chef_mirror.rb', line 154

def warn(str)
  mirror.converge_by "WARNING: #{str}" do
  end
end