mongo_mapper-unstable 2010.3.8 → 2010.06.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. data/README.rdoc +4 -8
  2. data/bin/mmconsole +1 -1
  3. data/examples/keys.rb +37 -0
  4. data/examples/plugins.rb +41 -0
  5. data/examples/querying.rb +35 -0
  6. data/examples/scopes.rb +52 -0
  7. data/lib/mongo_mapper/connection.rb +83 -0
  8. data/lib/mongo_mapper/document.rb +11 -329
  9. data/lib/mongo_mapper/embedded_document.rb +9 -38
  10. data/lib/mongo_mapper/exceptions.rb +30 -0
  11. data/lib/mongo_mapper/extensions/array.rb +19 -0
  12. data/lib/mongo_mapper/extensions/binary.rb +22 -0
  13. data/lib/mongo_mapper/extensions/boolean.rb +44 -0
  14. data/lib/mongo_mapper/extensions/date.rb +25 -0
  15. data/lib/mongo_mapper/extensions/float.rb +14 -0
  16. data/lib/mongo_mapper/extensions/hash.rb +14 -0
  17. data/lib/mongo_mapper/extensions/integer.rb +19 -0
  18. data/lib/mongo_mapper/extensions/kernel.rb +9 -0
  19. data/lib/mongo_mapper/extensions/nil_class.rb +18 -0
  20. data/lib/mongo_mapper/extensions/object.rb +27 -0
  21. data/lib/mongo_mapper/extensions/object_id.rb +30 -0
  22. data/lib/mongo_mapper/extensions/set.rb +20 -0
  23. data/lib/mongo_mapper/extensions/string.rb +18 -0
  24. data/lib/mongo_mapper/extensions/time.rb +29 -0
  25. data/lib/mongo_mapper/plugins/accessible.rb +44 -0
  26. data/lib/mongo_mapper/plugins/associations/base.rb +7 -6
  27. data/lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb +5 -6
  28. data/lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb +5 -6
  29. data/lib/mongo_mapper/plugins/associations/collection.rb +1 -0
  30. data/lib/mongo_mapper/plugins/associations/embedded_collection.rb +2 -1
  31. data/lib/mongo_mapper/plugins/associations/in_array_proxy.rb +25 -39
  32. data/lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb +4 -4
  33. data/lib/mongo_mapper/plugins/associations/many_documents_proxy.rb +36 -46
  34. data/lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb +1 -0
  35. data/lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb +5 -4
  36. data/lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb +1 -0
  37. data/lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb +40 -0
  38. data/lib/mongo_mapper/plugins/associations/one_proxy.rb +7 -7
  39. data/lib/mongo_mapper/plugins/associations/proxy.rb +16 -8
  40. data/lib/mongo_mapper/plugins/associations.rb +14 -22
  41. data/lib/mongo_mapper/plugins/caching.rb +21 -0
  42. data/lib/mongo_mapper/plugins/callbacks.rb +17 -5
  43. data/lib/mongo_mapper/plugins/clone.rb +10 -4
  44. data/lib/mongo_mapper/plugins/descendants.rb +3 -2
  45. data/lib/mongo_mapper/plugins/dirty.rb +1 -0
  46. data/lib/mongo_mapper/plugins/document.rb +41 -0
  47. data/lib/mongo_mapper/{support/find.rb → plugins/dynamic_querying/dynamic_finder.rb} +3 -36
  48. data/lib/mongo_mapper/plugins/dynamic_querying.rb +43 -0
  49. data/lib/mongo_mapper/plugins/embedded_document.rb +49 -0
  50. data/lib/mongo_mapper/plugins/equality.rb +4 -10
  51. data/lib/mongo_mapper/plugins/identity_map.rb +29 -23
  52. data/lib/mongo_mapper/plugins/indexes.rb +12 -0
  53. data/lib/mongo_mapper/plugins/inspect.rb +1 -0
  54. data/lib/mongo_mapper/plugins/keys/key.rb +55 -0
  55. data/lib/mongo_mapper/plugins/keys.rb +85 -110
  56. data/lib/mongo_mapper/plugins/logger.rb +1 -0
  57. data/lib/mongo_mapper/plugins/modifiers.rb +41 -16
  58. data/lib/mongo_mapper/plugins/pagination.rb +5 -15
  59. data/lib/mongo_mapper/plugins/persistence.rb +69 -0
  60. data/lib/mongo_mapper/plugins/protected.rb +9 -1
  61. data/lib/mongo_mapper/plugins/querying/decorator.rb +46 -0
  62. data/lib/mongo_mapper/plugins/querying/plucky_methods.rb +15 -0
  63. data/lib/mongo_mapper/plugins/querying.rb +176 -0
  64. data/lib/mongo_mapper/plugins/rails.rb +6 -1
  65. data/lib/mongo_mapper/plugins/safe.rb +28 -0
  66. data/lib/mongo_mapper/plugins/sci.rb +32 -0
  67. data/lib/mongo_mapper/plugins/scopes.rb +21 -0
  68. data/lib/mongo_mapper/plugins/serialization.rb +5 -4
  69. data/lib/mongo_mapper/plugins/timestamps.rb +2 -1
  70. data/lib/mongo_mapper/plugins/userstamps.rb +1 -0
  71. data/lib/mongo_mapper/plugins/validations.rb +9 -5
  72. data/lib/mongo_mapper/plugins.rb +1 -20
  73. data/lib/mongo_mapper/support/descendant_appends.rb +5 -6
  74. data/lib/mongo_mapper/version.rb +4 -0
  75. data/lib/mongo_mapper.rb +71 -128
  76. data/test/{NOTE_ON_TESTING → _NOTE_ON_TESTING} +0 -0
  77. data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +5 -5
  78. data/test/functional/associations/test_belongs_to_proxy.rb +13 -21
  79. data/test/functional/associations/test_in_array_proxy.rb +7 -9
  80. data/test/functional/associations/test_many_documents_as_proxy.rb +5 -5
  81. data/test/functional/associations/test_many_documents_proxy.rb +186 -64
  82. data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +22 -22
  83. data/test/functional/associations/test_many_embedded_proxy.rb +32 -32
  84. data/test/functional/associations/test_many_polymorphic_proxy.rb +47 -47
  85. data/test/functional/associations/test_one_embedded_proxy.rb +67 -0
  86. data/test/functional/associations/test_one_proxy.rb +70 -49
  87. data/test/functional/test_accessible.rb +168 -0
  88. data/test/functional/test_associations.rb +11 -11
  89. data/test/functional/test_binary.rb +5 -5
  90. data/test/functional/test_caching.rb +76 -0
  91. data/test/functional/test_callbacks.rb +104 -34
  92. data/test/functional/test_dirty.rb +16 -16
  93. data/test/functional/test_document.rb +12 -924
  94. data/test/functional/test_dynamic_querying.rb +75 -0
  95. data/test/functional/test_embedded_document.rb +88 -8
  96. data/test/functional/test_identity_map.rb +41 -43
  97. data/test/functional/{test_indexing.rb → test_indexes.rb} +3 -5
  98. data/test/functional/test_logger.rb +1 -1
  99. data/test/functional/test_modifiers.rb +275 -181
  100. data/test/functional/test_pagination.rb +13 -15
  101. data/test/functional/test_protected.rb +25 -11
  102. data/test/functional/test_querying.rb +873 -0
  103. data/test/functional/test_safe.rb +76 -0
  104. data/test/functional/test_sci.rb +230 -0
  105. data/test/functional/test_scopes.rb +171 -0
  106. data/test/functional/test_string_id_compatibility.rb +11 -11
  107. data/test/functional/test_timestamps.rb +0 -2
  108. data/test/functional/test_userstamps.rb +0 -1
  109. data/test/functional/test_validations.rb +44 -31
  110. data/test/models.rb +18 -17
  111. data/test/{active_model_lint_test.rb → test_active_model_lint.rb} +3 -1
  112. data/test/test_helper.rb +59 -16
  113. data/test/unit/associations/test_base.rb +47 -42
  114. data/test/unit/associations/test_proxy.rb +15 -15
  115. data/test/unit/serializers/test_json_serializer.rb +29 -29
  116. data/test/unit/test_clone.rb +69 -0
  117. data/test/unit/test_descendant_appends.rb +3 -3
  118. data/test/unit/test_document.rb +49 -67
  119. data/test/unit/test_dynamic_finder.rb +53 -51
  120. data/test/unit/test_embedded_document.rb +19 -38
  121. data/test/unit/{test_support.rb → test_extensions.rb} +136 -122
  122. data/test/unit/test_key.rb +185 -0
  123. data/test/unit/test_keys.rb +29 -147
  124. data/test/unit/test_mongo_mapper.rb +3 -48
  125. data/test/unit/test_pagination.rb +1 -150
  126. data/test/unit/test_rails.rb +77 -19
  127. data/test/unit/test_rails_compatibility.rb +12 -12
  128. data/test/unit/test_serialization.rb +5 -5
  129. data/test/unit/test_time_zones.rb +9 -9
  130. data/test/unit/test_validations.rb +46 -46
  131. metadata +157 -155
  132. data/.gitignore +0 -10
  133. data/Rakefile +0 -55
  134. data/VERSION +0 -1
  135. data/lib/mongo_mapper/plugins/pagination/proxy.rb +0 -72
  136. data/lib/mongo_mapper/query.rb +0 -130
  137. data/lib/mongo_mapper/support.rb +0 -215
  138. data/mongo_mapper.gemspec +0 -196
  139. data/performance/read_write.rb +0 -52
  140. data/specs.watchr +0 -51
  141. data/test/support/custom_matchers.rb +0 -55
  142. data/test/support/timing.rb +0 -16
  143. data/test/unit/test_query.rb +0 -340
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 2010
7
- - 3
8
- - 8
9
- version: 2010.3.8
7
+ - 6
8
+ - 23
9
+ version: 2010.06.23
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Nunemaker
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-08 00:00:00 -05:00
17
+ date: 2010-06-23 00:00:00 -05:00
18
18
  default_executable: mmconsole
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -27,43 +27,58 @@ dependencies:
27
27
  segments:
28
28
  - 2
29
29
  - 3
30
- version: "2.3"
30
+ - 4
31
+ version: 2.3.4
31
32
  type: :runtime
32
33
  version_requirements: *id001
33
34
  - !ruby/object:Gem::Dependency
34
- name: mongo
35
+ name: jnunemaker-validatable
35
36
  prerelease: false
36
37
  requirement: &id002 !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - "="
39
+ - - ~>
39
40
  - !ruby/object:Gem::Version
40
41
  segments:
41
- - 0
42
- - 19
43
42
  - 1
44
- version: 0.19.1
43
+ - 8
44
+ - 4
45
+ version: 1.8.4
45
46
  type: :runtime
46
47
  version_requirements: *id002
47
48
  - !ruby/object:Gem::Dependency
48
- name: jnunemaker-validatable
49
+ name: plucky
49
50
  prerelease: false
50
51
  requirement: &id003 !ruby/object:Gem::Requirement
51
52
  requirements:
52
- - - "="
53
+ - - ~>
53
54
  - !ruby/object:Gem::Version
54
55
  segments:
55
- - 1
56
- - 8
56
+ - 0
57
57
  - 3
58
- version: 1.8.3
58
+ - 1
59
+ version: 0.3.1
59
60
  type: :runtime
60
61
  version_requirements: *id003
61
62
  - !ruby/object:Gem::Dependency
62
- name: jnunemaker-matchy
63
+ name: json
63
64
  prerelease: false
64
65
  requirement: &id004 !ruby/object:Gem::Requirement
65
66
  requirements:
66
- - - "="
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 1
71
+ - 2
72
+ - 3
73
+ version: 1.2.3
74
+ type: :development
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: jnunemaker-matchy
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
67
82
  - !ruby/object:Gem::Version
68
83
  segments:
69
84
  - 0
@@ -71,13 +86,13 @@ dependencies:
71
86
  - 0
72
87
  version: 0.4.0
73
88
  type: :development
74
- version_requirements: *id004
89
+ version_requirements: *id005
75
90
  - !ruby/object:Gem::Dependency
76
91
  name: shoulda
77
92
  prerelease: false
78
- requirement: &id005 !ruby/object:Gem::Requirement
93
+ requirement: &id006 !ruby/object:Gem::Requirement
79
94
  requirements:
80
- - - "="
95
+ - - ~>
81
96
  - !ruby/object:Gem::Version
82
97
  segments:
83
98
  - 2
@@ -85,13 +100,13 @@ dependencies:
85
100
  - 2
86
101
  version: 2.10.2
87
102
  type: :development
88
- version_requirements: *id005
103
+ version_requirements: *id006
89
104
  - !ruby/object:Gem::Dependency
90
105
  name: timecop
91
106
  prerelease: false
92
- requirement: &id006 !ruby/object:Gem::Requirement
107
+ requirement: &id007 !ruby/object:Gem::Requirement
93
108
  requirements:
94
- - - "="
109
+ - - ~>
95
110
  - !ruby/object:Gem::Version
96
111
  segments:
97
112
  - 0
@@ -99,13 +114,13 @@ dependencies:
99
114
  - 1
100
115
  version: 0.3.1
101
116
  type: :development
102
- version_requirements: *id006
117
+ version_requirements: *id007
103
118
  - !ruby/object:Gem::Dependency
104
119
  name: mocha
105
120
  prerelease: false
106
- requirement: &id007 !ruby/object:Gem::Requirement
121
+ requirement: &id008 !ruby/object:Gem::Requirement
107
122
  requirements:
108
- - - "="
123
+ - - ~>
109
124
  - !ruby/object:Gem::Version
110
125
  segments:
111
126
  - 0
@@ -113,177 +128,126 @@ dependencies:
113
128
  - 8
114
129
  version: 0.9.8
115
130
  type: :development
116
- version_requirements: *id007
131
+ version_requirements: *id008
117
132
  description:
118
- email: nunemaker@gmail.com
133
+ email:
134
+ - nunemaker@gmail.com
119
135
  executables:
120
136
  - mmconsole
121
137
  extensions: []
122
138
 
123
- extra_rdoc_files:
124
- - LICENSE
125
- - README.rdoc
139
+ extra_rdoc_files: []
140
+
126
141
  files:
127
- - .gitignore
128
- - LICENSE
129
- - README.rdoc
130
- - Rakefile
131
- - VERSION
132
142
  - bin/mmconsole
133
- - lib/mongo_mapper.rb
134
- - lib/mongo_mapper/document.rb
135
- - lib/mongo_mapper/embedded_document.rb
136
- - lib/mongo_mapper/plugins.rb
143
+ - examples/keys.rb
144
+ - examples/scopes.rb
145
+ - examples/querying.rb
146
+ - examples/plugins.rb
147
+ - lib/mongo_mapper/connection.rb
148
+ - lib/mongo_mapper/plugins/serialization.rb
149
+ - lib/mongo_mapper/plugins/keys.rb
150
+ - lib/mongo_mapper/plugins/dirty.rb
151
+ - lib/mongo_mapper/plugins/logger.rb
152
+ - lib/mongo_mapper/plugins/caching.rb
153
+ - lib/mongo_mapper/plugins/pagination.rb
154
+ - lib/mongo_mapper/plugins/validations.rb
155
+ - lib/mongo_mapper/plugins/document.rb
156
+ - lib/mongo_mapper/plugins/accessible.rb
137
157
  - lib/mongo_mapper/plugins/associations.rb
138
- - lib/mongo_mapper/plugins/associations/base.rb
139
- - lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb
140
- - lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb
158
+ - lib/mongo_mapper/plugins/safe.rb
159
+ - lib/mongo_mapper/plugins/scopes.rb
160
+ - lib/mongo_mapper/plugins/clone.rb
161
+ - lib/mongo_mapper/plugins/indexes.rb
162
+ - lib/mongo_mapper/plugins/rails.rb
163
+ - lib/mongo_mapper/plugins/callbacks.rb
141
164
  - lib/mongo_mapper/plugins/associations/collection.rb
142
- - lib/mongo_mapper/plugins/associations/embedded_collection.rb
143
- - lib/mongo_mapper/plugins/associations/in_array_proxy.rb
144
- - lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb
145
- - lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
146
- - lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb
165
+ - lib/mongo_mapper/plugins/associations/one_proxy.rb
166
+ - lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb
147
167
  - lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
148
168
  - lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb
149
- - lib/mongo_mapper/plugins/associations/one_proxy.rb
169
+ - lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb
170
+ - lib/mongo_mapper/plugins/associations/base.rb
171
+ - lib/mongo_mapper/plugins/associations/in_array_proxy.rb
172
+ - lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
150
173
  - lib/mongo_mapper/plugins/associations/proxy.rb
151
- - lib/mongo_mapper/plugins/callbacks.rb
152
- - lib/mongo_mapper/plugins/clone.rb
153
- - lib/mongo_mapper/plugins/descendants.rb
154
- - lib/mongo_mapper/plugins/dirty.rb
174
+ - lib/mongo_mapper/plugins/associations/embedded_collection.rb
175
+ - lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb
176
+ - lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb
177
+ - lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb
178
+ - lib/mongo_mapper/plugins/querying/plucky_methods.rb
179
+ - lib/mongo_mapper/plugins/querying/decorator.rb
180
+ - lib/mongo_mapper/plugins/userstamps.rb
155
181
  - lib/mongo_mapper/plugins/equality.rb
182
+ - lib/mongo_mapper/plugins/modifiers.rb
156
183
  - lib/mongo_mapper/plugins/identity_map.rb
184
+ - lib/mongo_mapper/plugins/querying.rb
185
+ - lib/mongo_mapper/plugins/persistence.rb
186
+ - lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb
157
187
  - lib/mongo_mapper/plugins/inspect.rb
158
- - lib/mongo_mapper/plugins/keys.rb
159
- - lib/mongo_mapper/plugins/logger.rb
160
- - lib/mongo_mapper/plugins/modifiers.rb
161
- - lib/mongo_mapper/plugins/pagination.rb
162
- - lib/mongo_mapper/plugins/pagination/proxy.rb
163
- - lib/mongo_mapper/plugins/protected.rb
164
- - lib/mongo_mapper/plugins/rails.rb
165
- - lib/mongo_mapper/plugins/serialization.rb
188
+ - lib/mongo_mapper/plugins/descendants.rb
189
+ - lib/mongo_mapper/plugins/sci.rb
190
+ - lib/mongo_mapper/plugins/dynamic_querying.rb
166
191
  - lib/mongo_mapper/plugins/timestamps.rb
167
- - lib/mongo_mapper/plugins/userstamps.rb
168
- - lib/mongo_mapper/plugins/validations.rb
169
- - lib/mongo_mapper/query.rb
170
- - lib/mongo_mapper/support.rb
192
+ - lib/mongo_mapper/plugins/embedded_document.rb
193
+ - lib/mongo_mapper/plugins/protected.rb
194
+ - lib/mongo_mapper/plugins/keys/key.rb
195
+ - lib/mongo_mapper/exceptions.rb
196
+ - lib/mongo_mapper/document.rb
171
197
  - lib/mongo_mapper/support/descendant_appends.rb
172
- - lib/mongo_mapper/support/find.rb
173
- - mongo_mapper.gemspec
174
- - performance/read_write.rb
175
- - specs.watchr
176
- - test/NOTE_ON_TESTING
177
- - test/active_model_lint_test.rb
178
- - test/functional/associations/test_belongs_to_polymorphic_proxy.rb
179
- - test/functional/associations/test_belongs_to_proxy.rb
180
- - test/functional/associations/test_in_array_proxy.rb
181
- - test/functional/associations/test_many_documents_as_proxy.rb
182
- - test/functional/associations/test_many_documents_proxy.rb
183
- - test/functional/associations/test_many_embedded_polymorphic_proxy.rb
184
- - test/functional/associations/test_many_embedded_proxy.rb
185
- - test/functional/associations/test_many_polymorphic_proxy.rb
186
- - test/functional/associations/test_one_proxy.rb
187
- - test/functional/test_associations.rb
188
- - test/functional/test_binary.rb
189
- - test/functional/test_callbacks.rb
190
- - test/functional/test_dirty.rb
191
- - test/functional/test_document.rb
192
- - test/functional/test_embedded_document.rb
193
- - test/functional/test_identity_map.rb
194
- - test/functional/test_indexing.rb
195
- - test/functional/test_logger.rb
196
- - test/functional/test_modifiers.rb
197
- - test/functional/test_pagination.rb
198
- - test/functional/test_protected.rb
199
- - test/functional/test_string_id_compatibility.rb
200
- - test/functional/test_timestamps.rb
201
- - test/functional/test_userstamps.rb
202
- - test/functional/test_validations.rb
203
- - test/models.rb
204
- - test/support/custom_matchers.rb
205
- - test/support/timing.rb
206
- - test/test_helper.rb
207
- - test/unit/associations/test_base.rb
208
- - test/unit/associations/test_proxy.rb
209
- - test/unit/serializers/test_json_serializer.rb
210
- - test/unit/test_descendant_appends.rb
211
- - test/unit/test_document.rb
212
- - test/unit/test_dynamic_finder.rb
213
- - test/unit/test_embedded_document.rb
214
- - test/unit/test_keys.rb
215
- - test/unit/test_mongo_mapper.rb
216
- - test/unit/test_pagination.rb
217
- - test/unit/test_plugins.rb
218
- - test/unit/test_query.rb
219
- - test/unit/test_rails.rb
220
- - test/unit/test_rails_compatibility.rb
221
- - test/unit/test_serialization.rb
222
- - test/unit/test_support.rb
223
- - test/unit/test_time_zones.rb
224
- - test/unit/test_validations.rb
225
- has_rdoc: true
226
- homepage: http://github.com/jnunemaker/mongomapper
227
- licenses: []
228
-
229
- post_install_message:
230
- rdoc_options:
231
- - --charset=UTF-8
232
- require_paths:
233
- - lib
234
- required_ruby_version: !ruby/object:Gem::Requirement
235
- requirements:
236
- - - ">="
237
- - !ruby/object:Gem::Version
238
- segments:
239
- - 0
240
- version: "0"
241
- required_rubygems_version: !ruby/object:Gem::Requirement
242
- requirements:
243
- - - ">="
244
- - !ruby/object:Gem::Version
245
- segments:
246
- - 0
247
- version: "0"
248
- requirements: []
249
-
250
- rubyforge_project:
251
- rubygems_version: 1.3.6
252
- signing_key:
253
- specification_version: 3
254
- summary: A Ruby Object Mapper for Mongo
255
- test_files:
198
+ - lib/mongo_mapper/extensions/object.rb
199
+ - lib/mongo_mapper/extensions/kernel.rb
200
+ - lib/mongo_mapper/extensions/array.rb
201
+ - lib/mongo_mapper/extensions/string.rb
202
+ - lib/mongo_mapper/extensions/float.rb
203
+ - lib/mongo_mapper/extensions/boolean.rb
204
+ - lib/mongo_mapper/extensions/hash.rb
205
+ - lib/mongo_mapper/extensions/integer.rb
206
+ - lib/mongo_mapper/extensions/nil_class.rb
207
+ - lib/mongo_mapper/extensions/time.rb
208
+ - lib/mongo_mapper/extensions/object_id.rb
209
+ - lib/mongo_mapper/extensions/date.rb
210
+ - lib/mongo_mapper/extensions/binary.rb
211
+ - lib/mongo_mapper/extensions/set.rb
212
+ - lib/mongo_mapper/embedded_document.rb
213
+ - lib/mongo_mapper/version.rb
214
+ - lib/mongo_mapper/plugins.rb
215
+ - lib/mongo_mapper.rb
216
+ - test/_NOTE_ON_TESTING
256
217
  - test/unit/test_embedded_document.rb
218
+ - test/unit/test_key.rb
257
219
  - test/unit/test_dynamic_finder.rb
258
220
  - test/unit/serializers/test_json_serializer.rb
259
- - test/unit/test_support.rb
260
221
  - test/unit/test_keys.rb
261
222
  - test/unit/associations/test_proxy.rb
262
223
  - test/unit/associations/test_base.rb
263
224
  - test/unit/test_time_zones.rb
264
225
  - test/unit/test_serialization.rb
226
+ - test/unit/test_extensions.rb
265
227
  - test/unit/test_rails.rb
266
- - test/unit/test_query.rb
267
228
  - test/unit/test_rails_compatibility.rb
268
229
  - test/unit/test_validations.rb
269
230
  - test/unit/test_mongo_mapper.rb
270
231
  - test/unit/test_descendant_appends.rb
232
+ - test/unit/test_clone.rb
271
233
  - test/unit/test_plugins.rb
272
234
  - test/unit/test_document.rb
273
235
  - test/unit/test_pagination.rb
274
236
  - test/test_helper.rb
275
- - test/support/custom_matchers.rb
276
- - test/support/timing.rb
277
237
  - test/functional/test_timestamps.rb
238
+ - test/functional/test_accessible.rb
239
+ - test/functional/test_safe.rb
278
240
  - test/functional/test_modifiers.rb
241
+ - test/functional/test_querying.rb
279
242
  - test/functional/test_embedded_document.rb
280
243
  - test/functional/test_protected.rb
281
244
  - test/functional/test_string_id_compatibility.rb
282
- - test/functional/test_indexing.rb
283
245
  - test/functional/test_associations.rb
246
+ - test/functional/test_dynamic_querying.rb
284
247
  - test/functional/associations/test_belongs_to_proxy.rb
285
248
  - test/functional/associations/test_in_array_proxy.rb
286
249
  - test/functional/associations/test_many_documents_proxy.rb
250
+ - test/functional/associations/test_one_embedded_proxy.rb
287
251
  - test/functional/associations/test_many_embedded_proxy.rb
288
252
  - test/functional/associations/test_many_documents_as_proxy.rb
289
253
  - test/functional/associations/test_many_embedded_polymorphic_proxy.rb
@@ -291,13 +255,51 @@ test_files:
291
255
  - test/functional/associations/test_belongs_to_polymorphic_proxy.rb
292
256
  - test/functional/associations/test_one_proxy.rb
293
257
  - test/functional/test_identity_map.rb
258
+ - test/functional/test_scopes.rb
259
+ - test/functional/test_indexes.rb
294
260
  - test/functional/test_binary.rb
295
261
  - test/functional/test_dirty.rb
296
262
  - test/functional/test_callbacks.rb
297
263
  - test/functional/test_userstamps.rb
298
264
  - test/functional/test_validations.rb
265
+ - test/functional/test_sci.rb
299
266
  - test/functional/test_logger.rb
300
267
  - test/functional/test_document.rb
301
268
  - test/functional/test_pagination.rb
269
+ - test/functional/test_caching.rb
302
270
  - test/models.rb
303
- - test/active_model_lint_test.rb
271
+ - test/test_active_model_lint.rb
272
+ - LICENSE
273
+ - README.rdoc
274
+ has_rdoc: true
275
+ homepage: http://github.com/jnunemaker/mongomapper
276
+ licenses: []
277
+
278
+ post_install_message:
279
+ rdoc_options: []
280
+
281
+ require_paths:
282
+ - lib
283
+ required_ruby_version: !ruby/object:Gem::Requirement
284
+ requirements:
285
+ - - ">="
286
+ - !ruby/object:Gem::Version
287
+ segments:
288
+ - 0
289
+ version: "0"
290
+ required_rubygems_version: !ruby/object:Gem::Requirement
291
+ requirements:
292
+ - - ">="
293
+ - !ruby/object:Gem::Version
294
+ segments:
295
+ - 0
296
+ version: "0"
297
+ requirements: []
298
+
299
+ rubyforge_project:
300
+ rubygems_version: 1.3.6
301
+ signing_key:
302
+ specification_version: 3
303
+ summary: A Ruby Object Mapper for Mongo
304
+ test_files: []
305
+
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg
6
- *~
7
- *.gem
8
- tmp
9
- .yardoc
10
- doc/*
data/Rakefile DELETED
@@ -1,55 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'jeweler'
4
- require 'yard'
5
- require 'yard/rake/yardoc_task'
6
-
7
- Jeweler::Tasks.new do |gem|
8
- gem.name = "mongo_mapper"
9
- gem.summary = %Q{A Ruby Object Mapper for Mongo}
10
- gem.email = "nunemaker@gmail.com"
11
- gem.homepage = "http://github.com/jnunemaker/mongomapper"
12
- gem.authors = ["John Nunemaker"]
13
-
14
- gem.add_dependency('activesupport', '>= 2.3')
15
- gem.add_dependency('mongo', '0.19.1')
16
- gem.add_dependency('jnunemaker-validatable', '1.8.3')
17
-
18
- gem.add_development_dependency('jnunemaker-matchy', '0.4.0')
19
- gem.add_development_dependency('shoulda', '2.10.2')
20
- gem.add_development_dependency('timecop', '0.3.1')
21
- gem.add_development_dependency('mocha', '0.9.8')
22
- end
23
-
24
- Jeweler::GemcutterTasks.new
25
-
26
- require 'rake/testtask'
27
- Rake::TestTask.new(:test) do |test|
28
- test.libs << 'test'
29
- test.ruby_opts << '-rubygems'
30
- test.pattern = 'test/**/test_*.rb'
31
- test.verbose = true
32
- end
33
-
34
- namespace :test do
35
- Rake::TestTask.new(:units) do |test|
36
- test.libs << 'test'
37
- test.ruby_opts << '-rubygems'
38
- test.pattern = 'test/unit/**/test_*.rb'
39
- test.verbose = true
40
- end
41
-
42
- Rake::TestTask.new(:functionals) do |test|
43
- test.libs << 'test'
44
- test.ruby_opts << '-rubygems'
45
- test.pattern = 'test/functional/**/test_*.rb'
46
- test.verbose = true
47
- end
48
- end
49
-
50
- task :default => :test
51
- task :test => :check_dependencies
52
-
53
- YARD::Rake::YardocTask.new(:doc) do |t|
54
- t.options = ["--legacy"] if RUBY_VERSION < "1.9.0"
55
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 2010.03.08
@@ -1,72 +0,0 @@
1
- module MongoMapper
2
- module Plugins
3
- module Pagination
4
- class Proxy
5
- instance_methods.each { |m| undef_method m unless m =~ /(^__|^nil\?$|^send$|respond_to\?|proxy_|^object_id$)/ }
6
-
7
- attr_accessor :subject
8
- attr_reader :total_entries, :per_page, :current_page
9
- alias limit per_page
10
-
11
- def initialize(total_entries, current_page, per_page=nil)
12
- @total_entries = total_entries.to_i
13
- self.per_page = per_page
14
- self.current_page = current_page
15
- end
16
-
17
- def total_pages
18
- (total_entries / per_page.to_f).ceil
19
- end
20
-
21
- def out_of_bounds?
22
- current_page > total_pages
23
- end
24
-
25
- def previous_page
26
- current_page > 1 ? (current_page - 1) : nil
27
- end
28
-
29
- def next_page
30
- current_page < total_pages ? (current_page + 1) : nil
31
- end
32
-
33
- def skip
34
- (current_page - 1) * per_page
35
- end
36
- alias offset skip # for will paginate support
37
-
38
- def send(method, *args, &block)
39
- if respond_to?(method)
40
- super
41
- else
42
- subject.send(method, *args, &block)
43
- end
44
- end
45
-
46
- def ===(other)
47
- other === subject
48
- end
49
-
50
- def method_missing(name, *args, &block)
51
- @subject.send(name, *args, &block)
52
- end
53
-
54
- def respond_to?(name, *args, &block)
55
- super || @subject.respond_to?(name, *args, &block)
56
- end
57
-
58
- private
59
- def per_page=(value)
60
- value = 25 if value.blank?
61
- @per_page = value.to_i
62
- end
63
-
64
- def current_page=(value)
65
- value = value.to_i
66
- value = 1 if value < 1
67
- @current_page = value
68
- end
69
- end
70
- end
71
- end
72
- end