Class: ChefCLI::PolicyfileLock::InstallReport

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-cli/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.



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

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.



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

def policyfile_lock
  @policyfile_lock
end

#uiObject (readonly)

Returns the value of attribute ui.



31
32
33
# File 'lib/chef-cli/policyfile_lock.rb', line 31

def ui
  @ui
end

Instance Method Details

#installing_cookbook(cookbook_lock) ⇒ Object



47
48
49
50
# File 'lib/chef-cli/policyfile_lock.rb', line 47

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



42
43
44
45
# File 'lib/chef-cli/policyfile_lock.rb', line 42

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