copy_tuner_client 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/lib/copy_tuner_client/cache.rb +2 -0
- data/lib/copy_tuner_client/configuration.rb +10 -2
- 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: 1d873dcd3c1fc5d4319ea4185a8da8bc575709fd7622676e1a25d877a21ed9f5
|
4
|
+
data.tar.gz: 217af205a8c76d202ed91a84ad34021d6cc2b42191f13a41dcd4421df6b3e2ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 135e569c847621296af1e7d03db22a68631fb1ef928b61547c915f9ec94734647659b3b8a6bc26c6a120b93713e48939da3832697fb35a8cb207fb346c7831bf
|
7
|
+
data.tar.gz: c56ad0f710be1a534cbdc1966277679c005abd43ed82b28d5b31205e1376a6b99c2b1e86186e04273c6c1df79fbad1cb2ca7141d4c8547ec5e9bc713f3213f26
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -14,7 +14,7 @@ GIT
|
|
14
14
|
PATH
|
15
15
|
remote: .
|
16
16
|
specs:
|
17
|
-
copy_tuner_client (0.
|
17
|
+
copy_tuner_client (0.7.0)
|
18
18
|
i18n (>= 0.5.0)
|
19
19
|
json
|
20
20
|
|
@@ -92,7 +92,7 @@ GEM
|
|
92
92
|
i18n (1.8.2)
|
93
93
|
concurrent-ruby (~> 1.0)
|
94
94
|
jaro_winkler (1.5.4)
|
95
|
-
json (2.
|
95
|
+
json (2.5.1)
|
96
96
|
loofah (2.5.0)
|
97
97
|
crass (~> 1.0.2)
|
98
98
|
nokogiri (>= 1.5.9)
|
@@ -17,6 +17,7 @@ module CopyTunerClient
|
|
17
17
|
@logger = options[:logger]
|
18
18
|
@mutex = Mutex.new
|
19
19
|
@exclude_key_regexp = options[:exclude_key_regexp]
|
20
|
+
@upload_disabled = options[:upload_disabled]
|
20
21
|
@locales = Array(options[:locales]).map(&:to_s)
|
21
22
|
# mutable states
|
22
23
|
@blurbs = {}
|
@@ -41,6 +42,7 @@ module CopyTunerClient
|
|
41
42
|
return if @exclude_key_regexp && key.match?(@exclude_key_regexp)
|
42
43
|
return unless key.include?('.')
|
43
44
|
return if @locales.present? && !@locales.member?(key.split('.').first)
|
45
|
+
return if @upload_disabled
|
44
46
|
|
45
47
|
lock do
|
46
48
|
return if @blank_keys.member?(key) || @blurbs.key?(key)
|
@@ -57,6 +57,9 @@ module CopyTunerClient
|
|
57
57
|
# @return [Array<String>] A list of environments in which the server should not be contacted
|
58
58
|
attr_accessor :test_environments
|
59
59
|
|
60
|
+
# @return [Array<String>] A list of environments in which the server should not be upload
|
61
|
+
attr_accessor :upload_disabled_environments
|
62
|
+
|
60
63
|
# @return [String] The name of the environment the application is running in
|
61
64
|
attr_accessor :environment_name
|
62
65
|
|
@@ -145,6 +148,7 @@ module CopyTunerClient
|
|
145
148
|
self.sync_interval_staging = 0
|
146
149
|
self.secure = true
|
147
150
|
self.test_environments = %w(test cucumber)
|
151
|
+
self.upload_disabled_environments = []
|
148
152
|
self.s3_host = 'copy-tuner-data-prod.s3.amazonaws.com'
|
149
153
|
self.disable_copyray_comment_injection = false
|
150
154
|
self.html_escape = false
|
@@ -163,7 +167,7 @@ module CopyTunerClient
|
|
163
167
|
# Returns a hash of all configurable options
|
164
168
|
# @return [Hash] configuration attributes
|
165
169
|
def to_hash
|
166
|
-
base_options = { :public
|
170
|
+
base_options = { public: public?, upload_disabled: upload_disabled? }
|
167
171
|
|
168
172
|
OPTIONS.inject(base_options) do |hash, option|
|
169
173
|
hash.merge option.to_sym => send(option)
|
@@ -198,7 +202,11 @@ module CopyTunerClient
|
|
198
202
|
# Determines if the content will fetched from the server
|
199
203
|
# @return [Boolean] Returns +true+ if in a test environment, +false+ otherwise.
|
200
204
|
def test?
|
201
|
-
test_environments.include?
|
205
|
+
test_environments.include?(environment_name)
|
206
|
+
end
|
207
|
+
|
208
|
+
def upload_disabled?
|
209
|
+
upload_disabled_environments.include?(environment_name)
|
202
210
|
end
|
203
211
|
|
204
212
|
# Determines if the configuration has been applied (internal)
|
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.7.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-04-
|
11
|
+
date: 2021-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|