gettext_i18n_rails_js 1.0.3 → 1.0.4

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: c7e0fb2f88a6468a2479c4df020a0478e8d38f22
4
- data.tar.gz: ec358e596d2e1623ff4943f7a99de0a6528ef616
3
+ metadata.gz: 51e1a1b94026798a925925c54bfb7d293f95565c
4
+ data.tar.gz: aaef6c498343a5a99743c094dc0ddc214b587dee
5
5
  SHA512:
6
- metadata.gz: dfe431a8a0447e24ae7c05722a4086139af9efc5fe176a8bb4c843a5fb74abf681fe4e878fde4670460370e682c0aca63a9547ff68195dbf7cf208fc383fa10d
7
- data.tar.gz: 8171393b8f7c459d858ec182a9642ddb6fa21aae74663cbb2f7f620d49d8a3c456315af594f5b68bdfedb586e0bc9ff61121b032c98927f7bd9f8692eab6f316
6
+ metadata.gz: 534dd004d25c63d600c0cd8e2bb84f96ee7fe309a18bf7ac8bcb23389cb3ff7e94fce0c22b83f0bc14665163e56fd35976da58b01a8d81b352f5e0b0435a5e76
7
+ data.tar.gz: 408a65e8ea88a8987049c0c409906a825d21d9e2d2ceb6fe79ade5ee5149e00f8da0bd3130e886cb373a4f016665a7919eaafe4e90011a25f5581bc461134c40
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.4](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.0.4) - 2016-05-31
4
+
5
+ * Support ES2015 template strings (@bradbarrow)
6
+
3
7
  ## [1.0.3](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.0.3) - 2015-11-03
4
8
 
5
9
  * Stop using bundler within the core lib (@domcleal)
@@ -73,7 +73,7 @@ module GettextI18nRailsJs
73
73
  def parse(file, _msgids = [])
74
74
  collect_for(file) do |function, arguments, line|
75
75
  key = arguments.scan(
76
- /('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/
76
+ /('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`)/
77
77
  ).collect do |match|
78
78
  match.first[1..-2]
79
79
  end.join(separator_for(function))
@@ -86,6 +86,7 @@ module GettextI18nRailsJs
86
86
  (
87
87
  '(?:[^'\\]|\\.)*?'|
88
88
  "(?:[^"\\]|\\.)*?"|
89
+ `(?:[^`\\]|\\.)*?`|
89
90
  [a-zA-Z0-9_\.()]*?
90
91
  )
91
92
  \s*
@@ -27,7 +27,7 @@ module GettextI18nRailsJs
27
27
  class Version
28
28
  MAJOR = 1
29
29
  MINOR = 0
30
- PATCH = 3
30
+ PATCH = 4
31
31
 
32
32
  PRE = nil
33
33
 
@@ -123,6 +123,22 @@ describe GettextI18nRailsJs::Parser::Javascript do
123
123
  end
124
124
  end
125
125
 
126
+ it "finds messages with newlines/tabs (backticks)" do
127
+ content = <<-'EOF'
128
+ bla = __(`xxxx\n\tfoo`)
129
+ EOF
130
+
131
+ with_file content do |path|
132
+ expect(parser.parse(path, [])).to(
133
+ eq(
134
+ [
135
+ ["xxxx\\n\\tfoo", "#{path}:1"]
136
+ ]
137
+ )
138
+ )
139
+ end
140
+ end
141
+
126
142
  it "finds interpolated multi-line messages" do
127
143
  content = <<-'EOF'
128
144
  """ Parser should grab
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.0.3
4
+ version: 1.0.4
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: 2015-11-03 00:00:00.000000000 Z
12
+ date: 2016-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -178,18 +178,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.4.5.1
181
+ rubygems_version: 2.2.5
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.coffee
188
- - spec/fixtures/example.handlebars
189
187
  - spec/fixtures/example.js
190
- - spec/gettext_i18n_rails_js/parser/handlebars_spec.rb
188
+ - spec/fixtures/example.handlebars
189
+ - spec/fixtures/example.coffee
190
+ - spec/support/with_file.rb
191
191
  - spec/gettext_i18n_rails_js/parser/javascript_spec.rb
192
+ - spec/gettext_i18n_rails_js/parser/handlebars_spec.rb
192
193
  - spec/gettext_i18n_rails_js_spec.rb
193
194
  - spec/spec_helper.rb
194
- - spec/support/with_file.rb
195
195
  has_rdoc: