class HealthInspector::Checklists::Environments

Public Instance Methods

load_item(name) click to toggle source
# File lib/health_inspector/checklists/environments.rb, line 18
def load_item(name)
  Environment.new(@context,
                  name: name,
                  server: load_item_from_server(name),
                  local: load_item_from_local(name)
  )
end
load_item_from_local(name) click to toggle source
# File lib/health_inspector/checklists/environments.rb, line 42
def load_item_from_local(name)
  load_ruby_or_json_from_local(Chef::Environment, 'environments', name)
end
load_item_from_server(name) click to toggle source
# File lib/health_inspector/checklists/environments.rb, line 36
def load_item_from_server(name)
  Chef::Environment.load(name).to_hash
rescue
  nil
end
local_items() click to toggle source
# File lib/health_inspector/checklists/environments.rb, line 30
def local_items
  Dir["#{@context.repo_path}/environments/**/*.{rb,json,js}"].map do |e|
    File.basename(e, '.*')
  end
end
server_items() click to toggle source
# File lib/health_inspector/checklists/environments.rb, line 26
def server_items
  @server_items ||= Chef::Environment.list.keys
end