mongoid_i18n 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile.lock +49 -77
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/mongoid/i18n.rb +4 -4
- data/mongoid_i18n.gemspec +44 -27
- metadata +113 -14
- data/.gitignore +0 -23
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.8.7-p299
|
data/Gemfile.lock
CHANGED
@@ -1,77 +1,49 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
-
|
33
|
-
|
34
|
-
-
|
35
|
-
|
36
|
-
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
- json_pure:
|
51
|
-
version: 1.4.6
|
52
|
-
- rubyforge:
|
53
|
-
version: 2.0.4
|
54
|
-
- jeweler:
|
55
|
-
version: 1.4.0
|
56
|
-
- mocha:
|
57
|
-
version: 0.9.8
|
58
|
-
- mongo:
|
59
|
-
version: 1.0.8
|
60
|
-
- tzinfo:
|
61
|
-
version: 0.3.23
|
62
|
-
- will_paginate:
|
63
|
-
version: 3.0.pre2
|
64
|
-
- mongoid:
|
65
|
-
version: 2.0.0.beta7
|
66
|
-
- rspec-core:
|
67
|
-
version: 2.0.0.beta.20
|
68
|
-
- rspec-expectations:
|
69
|
-
version: 2.0.0.beta.20
|
70
|
-
- rspec-mocks:
|
71
|
-
version: 2.0.0.beta.20
|
72
|
-
- rspec:
|
73
|
-
version: 2.0.0.beta.20
|
74
|
-
hash: 6dfab5e2b924a3176f60464404e1350aed0df898
|
75
|
-
sources:
|
76
|
-
- Rubygems:
|
77
|
-
uri: http://gemcutter.org
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activemodel (3.0.3)
|
5
|
+
activesupport (= 3.0.3)
|
6
|
+
builder (~> 2.1.2)
|
7
|
+
i18n (~> 0.4)
|
8
|
+
activesupport (3.0.3)
|
9
|
+
bson (1.1.2)
|
10
|
+
bson_ext (1.1.2)
|
11
|
+
builder (2.1.2)
|
12
|
+
diff-lcs (1.1.2)
|
13
|
+
git (1.2.5)
|
14
|
+
i18n (0.4.2)
|
15
|
+
jeweler (1.5.1)
|
16
|
+
bundler (~> 1.0.0)
|
17
|
+
git (>= 1.2.5)
|
18
|
+
rake
|
19
|
+
mocha (0.9.9)
|
20
|
+
rake
|
21
|
+
mongo (1.1.2)
|
22
|
+
bson (>= 1.1.1)
|
23
|
+
mongoid (2.0.0.beta.20)
|
24
|
+
activemodel (~> 3.0)
|
25
|
+
mongo (~> 1.1)
|
26
|
+
tzinfo (~> 0.3.22)
|
27
|
+
will_paginate (~> 3.0.pre)
|
28
|
+
rake (0.8.7)
|
29
|
+
rspec (2.1.0)
|
30
|
+
rspec-core (~> 2.1.0)
|
31
|
+
rspec-expectations (~> 2.1.0)
|
32
|
+
rspec-mocks (~> 2.1.0)
|
33
|
+
rspec-core (2.1.0)
|
34
|
+
rspec-expectations (2.1.0)
|
35
|
+
diff-lcs (~> 1.1.2)
|
36
|
+
rspec-mocks (2.1.0)
|
37
|
+
tzinfo (0.3.23)
|
38
|
+
will_paginate (3.0.pre2)
|
39
|
+
|
40
|
+
PLATFORMS
|
41
|
+
ruby
|
42
|
+
|
43
|
+
DEPENDENCIES
|
44
|
+
bson_ext
|
45
|
+
bundler
|
46
|
+
jeweler
|
47
|
+
mocha
|
48
|
+
mongoid (>= 2.0.0.beta.9)
|
49
|
+
rspec (>= 2.0.0.beta.8)
|
data/Rakefile
CHANGED
@@ -16,8 +16,8 @@ begin
|
|
16
16
|
gem.email = "papipo@gmail.com"
|
17
17
|
gem.homepage = "http://github.com/Papipo/mongoid_i18n"
|
18
18
|
gem.authors = ["Rodrigo Álvarez"]
|
19
|
-
gem.add_dependency "mongoid", '>= 2.0.0.beta.
|
20
|
-
gem.add_development_dependency "rspec", "
|
19
|
+
gem.add_dependency "mongoid", '>= 2.0.0.beta.20'
|
20
|
+
gem.add_development_dependency "rspec", "2.1.0"
|
21
21
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
22
22
|
end
|
23
23
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/lib/mongoid/i18n.rb
CHANGED
@@ -20,12 +20,12 @@ module Mongoid
|
|
20
20
|
if options[:type] == LocalizedField
|
21
21
|
define_method(meth) { read_attribute(name)[::I18n.locale.to_s] rescue '' }
|
22
22
|
define_method("#{meth}=") do |value|
|
23
|
-
if value.is_a?(Hash)
|
24
|
-
|
23
|
+
value = if value.is_a?(Hash)
|
24
|
+
(@attributes[name] || {}).merge(value)
|
25
25
|
else
|
26
|
-
|
26
|
+
(@attributes[name] || {}).merge(::I18n.locale.to_s => value)
|
27
27
|
end
|
28
|
-
write_attribute(name,
|
28
|
+
write_attribute(name, value)
|
29
29
|
end
|
30
30
|
define_method("#{meth}_translations") { read_attribute(name) }
|
31
31
|
define_method("#{meth}_translations=") { |value| write_attribute(name, value) }
|
data/mongoid_i18n.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mongoid_i18n}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rodrigo \303\201lvarez"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-19}
|
13
13
|
s.description = %q{This gem aims to be a transparent way to deal with localizable fields.
|
14
14
|
Basically use localized_field() instead of field() and that's it.
|
15
15
|
It will take care of locales for you when using find or criteria.
|
@@ -17,53 +17,70 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.email = %q{papipo@gmail.com}
|
18
18
|
s.extra_rdoc_files = [
|
19
19
|
"LICENSE",
|
20
|
-
|
20
|
+
"README.rdoc"
|
21
21
|
]
|
22
22
|
s.files = [
|
23
23
|
".document",
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
24
|
+
".rvmrc",
|
25
|
+
"Gemfile",
|
26
|
+
"Gemfile.lock",
|
27
|
+
"LICENSE",
|
28
|
+
"README.rdoc",
|
29
|
+
"Rakefile",
|
30
|
+
"VERSION",
|
31
|
+
"lib/mongoid/i18n.rb",
|
32
|
+
"lib/mongoid/i18n/localized_criteria.rb",
|
33
|
+
"lib/mongoid/i18n/localized_field.rb",
|
34
|
+
"mongoid_i18n.gemspec",
|
35
|
+
"spec/.rspec",
|
36
|
+
"spec/integration/mongoid/i18n_spec.rb",
|
37
|
+
"spec/spec_helper.rb",
|
38
|
+
"spec/unit/mongoid/i18n/localized_criteria_spec.rb",
|
39
|
+
"spec/unit/mongoid/i18n_spec.rb"
|
40
40
|
]
|
41
41
|
s.homepage = %q{http://github.com/Papipo/mongoid_i18n}
|
42
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
43
42
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.
|
43
|
+
s.rubygems_version = %q{1.3.7}
|
45
44
|
s.summary = %q{Mongoid plugin to deal with localizable fields}
|
46
45
|
s.test_files = [
|
47
46
|
"spec/integration/mongoid/i18n_spec.rb",
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
"spec/spec_helper.rb",
|
48
|
+
"spec/unit/mongoid/i18n/localized_criteria_spec.rb",
|
49
|
+
"spec/unit/mongoid/i18n_spec.rb"
|
51
50
|
]
|
52
51
|
|
53
52
|
if s.respond_to? :specification_version then
|
54
53
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
55
54
|
s.specification_version = 3
|
56
55
|
|
57
|
-
if Gem::Version.new(Gem::
|
56
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
57
|
+
s.add_runtime_dependency(%q<bson_ext>, [">= 0"])
|
58
58
|
s.add_runtime_dependency(%q<mongoid>, [">= 2.0.0.beta.9"])
|
59
|
-
s.
|
59
|
+
s.add_runtime_dependency(%q<rspec>, [">= 2.0.0.beta.8"])
|
60
|
+
s.add_runtime_dependency(%q<mocha>, [">= 0"])
|
61
|
+
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
62
|
+
s.add_runtime_dependency(%q<bundler>, [">= 0"])
|
63
|
+
s.add_runtime_dependency(%q<mongoid>, [">= 2.0.0.beta.20"])
|
64
|
+
s.add_development_dependency(%q<rspec>, ["= 2.1.0"])
|
60
65
|
else
|
66
|
+
s.add_dependency(%q<bson_ext>, [">= 0"])
|
61
67
|
s.add_dependency(%q<mongoid>, [">= 2.0.0.beta.9"])
|
62
68
|
s.add_dependency(%q<rspec>, [">= 2.0.0.beta.8"])
|
69
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
70
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
71
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
72
|
+
s.add_dependency(%q<mongoid>, [">= 2.0.0.beta.20"])
|
73
|
+
s.add_dependency(%q<rspec>, ["= 2.1.0"])
|
63
74
|
end
|
64
75
|
else
|
76
|
+
s.add_dependency(%q<bson_ext>, [">= 0"])
|
65
77
|
s.add_dependency(%q<mongoid>, [">= 2.0.0.beta.9"])
|
66
78
|
s.add_dependency(%q<rspec>, [">= 2.0.0.beta.8"])
|
79
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
80
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
81
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
82
|
+
s.add_dependency(%q<mongoid>, [">= 2.0.0.beta.20"])
|
83
|
+
s.add_dependency(%q<rspec>, ["= 2.1.0"])
|
67
84
|
end
|
68
85
|
end
|
69
86
|
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 11
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- "Rodrigo \xC3\x81lvarez"
|
@@ -14,16 +15,33 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-11-19 00:00:00 +01:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
+
type: :runtime
|
22
23
|
prerelease: false
|
23
|
-
|
24
|
+
name: bson_ext
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
28
|
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
version: "0"
|
34
|
+
requirement: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
name: mongoid
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 62196465
|
27
45
|
segments:
|
28
46
|
- 2
|
29
47
|
- 0
|
@@ -31,15 +49,17 @@ dependencies:
|
|
31
49
|
- beta
|
32
50
|
- 9
|
33
51
|
version: 2.0.0.beta.9
|
34
|
-
|
35
|
-
version_requirements: *id001
|
52
|
+
requirement: *id002
|
36
53
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
54
|
+
type: :runtime
|
38
55
|
prerelease: false
|
39
|
-
|
56
|
+
name: rspec
|
57
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
40
59
|
requirements:
|
41
60
|
- - ">="
|
42
61
|
- !ruby/object:Gem::Version
|
62
|
+
hash: 62196467
|
43
63
|
segments:
|
44
64
|
- 2
|
45
65
|
- 0
|
@@ -47,8 +67,83 @@ dependencies:
|
|
47
67
|
- beta
|
48
68
|
- 8
|
49
69
|
version: 2.0.0.beta.8
|
70
|
+
requirement: *id003
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
type: :runtime
|
73
|
+
prerelease: false
|
74
|
+
name: mocha
|
75
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
hash: 3
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
requirement: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
name: jeweler
|
89
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
hash: 3
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
version: "0"
|
98
|
+
requirement: *id005
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
type: :runtime
|
101
|
+
prerelease: false
|
102
|
+
name: bundler
|
103
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
112
|
+
requirement: *id006
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
type: :runtime
|
115
|
+
prerelease: false
|
116
|
+
name: mongoid
|
117
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
hash: 62196427
|
123
|
+
segments:
|
124
|
+
- 2
|
125
|
+
- 0
|
126
|
+
- 0
|
127
|
+
- beta
|
128
|
+
- 20
|
129
|
+
version: 2.0.0.beta.20
|
130
|
+
requirement: *id007
|
131
|
+
- !ruby/object:Gem::Dependency
|
50
132
|
type: :development
|
51
|
-
|
133
|
+
prerelease: false
|
134
|
+
name: rspec
|
135
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
137
|
+
requirements:
|
138
|
+
- - "="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
hash: 11
|
141
|
+
segments:
|
142
|
+
- 2
|
143
|
+
- 1
|
144
|
+
- 0
|
145
|
+
version: 2.1.0
|
146
|
+
requirement: *id008
|
52
147
|
description: "This gem aims to be a transparent way to deal with localizable fields.\n Basically use localized_field() instead of field() and that's it.\n It will take care of locales for you when using find or criteria.\n "
|
53
148
|
email: papipo@gmail.com
|
54
149
|
executables: []
|
@@ -60,7 +155,7 @@ extra_rdoc_files:
|
|
60
155
|
- README.rdoc
|
61
156
|
files:
|
62
157
|
- .document
|
63
|
-
- .
|
158
|
+
- .rvmrc
|
64
159
|
- Gemfile
|
65
160
|
- Gemfile.lock
|
66
161
|
- LICENSE
|
@@ -81,28 +176,32 @@ homepage: http://github.com/Papipo/mongoid_i18n
|
|
81
176
|
licenses: []
|
82
177
|
|
83
178
|
post_install_message:
|
84
|
-
rdoc_options:
|
85
|
-
|
179
|
+
rdoc_options: []
|
180
|
+
|
86
181
|
require_paths:
|
87
182
|
- lib
|
88
183
|
required_ruby_version: !ruby/object:Gem::Requirement
|
184
|
+
none: false
|
89
185
|
requirements:
|
90
186
|
- - ">="
|
91
187
|
- !ruby/object:Gem::Version
|
188
|
+
hash: 3
|
92
189
|
segments:
|
93
190
|
- 0
|
94
191
|
version: "0"
|
95
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
96
194
|
requirements:
|
97
195
|
- - ">="
|
98
196
|
- !ruby/object:Gem::Version
|
197
|
+
hash: 3
|
99
198
|
segments:
|
100
199
|
- 0
|
101
200
|
version: "0"
|
102
201
|
requirements: []
|
103
202
|
|
104
203
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.3.
|
204
|
+
rubygems_version: 1.3.7
|
106
205
|
signing_key:
|
107
206
|
specification_version: 3
|
108
207
|
summary: Mongoid plugin to deal with localizable fields
|