Class: Chef::Taste::JSONDisplay
- Inherits:
-
Object
- Object
- Chef::Taste::JSONDisplay
- Defined in:
- lib/chef/taste/display.rb
Overview
Displays the cookbook dependency status in JSON format
Class Method Summary collapse
-
.dependencies_hash(dependencies) ⇒ Object
Converts the dependency objects to JSON object.
-
.print(dependencies) ⇒ Object
Prints the status of dependent in JSON.
Class Method Details
.dependencies_hash(dependencies) ⇒ Object
Converts the dependency objects to JSON object
122 123 124 125 126 127 128 |
# File 'lib/chef/taste/display.rb', line 122 def dependencies_hash(dependencies) {}.tap do |hash| dependencies.each do |dependency| hash[dependency.name] = dependency.to_hash end end end |
.print(dependencies) ⇒ Object
Prints the status of dependent in JSON
114 115 116 |
# File 'lib/chef/taste/display.rb', line 114 def print(dependencies) puts JSON.pretty_generate(dependencies_hash(dependencies)) end |