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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99b9388005849ac1568ac1694edd62c06c1bdc6b94b0533393f4b753720d8447
4
- data.tar.gz: a614d545a272b2367834ae0c45abe2a6b1a11530653090e2778ddf6baecb327e
3
+ metadata.gz: 8310a14aa124b78a0ab2edcbe7cbe64c61892581b444fb52629286a66429c7ab
4
+ data.tar.gz: a8998e0fc74c18f3a270d4034a0a7e60bcffa391c1cdfb267e00c79ec899d158
5
5
  SHA512:
6
- metadata.gz: b231f3234f177b62fff9fd6357cbc51a5ec0f8d403115f2d60f9ba30a4fe522cc388e17ebb59c5889e9aeec74211017d2d9a95a53db294f58f19711b52ed9a61
7
- data.tar.gz: 3cd8e908f7a4012ea301aa54b618c3be41c3e681b3da831134abc679dfb5385fd8ab6e3441410db6fa4d27cfb5aae90fff6d122bd47deeed3bd1342000163091
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,5 +1,5 @@
1
1
  locales:
2
2
  supported:
3
3
  - en
4
- # load_from_type: local-directory
4
+ load_from_type: default
5
5
  # load_from_source: customer_app/locales/
@@ -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 Copy and Content the type was unrecognised! #{type}"
33
+ raise StandardError, "When loading the locales the type was unrecognised! #{type}"
34
34
  end
35
35
  end
36
36
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SourcedConfig
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.0"
5
5
  end
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.3.1
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-16 00:00:00.000000000 Z
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