Sha256: 04a9bef16ab0be24903cf7beee35814b7f767ec883016fa99caacc7ca4491e9f

Contents?: true

Size: 1.03 KB

Versions: 87

Compression:

Stored size: 1.03 KB

Contents

require "chef/chef_fs/data_handler/data_handler_base"
require "chef/cookbook/metadata"

class Chef
  module ChefFS
    module DataHandler
      class CookbookDataHandler < DataHandlerBase
        def normalize(cookbook, entry)
          version = entry.name
          name = entry.parent.name
          result = normalize_hash(cookbook, {
            "name" => "#{name}-#{version}",
            "version" => version,
            "cookbook_name" => name,
            "json_class" => "Chef::CookbookVersion",
            "chef_type" => "cookbook_version",
            "frozen?" => false,
            "metadata" => {},
          })
          result["metadata"] = normalize_hash(result["metadata"], {
            "version" => version,
            "name" => name,
          })
        end

        def preserve_key?(key)
          key == "cookbook_name" || key == "version"
        end

        def chef_class
          Chef::Cookbook::Metadata
        end

        # Not using this yet, so not sure if to_ruby will be useful.
      end
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
chef-14.15.6 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.15.6-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.14.29 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.14.29-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.14.25-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.14.25 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.14.14-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.14.14 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.13.11 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.12.9 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.12.3 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-13.12.14 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.11.21 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.10.9 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.9.13 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.8.12 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.7.17 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-13.12.3 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-14.6.47 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-13.11.3 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb