class EY::Config::EnvironmentConfig

Attributes

name[R]

Public Class Methods

new(config, name, parent) click to toggle source
# File lib/engineyard/config.rb, line 103
def initialize(config, name, parent)
  @config = config || {}
  @name = name
  @parent = parent
end

Public Instance Methods

branch() click to toggle source
# File lib/engineyard/config.rb, line 125
def branch
  fetch('branch', nil)
end
ensure_exists() click to toggle source
# File lib/engineyard/config.rb, line 113
def ensure_exists
  unless path && path.exist?
    raise EY::Error, "Please initialize this application with the following command:\n\tey init"
  end
end
fetch(key, default = nil, &block) click to toggle source
# File lib/engineyard/config.rb, line 119
def fetch(key, default = nil, &block)
  @config.fetch(key.to_s) do
    @parent.fetch_from_defaults(key.to_s, default, &block)
  end
end
migrate() click to toggle source
# File lib/engineyard/config.rb, line 129
def migrate
  ensure_exists
  fetch('migrate') do
    raise EY::Error, "'migrate' not found in #{path}. Reinitialize with:\n\tey init"
  end
end
migrate_command()
Alias for: migration_command
migration_command() click to toggle source
# File lib/engineyard/config.rb, line 136
def migration_command
  ensure_exists
  fetch('migration_command') do
    raise EY::Error, "'migration_command' not found in #{path}. Reinitialize with:\n\tey init"
  end
end
Also aliased as: migrate_command
path() click to toggle source
# File lib/engineyard/config.rb, line 109
def path
  @parent.path
end
verbose() click to toggle source
# File lib/engineyard/config.rb, line 145
def verbose
  fetch('verbose', false)
end