Class: ChefDK::PolicyfileLock::InstallReport
- Inherits:
-
Object
- Object
- ChefDK::PolicyfileLock::InstallReport
- Defined in:
- lib/chef-dk/policyfile_lock.rb
Instance Attribute Summary collapse
-
#policyfile_lock ⇒ Object
readonly
Returns the value of attribute policyfile_lock.
-
#ui ⇒ Object
readonly
Returns the value of attribute ui.
Instance Method Summary collapse
-
#initialize(ui: nil, policyfile_lock: nil) ⇒ InstallReport
constructor
A new instance of InstallReport.
- #installing_cookbook(cookbook_lock) ⇒ Object
- #installing_fixed_version_cookbook(cookbook_spec) ⇒ Object
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_lock ⇒ Object (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 |
#ui ⇒ Object (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 |