Sha256: 279a551104fdae1bea3c516ad1bfd30500d7eeefd17079ba445b9b80314310f1

Contents?: true

Size: 1.02 KB

Versions: 85

Compression:

Stored size: 1.02 KB

Contents

require_relative "data_handler_base"
require_relative "../../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

85 entries across 85 versions & 1 rubygems

Version Path
chef-15.17.4-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.17.4 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.16.7-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.16.7 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.16.4-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.16.4 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.16.2-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.16.2 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.15.0-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.15.0 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.6.14-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.6.14 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.5.77 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.5.77-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.5.64 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.5.64-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.14.0 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-15.14.0-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.4.41 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb
chef-16.4.41-universal-mingw32 lib/chef/chef_fs/data_handler/cookbook_data_handler.rb