module Sunzi::Cli::Database

Attributes

env[RW]

Public Instance Methods

load_env(stage) click to toggle source
# File lib/sunzi/cli/database.rb, line 7
def load_env(stage)
  path = File.expand_path('config/database.yml')
  @env = YAML.load(File.read(path))[stage]
  scope_keys
  @env = HashWithIndifferentAccess.new(@env)
end

Private Instance Methods

scope_keys() click to toggle source
# File lib/sunzi/cli/database.rb, line 16
def scope_keys
  @env = @env.reduce({}) do |env, (key, value)|
    env[:"db_#{key}"] = value
    env
  end
end