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: ui, policyfile_lock: nil) ⇒ InstallReport

Returns a new instance of InstallReport.



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

def initialize(ui: ui, 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.



30
31
32
# File 'lib/chef-dk/policyfile_lock.rb', line 30

def policyfile_lock
  @policyfile_lock
end

#uiObject (readonly)

Returns the value of attribute ui.



29
30
31
# File 'lib/chef-dk/policyfile_lock.rb', line 29

def ui
  @ui
end

Instance Method Details

#installing_cookbook(cookbook_lock) ⇒ Object



45
46
47
48
# File 'lib/chef-dk/policyfile_lock.rb', line 45

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



40
41
42
43
# File 'lib/chef-dk/policyfile_lock.rb', line 40

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