gettext_i18n_rails_js 1.2.0 → 1.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
  SHA1:
3
- metadata.gz: 9d1b5907d21b5b2433ed3277842c3b20091a1912
4
- data.tar.gz: 4f8ec5b71d44cbb522cb469b9e26a11c8bf23315
3
+ metadata.gz: b6c9be7f40d1ccdd5cde0c1bb93d85d4174957d1
4
+ data.tar.gz: 6ed13ca56f91509c75416cea2c42942305ad0c0a
5
5
  SHA512:
6
- metadata.gz: 0dd2b745b857659a2249c6f70047b4249b35b1c13469cfb0f8dc64a35a8affd155a6d67c8e43bf298ff26e025d5bb222022e0ae2ef9a2053ab54650ea31c1cad
7
- data.tar.gz: 575ff0e579024f2c34acacd34fb429d7f3c07d8576f71b04aea08751ef9708ac318aa06536be47e157fdb061a8e3de264aa82f5afedc92051c7182f8e8747d90
6
+ metadata.gz: da0f449e49c3cde558b8b0e8dc7214e715befb293573a4d8efb6045753839ff2a78b73972e790cc5f8423508f0cf14a7e2dd9126263942bc2292f12036a83953
7
+ data.tar.gz: fc95857165d43b45bb9c4417bdce81531acc150c5a3bc10dd1b967dc5a271984821e041df1230ccd5db3b91bcd756c7f8c36ce5fa7f5bee2ffd5d4a1ec0e3ae1
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.3.0) - 2017-03-16
4
+
5
+ * Fixed Handlebars translations with options (@mikezaby)
6
+ * Fixed latest Rubocop offenses (@mikezaby)
7
+ * Dropped failing coveralls, fixed codeclimate (@tboerger)
8
+
3
9
  ## [1.2.0](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.2.0) - 2016-06-02
4
10
 
5
11
  * Support for JSX files (@artemv)
@@ -62,15 +62,15 @@ module GettextI18nRailsJs
62
62
  # * Remaining arguments
63
63
  # * Function call closing parenthesis
64
64
  #
65
-
66
65
  /
67
66
  \B[{]{2}(
68
67
  ([snN]?#{gettext_function})
69
68
  \s+
70
69
  (
71
- ".*?"
72
- .*?
70
+ (["'])(?:\\?+.)*?\4
71
+ (?:\s+(["'])(?:\\?+.)*?\5)?
73
72
  )
73
+ .*?
74
74
  )
75
75
  [}]{2}
76
76
  /x
@@ -26,7 +26,7 @@
26
26
  module GettextI18nRailsJs
27
27
  class Version
28
28
  MAJOR = 1
29
- MINOR = 2
29
+ MINOR = 3
30
30
  PATCH = 0
31
31
 
32
32
  PRE = nil
@@ -60,14 +60,14 @@ describe GettextI18nRailsJs::Parser::Handlebars do
60
60
  describe "#parse" do
61
61
  it "finds plural messages" do
62
62
  content = <<-EOF
63
- <div>{{n__ "xxxx" "yyyy\" "zzzz" some_count}}</div>
63
+ <div>{{n__ "xxxx" "yyyy" some_count}}</div>
64
64
  EOF
65
65
 
66
66
  with_file content do |path|
67
67
  expect(parser.parse(path, [])).to(
68
68
  eq(
69
69
  [
70
- ["xxxx\000yyyy\000zzzz", "#{path}:1"]
70
+ ["xxxx\000yyyy", "#{path}:1"]
71
71
  ]
72
72
  )
73
73
  )
@@ -76,7 +76,7 @@ describe GettextI18nRailsJs::Parser::Handlebars do
76
76
 
77
77
  it "finds namespaced messages" do
78
78
  content = <<-EOF
79
- <div>{{__ "xxxx", "yyyy"}}</div>
79
+ <div>{{__ "xxxx" "yyyy"}}</div>
80
80
  EOF
81
81
 
82
82
  with_file content do |path|
@@ -106,6 +106,22 @@ describe GettextI18nRailsJs::Parser::Handlebars do
106
106
  end
107
107
  end
108
108
 
109
+ it "finds single quote messages" do
110
+ content = <<-EOF
111
+ <div>{{__ 'blah'}}</div>
112
+ EOF
113
+
114
+ with_file content do |path|
115
+ expect(parser.parse(path, [])).to(
116
+ eq(
117
+ [
118
+ ["blah", "#{path}:1"]
119
+ ]
120
+ )
121
+ )
122
+ end
123
+ end
124
+
109
125
  # it "finds messages with newlines/tabs" do
110
126
  # content = <<-EOF
111
127
  # bla = __("xxxx\n\tfoo")
@@ -234,6 +250,24 @@ describe GettextI18nRailsJs::Parser::Handlebars do
234
250
  end
235
251
  end
236
252
 
253
+ it "does not parse options" do
254
+ content = <<-EOF
255
+ <div>
256
+ {{__ "test with %{param}" param="something"}}
257
+ </div>
258
+ EOF
259
+
260
+ with_file content do |path|
261
+ expect(parser.parse(path, [])).to(
262
+ eq(
263
+ [
264
+ ["test with %{param}", "#{path}:1"]
265
+ ]
266
+ )
267
+ )
268
+ end
269
+ end
270
+
237
271
  # it "does not parse internal functions" do
238
272
  # content = <<-EOF
239
273
  # bla = n__("items (single)", "i (more)", item.count()) + __('foobar')
@@ -279,7 +313,7 @@ describe GettextI18nRailsJs::Parser::Handlebars do
279
313
  <div>
280
314
  {{gettext \"Hello {yourname}\"}}
281
315
  <span>
282
- {{ngettext \"item\", \"items\", 44}}
316
+ {{ngettext \"item\" \"items\" 44}}
283
317
  </span>
284
318
  </div>
285
319
  EOF
@@ -24,26 +24,10 @@
24
24
  #
25
25
 
26
26
  require "simplecov"
27
+ require "codeclimate-test-reporter" if ENV["CODECLIMATE_REPO_TOKEN"]
27
28
 
28
- if ENV["CODECLIMATE_REPO_TOKEN"]
29
- require "coveralls"
30
- require "codeclimate-test-reporter"
31
-
32
- Coveralls.wear!
33
- CodeClimate::TestReporter.start
34
-
35
- SimpleCov.start do
36
- add_filter "/spec"
37
-
38
- formatter SimpleCov::Formatter::MultiFormatter[
39
- SimpleCov::Formatter::HTMLFormatter,
40
- CodeClimate::TestReporter::Formatter
41
- ]
42
- end
43
- else
44
- SimpleCov.start do
45
- add_filter "/spec"
46
- end
29
+ SimpleCov.start do
30
+ add_filter "/spec"
47
31
  end
48
32
 
49
33
  require "gettext_i18n_rails_js"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_i18n_rails_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Boerger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-12 00:00:00.000000000 Z
12
+ date: 2017-03-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -178,18 +178,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.2.5
181
+ rubygems_version: 2.5.1
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Extends gettext_i18n_rails making your .po files available to client side
185
185
  javascript as JSON
186
186
  test_files:
187
- - spec/fixtures/example.js
188
- - spec/fixtures/example.handlebars
189
187
  - spec/fixtures/example.coffee
190
- - spec/support/with_file.rb
191
- - spec/gettext_i18n_rails_js/parser/javascript_spec.rb
188
+ - spec/fixtures/example.handlebars
189
+ - spec/fixtures/example.js
192
190
  - spec/gettext_i18n_rails_js/parser/handlebars_spec.rb
191
+ - spec/gettext_i18n_rails_js/parser/javascript_spec.rb
193
192
  - spec/gettext_i18n_rails_js_spec.rb
194
193
  - spec/spec_helper.rb
195
- has_rdoc:
194
+ - spec/support/with_file.rb