Sha256: ca1130cc6cfbdddaa78fc4148b8861e5a27422555bbddaee924b9a093b001089

Contents?: true

Size: 1 KB

Versions: 20

Compression:

Stored size: 1 KB

Contents

require 'chef_fs/data_handler/data_handler_base'
require 'chef/environment'

module ChefFS
  module DataHandler
    class EnvironmentDataHandler < DataHandlerBase
      def normalize(environment, entry)
        super(environment, {
          'name' => remove_dot_json(entry.name),
          'description' => '',
          'cookbook_versions' => {},
          'default_attributes' => {},
          'override_attributes' => {},
          'json_class' => 'Chef::Environment',
          'chef_type' => 'environment'
        })
      end

      def preserve_key(key)
        return key == 'name'
      end

      def chef_class
        Chef::Environment
      end

      def to_ruby(object)
        result = to_ruby_keys(object, %w(name description default_attributes override_attributes))
        if object['cookbook_versions']
          object['cookbook_versions'].each_pair do |name, version|
            result << "cookbook #{name.inspect}, #{version.inspect}"
          end
        end
        result
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
knife-essentials-1.3 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.2.1 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.2 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.1.1 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.1 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.0.0 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.0.0.beta5 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.0.0.beta4 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.0.0.beta3 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.0.0.beta2 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-1.0.0.beta1 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.8 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.7 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.6 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.5 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.4 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.3 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.2 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.1 lib/chef_fs/data_handler/environment_data_handler.rb
knife-essentials-0.9.0 lib/chef_fs/data_handler/environment_data_handler.rb