class Chef::Knife::EnvironmentFromFile

Public Class Methods

new(argv=[]) click to toggle source

Create a new instance of the current class configured for the given arguments and options

Calls superclass method
# File lib/chef/knife/chop/environment_from_file.rb, line 12
def initialize(argv=[])
  super(argv)
  @rsrctype = 'environment'
  @location = 'environments'
end

Public Instance Methods

load_environment(env) click to toggle source

DLDInternet monkey patch of original

# File lib/chef/knife/chop/environment_from_file.rb, line 19
def load_environment(env)
  updated = loader.load_from("environments", env)
  updated.save
  output(format_for_display(updated)) if config[:print_after]
  # BEGIN DLDInternet change
  ui.step("Updated Environment #{updated.name}")
  # END DLDInternet change
end

Private Instance Methods

translate_all_environments() click to toggle source

# File lib/chef/knife/chop/environment_from_file.rb, line 33
def translate_all_environments
  environments = find_all_environments
  if environments.empty?
    ui.fatal("Unable to find any environment files in '#{environments_path}'")
    exit(1)
  end
  environments.each do |env|
    translate_environment(env)
  end
end
translate_environment(env) click to toggle source

# File lib/chef/knife/chop/environment_from_file.rb, line 45
def translate_environment(env)
  updated = loader.load_from("environments", env)
  updated.translate(@config,env)
  output(format_for_display(updated)) if config[:print_after]
  ui.step("Translated Environment #{updated.name}")
end