Method: Berkshelf::CachedCookbook#pretty_hash

Defined in:
lib/berkshelf/cached_cookbook.rb

#pretty_hashHash

High-level information about this cached cookbook in Hash format

Returns:

  • (Hash)


138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/berkshelf/cached_cookbook.rb', line 138

def pretty_hash
  {}.tap do |h|
    h[:name]          = cookbook_name if cookbook_name && cookbook_name =~ /\S/
    h[:version]       = version if version && version =~ /\S/
    h[:description]   = description if description && description =~ /\S/
    h[:author]        = maintainer if maintainer && maintainer =~ /\S/
    h[:email]         = maintainer_email if maintainer_email && maintainer_email =~ /\S/
    h[:license]       = license if license && license =~ /\S/
    h[:platforms]     = platforms.to_hash if platforms && !platforms.empty?
    h[:dependencies]  = dependencies.to_hash if dependencies && !dependencies.empty?
  end
end