Sha256: 1863a70eebf50ee13b8bcd1e0165707e61e2e357cde7e67603a7965dfe94d980
Contents?: true
Size: 776 Bytes
Versions: 3
Compression:
Stored size: 776 Bytes
Contents
# frozen_string_literal: true class Runger::Rails::Loaders::Secrets < Runger::Loaders::Base def call(name:, **_options) return {} unless ::Rails.application.respond_to?(:secrets) # Create a new hash cause secrets are mutable! config = {} trace!(:secrets) do secrets.public_send(name) end.then do |secrets| ::Runger::Utils.deep_merge!(config, secrets) if secrets end config end private def secrets @secrets ||= ::Rails.application.secrets.tap do |_| # Reset secrets state if the app hasn't been initialized # See https://github.com/palkan/runger_config/issues/14 next if ::Rails.application.initialized? ::Rails.application.remove_instance_variable(:@secrets) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
runger_config-5.2.0 | lib/runger/rails/loaders/secrets.rb |
runger_config-5.1.0 | lib/runger/rails/loaders/secrets.rb |
runger_config-5.0.0 | lib/runger/rails/loaders/secrets.rb |