sourced_config 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/sourced_config/install_generator.rb +0 -8
- data/lib/generators/sourced_config/templates/config.yml.erb +1 -1
- data/lib/generators/sourced_config/templates/sourced_config.rb +5 -1
- data/lib/sourced_config/locale/loader.rb +1 -1
- data/lib/sourced_config/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8310a14aa124b78a0ab2edcbe7cbe64c61892581b444fb52629286a66429c7ab
|
4
|
+
data.tar.gz: a8998e0fc74c18f3a270d4034a0a7e60bcffa391c1cdfb267e00c79ec899d158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dd45f4b83c0f8e171ec6f231defa09d3633cce8100ac289ffa5a6e087eab86c2a59776f9997b12afec3a7c9b768a647480fa2fd7fb160439ccfd9bea66191bb
|
7
|
+
data.tar.gz: 967df093e6fbe881c3128b5cf55df599eecb959c0bacc327365ffbb1c255cd820fc75371db8f824fe3b9a187d2e2a7b8f1af609d477d08e0dcde4d45828ffd06
|
@@ -13,14 +13,6 @@ module SourcedConfig
|
|
13
13
|
template "templates/sourced_config.rb", "config/initializers/sourced_config.rb"
|
14
14
|
template "templates/config.yml.erb", "config/config.yml.erb"
|
15
15
|
template "templates/app_config_schema.rb", "app/config/app_config_schema.rb"
|
16
|
-
|
17
|
-
application do
|
18
|
-
<<RUBY
|
19
|
-
# Initialise watch of application configuration
|
20
|
-
config.after_initialize { |app| ::SourcedConfig.setup(app) }
|
21
|
-
config.before_eager_load { |app| ::SourcedConfig.setup(app) }
|
22
|
-
RUBY
|
23
|
-
end
|
24
16
|
end
|
25
17
|
end
|
26
18
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Configure after autoloading of constants so schema class can be specified
|
3
|
+
# Configure after autoloading of constants so schema class can be specified. But we use `to_prepare` so that configuration
|
4
|
+
# is loaded before `before_eager_load` and `after_initialize` callbacks where configuration maybe needed.
|
4
5
|
Rails.application.config.to_prepare do
|
5
6
|
SourcedConfig.configure do |config|
|
6
7
|
# This is the class that will be used to validate the configuration. The default is the minimum configuration
|
@@ -26,4 +27,7 @@ Rails.application.config.to_prepare do
|
|
26
27
|
# If the remote configuration source is an S3 bucket, the region of said bucket.
|
27
28
|
# config.configuration_bucket_region = "us-east-1"
|
28
29
|
end
|
30
|
+
|
31
|
+
# `to_prepare` is called on each app reload in development mode but setup only sets up file watchers once.
|
32
|
+
SourcedConfig.setup(Rails.application)
|
29
33
|
end
|
@@ -30,7 +30,7 @@ module SourcedConfig
|
|
30
30
|
Rails.logger.warn "[locale - #{locale}] Using only default app copy"
|
31
31
|
HashWithIndifferentAccess.new(locale => {})
|
32
32
|
else
|
33
|
-
raise StandardError, "When loading the
|
33
|
+
raise StandardError, "When loading the locales the type was unrecognised! #{type}"
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sourced_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Ierodiaconou
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|