copy_tuner_client 0.6.2 → 0.7.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: 789c9b67bd6bf2cc6a38f09f390c596764a9ee76ae0604269600c1189dd4b5bc
4
- data.tar.gz: e6fc7564b55bc3e7983873e432587e5fca53505ab30a31d5d6a079a4c689d443
3
+ metadata.gz: 1d873dcd3c1fc5d4319ea4185a8da8bc575709fd7622676e1a25d877a21ed9f5
4
+ data.tar.gz: 217af205a8c76d202ed91a84ad34021d6cc2b42191f13a41dcd4421df6b3e2ed
5
5
  SHA512:
6
- metadata.gz: f478acab8cb3f8d950116fb6f4f9f6215bbda4f2ee3bda58208d50a100f150304e75f1e0d96f3d4d9a760801d2fc69fb0c3a03947759d27a90b471593a1b7c80
7
- data.tar.gz: f24a159b6f2645dba1d69d42c2cd0161573da2e7e48950ff8b90484b9241b7eaf4faad376674b5a25d4c7c353a5a5fd19a4508abb99df5e043a3eaf493a40e2f
6
+ metadata.gz: 135e569c847621296af1e7d03db22a68631fb1ef928b61547c915f9ec94734647659b3b8a6bc26c6a120b93713e48939da3832697fb35a8cb207fb346c7831bf
7
+ data.tar.gz: c56ad0f710be1a534cbdc1966277679c005abd43ed82b28d5b31205e1376a6b99c2b1e86186e04273c6c1df79fbad1cb2ca7141d4c8547ec5e9bc713f3213f26
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.7.0
2
+
3
+ - Add config.upload_disabled_environments
4
+
1
5
  ## 0.6.2
2
6
 
3
7
  - Add arguments to export task
data/Gemfile.lock CHANGED
@@ -14,7 +14,7 @@ GIT
14
14
  PATH
15
15
  remote: .
16
16
  specs:
17
- copy_tuner_client (0.6.2)
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.3.1)
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 => 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? environment_name
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)
@@ -1,6 +1,6 @@
1
1
  module CopyTunerClient
2
2
  # Client version
3
- VERSION = '0.6.2'.freeze
3
+ VERSION = '0.7.0'.freeze
4
4
 
5
5
  # API version being used to communicate with the server
6
6
  API_VERSION = '2.0'.freeze
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.6.2
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-20 00:00:00.000000000 Z
11
+ date: 2021-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n