copy_tuner_client 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/copy_tuner_client/configuration.rb +9 -1
- data/lib/copy_tuner_client/errors.rb +3 -0
- data/lib/copy_tuner_client/i18n_backend.rb +6 -0
- data/lib/copy_tuner_client/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: 02e158d00caa261a1c3cf73b38648bde2307f5160708fcf39e7e84b542c2ecc6
|
4
|
+
data.tar.gz: ca6f9c714f15afbace17d89d3ef67a71546d5b414be83ff09e59c6b9b1974958
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffb1ebc5fb6f78326f820527646f32eb6fcbf09c622f90d299d61a96778c27ad0954d0c8db784d96a4c93534a5eee0acb01eed824ddd1cbcee0aa5fae5cd35cc
|
7
|
+
data.tar.gz: 1ebe88eb8278fee882c0129908c562157b0ca16e6b7ac0181ae9774f53df84e5df3fcd63a843586302ab6010d369bf19d78bae8453cdc28fbf463977b8d7ede7
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -19,7 +19,7 @@ module CopyTunerClient
|
|
19
19
|
:proxy_port, :proxy_user, :secure, :polling_delay, :sync_interval,
|
20
20
|
:sync_interval_staging, :sync_ignore_path_regex, :logger,
|
21
21
|
:framework, :middleware, :disable_middleware, :disable_test_translation,
|
22
|
-
:ca_file, :exclude_key_regexp, :s3_host, :locales].freeze
|
22
|
+
:ca_file, :exclude_key_regexp, :s3_host, :locales, :ignored_keys, :ignored_key_handler].freeze
|
23
23
|
|
24
24
|
# @return [String] The API key for your project, found on the project edit form.
|
25
25
|
attr_accessor :api_key
|
@@ -131,6 +131,12 @@ module CopyTunerClient
|
|
131
131
|
# @return [Boolean] Html escape
|
132
132
|
attr_accessor :html_escape
|
133
133
|
|
134
|
+
# @return [Array<String>] A list of ignored keys
|
135
|
+
attr_accessor :ignored_keys
|
136
|
+
|
137
|
+
# @return [Proc]
|
138
|
+
attr_accessor :ignored_key_handler
|
139
|
+
|
134
140
|
alias_method :secure?, :secure
|
135
141
|
|
136
142
|
# Instantiated from {CopyTunerClient.configure}. Sets defaults.
|
@@ -152,6 +158,8 @@ module CopyTunerClient
|
|
152
158
|
self.s3_host = 'copy-tuner-data-prod.s3.amazonaws.com'
|
153
159
|
self.disable_copyray_comment_injection = false
|
154
160
|
self.html_escape = false
|
161
|
+
self.ignored_keys = []
|
162
|
+
self.ignored_key_handler = -> (e) { raise e }
|
155
163
|
|
156
164
|
@applied = false
|
157
165
|
end
|
@@ -65,6 +65,12 @@ module CopyTunerClient
|
|
65
65
|
|
66
66
|
parts = I18n.normalize_keys(locale, key, scope, options[:separator])
|
67
67
|
key_with_locale = parts.join('.')
|
68
|
+
key_without_locale = parts[1..].join('.')
|
69
|
+
|
70
|
+
if CopyTunerClient::configuration.ignored_keys.include?(key_without_locale)
|
71
|
+
CopyTunerClient::configuration.ignored_key_handler.call(IgnoredKey.new("Ignored key: #{key_without_locale}"))
|
72
|
+
end
|
73
|
+
|
68
74
|
content = cache[key_with_locale] || super
|
69
75
|
cache[key_with_locale] = nil if content.nil?
|
70
76
|
content
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: copy_tuner_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SonicGarden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|