copy_tuner_client 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15965d36a12789bda029ce93db59815b091aa1a6
4
- data.tar.gz: 6468475b0087640533d917d0b9adc9b1ef58b2b7
3
+ metadata.gz: 1abd5e463cf1feda1d3bf4edc83766f125960f0a
4
+ data.tar.gz: 22334e3d43c8cb9d89fd425a9f559247fc9b3b4a
5
5
  SHA512:
6
- metadata.gz: c0fe5ce9e0350fee38039f699433df6b2a3efcc21b38d8738656328d9b22aa3c22d50dba9876d462d7fae3c1a67335239aa9928ba191491f69a80afd9c22e24f
7
- data.tar.gz: 78f7e7c05c685d7293ebf2524aab33197f24f642fb4eaed440774a3df93f10844baf37c090ccebcba9179db53b8f0bac287ca0ebc549c6cfcfa2b86f36c3459d
6
+ metadata.gz: f3af76757b80aab3a52faf9d13cf0df3f8b2c051de85ee333bb3443f56c212c78c88a1b25b756e5a78a171533f81651dbf66b2d45b69556e1d9f351a1652501b
7
+ data.tar.gz: fda1d32f14cb117dd187d00a31339c23387c323f67d1700138f80fd85d71077f3549aef5e06bd139c1521216e072dda78cf8485341a3263c3b22630e9be77e07
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.2
2
+ - Support I18n.t :scope option.
3
+ - Update copyray_js_injection_regexp_for_debug.
4
+
1
5
  ## 0.3.1
2
6
  - Add search box to copyray bar.
3
7
  - Add disable_copyray_comment_injection to configuration.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- copy_tuner_client (0.3.1)
4
+ copy_tuner_client (0.3.2)
5
5
  i18n (>= 0.5.0)
6
6
  json
7
7
 
@@ -148,7 +148,8 @@ module CopyTunerClient
148
148
  # <script src="/assets/jquery.min.1.9.1.js"></script>
149
149
  # <script src="/assets/jquery.self-xxxxxx.js"></script>
150
150
  # <script src="/assets/jquery2.self-a4777c1acac0a74340755725342901a54ed000955bf6f5320491b8b2514c86ec.js?body=1" data-turbolinks-track="true"></script>
151
- self.copyray_js_injection_regexp_for_debug = /<script[^>]+\/jquery[23]?([-.]{1}[\d\.]+)?([-.]{1}min(\.[\d\.]+)?)?(\.self\-[\da-f]+)?\.js[^>]+><\/script>/
151
+ # <script src="/assets/jquery-09abf132254111788afa8aca28fc7872.js?body=1"></script>
152
+ self.copyray_js_injection_regexp_for_debug = /<script[^>]+\/jquery[23]?([-.]{1}[\d\.]+)?([-.]{1}min(\.[\d\.]+)?)?(\.self)?(\-[\da-f]+)?\.js[^>]+><\/script>/
152
153
 
153
154
  # Matches:
154
155
  # <script src="/application-xxxxxxx.js"></script>
@@ -21,12 +21,15 @@ module CopyTunerClient
21
21
  class << self
22
22
  def translate_with_copy_tuner_hook(*args)
23
23
  key = args[0]
24
+ options = args.last.is_a?(Hash) ? args.last : {}
25
+ scope = options[:scope]
26
+ scope = scope.dup if scope.is_a?(Array) || scope.is_a?(String)
24
27
  result = translate_without_copy_tuner_hook(*args)
25
28
 
26
29
  if key.is_a?(Array)
27
- key.zip(result).each { |k, v| CopyTunerClient::TranslationLog.add(k, v) unless v.is_a?(Array) }
30
+ key.zip(result).each { |k, v| CopyTunerClient::TranslationLog.add(I18n.normalize_keys(nil, k, scope).join('.'), v) unless v.is_a?(Array) }
28
31
  else
29
- CopyTunerClient::TranslationLog.add(key, result) unless result.is_a?(Array)
32
+ CopyTunerClient::TranslationLog.add(I18n.normalize_keys(nil, key, scope).join('.'), result) unless result.is_a?(Array)
30
33
  end
31
34
  result
32
35
  end
@@ -1,6 +1,6 @@
1
1
  module CopyTunerClient
2
2
  # Client version
3
- VERSION = '0.3.1'.freeze
3
+ VERSION = '0.3.2'.freeze
4
4
 
5
5
  # API version being used to communicate with the server
6
6
  API_VERSION = '2.0'.freeze
@@ -200,6 +200,7 @@ describe CopyTunerClient::Configuration do
200
200
  it { is_expected.to match '<script src="/assets/jquery.min.1.9.1.js"></script>' }
201
201
  it { is_expected.to match '<script src="/assets/jquery/jquery.self-a4777c1acac0a74340755725342901a54ed000955bf6f5320491b8b2514c86ec.js?body=1" data-turbolinks-track="true"></script>' }
202
202
  it { is_expected.to match '<script src="/assets/jquery2.self-a4777c1acac0a74340755725342901a54ed000955bf6f5320491b8b2514c86ec.js?body=1" data-turbolinks-track="true"></script>' }
203
+ it { is_expected.to match '<script src="/assets/jquery-09abf132254111788afa8aca28fc7872.js?body=1"></script>' }
203
204
  end
204
205
  end
205
206
 
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SonicGarden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-08 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n