Class: ChefDK::PolicyfileLock::InstallReport

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-dk/policyfile_lock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ui: nil, policyfile_lock: nil) ⇒ InstallReport

Returns a new instance of InstallReport.



35
36
37
38
39
40
41
# File 'lib/chef-dk/policyfile_lock.rb', line 35

def initialize(ui: nil, policyfile_lock: nil)
  @ui = ui
  @policyfile_lock = policyfile_lock

  @cookbook_name_width = nil
  @cookbook_version_width = nil
end

Instance Attribute Details

#policyfile_lockObject (readonly)

Returns the value of attribute policyfile_lock.



33
34
35
# File 'lib/chef-dk/policyfile_lock.rb', line 33

def policyfile_lock
  @policyfile_lock
end

#uiObject (readonly)

Returns the value of attribute ui.



32
33
34
# File 'lib/chef-dk/policyfile_lock.rb', line 32

def ui
  @ui
end

Instance Method Details

#installing_cookbook(cookbook_lock) ⇒ Object



48
49
50
51
# File 'lib/chef-dk/policyfile_lock.rb', line 48

def installing_cookbook(cookbook_lock)
  verb = cookbook_lock.installed? ? "Using     " : "Installing"
  ui.msg("#{verb} #{format_cookbook(cookbook_lock)}")
end

#installing_fixed_version_cookbook(cookbook_spec) ⇒ Object



43
44
45
46
# File 'lib/chef-dk/policyfile_lock.rb', line 43

def installing_fixed_version_cookbook(cookbook_spec)
  verb = cookbook_spec.installed? ? "Using     " : "Installing"
  ui.msg("#{verb} #{format_fixed_version_cookbook(cookbook_spec)}")
end