Sha256: ce86ea05b636fc66f1a0b3bcc95ba6ec849b90e11f708164e8897b0268210166
Contents?: true
Size: 654 Bytes
Versions: 2
Compression:
Stored size: 654 Bytes
Contents
module EnvJson # Rails hook to autoload ENV from JSON file before configuration class Railtie < Rails::Railtie config.before_configuration { load_env } # railtie hook to load env with Rails.env as environment name and config/env.json files as source def load_env() env_json_file = Rails.root.join('config/env.json') environment_name = Rails.env puts "EnvJson: file #{env_json_file} does not exists" && return unless File.exists? env_json_file EnvJson.load_env_from_source_with_overrides(env_json_file, environment_name) end rake_tasks do load File.join(__dir__, 'rails_tasks.rb') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
env_json-0.3.0 | lib/env_json/railtie.rb |
env_json-0.2.2 | lib/env_json/railtie.rb |