Sha256: c2a6962041a4c3352d509185ff615710be8e8a642a5b83be8769148df578f541

Contents?: true

Size: 798 Bytes

Versions: 1

Compression:

Stored size: 798 Bytes

Contents

module Muchkeys
  class Rails < Rails::Railtie
    config.before_configuration do
      app_config = YAML.load(File.read(::Rails.root.join("config", "muchkeys.yml")))
      Muchkeys.configure do |config|
        config.application_name ||= app_config[:application_name] || ::Rails.application.class.parent_name.underscore
        config.consul_url       ||= app_config[:consul_url] || "http://localhost:8500"
        config.keys_dir         ||= app_config[:keys_dir]
        config.private_key      ||= app_config[:private_key]
        config.public_key       ||= app_config[:public_key]
        config.search_paths     ||= app_config[:search_paths]
        config.secrets_hint     ||= app_config[:secrets_hint]
      end

      Muchkeys.populate_environment!(*Muchkeys.env_keys)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
muchkeys-0.7.0 lib/muchkeys/rails.rb