r18n-rails-api 0.4.8 → 0.4.9

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.
Files changed (2) hide show
  1. data/lib/r18n-rails-api/loader.rb +6 -1
  2. metadata +19 -19
@@ -40,6 +40,11 @@ module R18n
40
40
  # +reload!+, +init_translations+ and +translations+ methods.
41
41
  def initialize(backend = ::I18n::Backend::Simple.new)
42
42
  @backend = backend
43
+ @private_type_class = if '1.8.' == RUBY_VERSION[0..3]
44
+ ::YAML::PrivateType
45
+ else
46
+ ::Syck::PrivateType
47
+ end
43
48
  end
44
49
 
45
50
  # Array of locales, which has translations in +I18n.load_path+.
@@ -87,7 +92,7 @@ module R18n
87
92
  else
88
93
  R18n::Utils.hash_map(value) { |k, v| [k.to_s, transform(v)] }
89
94
  end
90
- elsif value.is_a? ::YAML::PrivateType
95
+ elsif value.is_a? @private_type_class
91
96
  Typed.new(value.type_id, value.value)
92
97
  else
93
98
  value
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-rails-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 8
10
- version: 0.4.8
9
+ - 9
10
+ version: 0.4.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrey "A.I." Sitnik
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-22 00:00:00 +04:00
18
+ date: 2011-02-06 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - "="
28
28
  - !ruby/object:Gem::Version
29
- hash: 31
29
+ hash: 29
30
30
  segments:
31
31
  - 0
32
32
  - 4
33
- - 8
34
- version: 0.4.8
33
+ - 9
34
+ version: 0.4.9
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -64,15 +64,15 @@ files:
64
64
  - lib/r18n-rails-api/filters.rb
65
65
  - LICENSE
66
66
  - README.rdoc
67
- - spec/data/general/en.yml
68
- - spec/data/simple/russian.yml
69
- - spec/data/simple/en.yml
70
- - spec/data/simple/ru.rb
67
+ - spec/loader_spec.rb
68
+ - spec/spec_helper.rb
71
69
  - spec/data/other/en.yml
72
70
  - spec/data/other/ru.yml
73
- - spec/spec_helper.rb
71
+ - spec/data/simple/en.yml
72
+ - spec/data/simple/russian.yml
73
+ - spec/data/simple/ru.rb
74
+ - spec/data/general/en.yml
74
75
  - spec/backend_spec.rb
75
- - spec/loader_spec.rb
76
76
  - spec/filters_spec.rb
77
77
  has_rdoc: true
78
78
  homepage: http://r18n.rubyforge.org/
@@ -109,13 +109,13 @@ signing_key:
109
109
  specification_version: 3
110
110
  summary: Rails I18n compatibility for R18n
111
111
  test_files:
112
- - spec/data/general/en.yml
113
- - spec/data/simple/russian.yml
114
- - spec/data/simple/en.yml
115
- - spec/data/simple/ru.rb
112
+ - spec/loader_spec.rb
113
+ - spec/spec_helper.rb
116
114
  - spec/data/other/en.yml
117
115
  - spec/data/other/ru.yml
118
- - spec/spec_helper.rb
116
+ - spec/data/simple/en.yml
117
+ - spec/data/simple/russian.yml
118
+ - spec/data/simple/ru.rb
119
+ - spec/data/general/en.yml
119
120
  - spec/backend_spec.rb
120
- - spec/loader_spec.rb
121
121
  - spec/filters_spec.rb