Sha256: bc4940cb86f03f9b431bb44d8e635578b9c7778f58a796347dbbc9d4afbc1fa5

Contents?: true

Size: 1.56 KB

Versions: 33

Compression:

Stored size: 1.56 KB

Contents

#
# Author:: Stephen Delano (<stephen@opscode.com>)
# Author:: Seth Falcon (<seth@opscode.com>)
# Author:: John Keiser (<jkeiser@ospcode.com>)
# Author:: Kyle Goodwin (<kgoodwin@primerevenue.com>)
# Copyright:: Copyright 2010-2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require 'json'
require 'chef/knife/chop/translate'

require 'chef/knife/chop/errors'
include ChopErrors
require 'chef/knife/chop/chef_part'

class ::Chef::Environment
  attr_reader :logger

  # --------------------------------------------------------------------------------------------------------------------
  def generate_json(part)
    self.to_json
  end

  # --------------------------------------------------------------------------------------------------------------------
  def generate_rb(part)
    src = []
    src << "name '#{@name}'"
    src << "description '#{@description}'"
    src << part.hash_to_rb('cookbook_versions')
    src << part.hash_to_rb('default_attributes')
    src << part.hash_to_rb('override_attributes')
    src.join("\n")
  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
knife-chop-0.12.18 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.12.17 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.12.03 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.11.12 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.9.5 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.9.4 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.9.2 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.9.1 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.9.0 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.8.3 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.8.2 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.8.0 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.7.8 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.7.2 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.7.1 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.7.0 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.6.7 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.5.15 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.4.1 lib/chef/knife/chop/chef_environment.rb
knife-chop-0.4.0 lib/chef/knife/chop/chef_environment.rb