i18n_screwdriver 10.2.1 → 10.3.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: f32fa0ff76461624fa972edfe3581125f8f1911c94d42bd5a352c3b4e907eb99
4
- data.tar.gz: fbd7e1ee3b0f645ab6fd0871bea7f4588d23365ac1cebae178e4c08312704ab2
3
+ metadata.gz: b25ce8143c4f385ce9a6bad32aa3b2815cd8e46d37006daed51678f5dc8ce7f9
4
+ data.tar.gz: fb807641974f1c8887c6cf5c391abd9a156b05e346d446e70506b8d12679c3aa
5
5
  SHA512:
6
- metadata.gz: 33118014b759c80e9739ed751c0004c161e88b441a9da12a2b7337b5b7bb13209d0289334c2cd8fc927bffb041c2a7ce6dcc31be9e76ae5cbe507edcdd756d17
7
- data.tar.gz: eb9093564c11927a9f7ffc6d946d99a120f0e3ffb81b4ecc42b292aa2b8727567a876d8350bdf36498cfd7ac9e1d0498b3c1d516986b80e74fa810bee7a1b100
6
+ metadata.gz: 0abff174472e13e311a9cc5690eb3dbc8198c45ff17ddc5179329f17cf0adf535c96d09003bc1c2b0edf05685d95a6f84cece1a974e0fc8359f3026f275d8ec3
7
+ data.tar.gz: efa90ec1fa82afbc8913360616410dfb9c96bb0bbd045c57d72087523281592ebd75cb712d6c77cb217b300e97ac5ea5f82f50c07e2fd6436ff7a68350530eeb
@@ -1 +1 @@
1
- 2.3
1
+ 2.6.1
@@ -55,9 +55,9 @@ module I18nScrewdriver
55
55
 
56
56
  def self.grab_js_texts_to_be_translated(string)
57
57
  [].tap do |texts|
58
- texts.concat(string.scan(/\bI18n\.screw\(?\s*(?<!\\)"(.*?)(?<!\\)"/).map{ |v| unescape_string(v[0]) })
59
- texts.concat(string.scan(/\bI18n\.screw\(?\s*(?<!\\)'(.*?)(?<!\\)'/).map{ |v| unescape_string(v[0]) })
60
- texts.concat(string.scan(/\bI18n\.screw\(?\s*(?<!\\)`(.*?)(?<!\\)`/).map{ |v| unescape_string(v[0]) })
58
+ texts.concat(string.scan(/\bI18n\.screw\w*\(?\s*(?<!\\)"(.*?)(?<!\\)"/).map{ |v| unescape_string(v[0]) })
59
+ texts.concat(string.scan(/\bI18n\.screw\w*\(?\s*(?<!\\)'(.*?)(?<!\\)'/).map{ |v| unescape_string(v[0]) })
60
+ texts.concat(string.scan(/\bI18n\.screw\w*\(?\s*(?<!\\)`(.*?)(?<!\\)`/).map{ |v| unescape_string(v[0]) })
61
61
  end
62
62
  end
63
63
 
@@ -1,3 +1,3 @@
1
1
  module I18nScrewdriver
2
- VERSION = "10.2.1"
2
+ VERSION = "10.3.0"
3
3
  end
@@ -37,4 +37,14 @@ describe I18nScrewdriver do
37
37
  expect(I18nScrewdriver.translate(:intro_text)).to eq("un lungo testo introduttivo")
38
38
  end
39
39
  end
40
+
41
+ describe "grab_js_texts_to_be_translated with screw based method" do
42
+ it "properly parses the passed string" do
43
+ expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screwBasedMethod("test!")|)).to eq(["test!"])
44
+ expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screwBasedMethod( "test!")|)).to eq(["test!"])
45
+ expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screwBasedMethod("Hi %{name}!", name: "gucki")|)).to eq(["Hi %{name}!"])
46
+ expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screwBasedMethod "test!"|)).to eq(["test!"])
47
+ expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screwBasedMethod "Hi %{name}!", name: "gucki"|)).to eq(["Hi %{name}!"])
48
+ end
49
+ end
40
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_screwdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.2.1
4
+ version: 10.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Miesel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-14 00:00:00.000000000 Z
12
+ date: 2019-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -104,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubyforge_project: i18n_screwdriver
108
- rubygems_version: 2.7.3
107
+ rubygems_version: 3.0.1
109
108
  signing_key:
110
109
  specification_version: 4
111
110
  summary: make translating with rails i18n fun again