r18n-core 2.1.1 → 2.1.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: 11bc4dc5f4a8d95074acf505f1da8e2ee403bdca
4
- data.tar.gz: cbce6b1aa70f9ae9b07b9c7b737c631989e1fba8
3
+ metadata.gz: 68ff840b9a7642dd18fca8af6172a1fc3cc859e5
4
+ data.tar.gz: c2fd43948dcbf36b58a43016cc98ee624fe90ebc
5
5
  SHA512:
6
- metadata.gz: 0717a656b81a5b0e85d83375099077f3d65d322e6ed69c4ec042fb418f812340aabf8a36fc48bc38fd942ebcfb6c66c871b6a1fec5c13f0801b22619d5998241
7
- data.tar.gz: 77ff86c5ba4493c592031d83975bc200a70cf782e5c602130cf6c37fbf23f2a1148043a0ceb277cc525c1742968dbac196c6f0780d8042c01e3d9336d0ac0560
6
+ metadata.gz: 5167736c090fca6199ab4e0c8ec06142287fbf87c2ae24e3b1dbecc874e398a47872cd55e75feee6560c2253a7121eb622b09f432ebc3525acfeffc9bf2714d9
7
+ data.tar.gz: 3079adcd2fea7198e10185f7d2510e3878cb91fbd51702d5075d731e219784f9df447975dd9150c0cfcf676a28491cca18e88fcdbc149a284e8c2edf7509b5b2
@@ -1,3 +1,6 @@
1
+ ## 2.1.2 (Wien)
2
+ * Fix Ruby 2.3 support.
3
+
1
4
  ## 2.1.1 (Barcelona)
2
5
  * Better sanity check for Accept-Language header (by Viktors Rotanovs).
3
6
 
@@ -230,8 +230,7 @@ module R18n
230
230
 
231
231
  Filters.add(String, :variables) do |content, config, *params|
232
232
  cached_params = []
233
- content = content.clone
234
- content.gsub!(/\%\d/) do |key|
233
+ content.to_s.gsub(/\%\d/) do |key|
235
234
  i = key[1..-1].to_i
236
235
  unless cached_params.include? i - 1
237
236
  param = config[:locale].localize(params[i - 1])
@@ -243,7 +242,6 @@ module R18n
243
242
  end
244
243
  cached_params[i - 1]
245
244
  end
246
- content
247
245
  end
248
246
 
249
247
  Filters.add(Untranslated, :untranslated) do |v, c, translated, untranslated|
@@ -28,10 +28,12 @@ module R18n
28
28
 
29
29
  # Returns a new string object containing a copy of +str+, which translated
30
30
  # for +path+ to +locale+
31
- def initialize(str, locale, path, filters = nil)
32
- super(str)
31
+ def initialize(value, locale, path, filters = nil)
32
+ value = value.to_s if value.is_a? TranslatedString
33
+ super(value)
33
34
  @filters = filters
34
35
  @locale = locale
36
+ @value = value
35
37
  @path = path
36
38
  end
37
39
 
@@ -53,9 +55,9 @@ module R18n
53
55
  # Override to_s to make string html safe if `html_safe` method is defined.
54
56
  def to_s
55
57
  if respond_to? :html_safe
56
- html_safe
58
+ @value.html_safe
57
59
  else
58
- String.new(self)
60
+ @value
59
61
  end
60
62
  end
61
63
 
@@ -93,7 +93,7 @@ module R18n
93
93
  when String
94
94
  c = { locale: locale, path: path }
95
95
  v = @filters.process_string(:passive, value, c, [])
96
- value = TranslatedString.new(v, locale, path, @filters)
96
+ value = TranslatedString.new(v, locale, path, @filter)
97
97
  when Typed
98
98
  value.locale = locale
99
99
  value.path = path
@@ -1,3 +1,3 @@
1
1
  module R18n
2
- VERSION = '2.1.1'.freeze unless defined? R18n::VERSION
2
+ VERSION = '2.1.2'.freeze unless defined? R18n::VERSION
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2015-12-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  R18n is a i18n tool to translate your Ruby application.
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  requirements: []
169
169
  rubyforge_project:
170
- rubygems_version: 2.4.5
170
+ rubygems_version: 2.5.1
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: I18n tool to translate your Ruby application.