jonbell-mongo_mapper 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +33 -0
  3. data/UPGRADES +7 -0
  4. data/bin/mmconsole +60 -0
  5. data/examples/attr_accessible.rb +22 -0
  6. data/examples/attr_protected.rb +22 -0
  7. data/examples/cache_key.rb +24 -0
  8. data/examples/custom_types.rb +24 -0
  9. data/examples/identity_map.rb +33 -0
  10. data/examples/identity_map/automatic.rb +8 -0
  11. data/examples/identity_map/middleware.rb +14 -0
  12. data/examples/keys.rb +40 -0
  13. data/examples/modifiers/set.rb +25 -0
  14. data/examples/plugins.rb +41 -0
  15. data/examples/querying.rb +35 -0
  16. data/examples/safe.rb +43 -0
  17. data/examples/scopes.rb +52 -0
  18. data/examples/validating/embedded_docs.rb +29 -0
  19. data/lib/mongo_mapper.rb +79 -0
  20. data/lib/mongo_mapper/connection.rb +83 -0
  21. data/lib/mongo_mapper/document.rb +41 -0
  22. data/lib/mongo_mapper/embedded_document.rb +31 -0
  23. data/lib/mongo_mapper/exceptions.rb +27 -0
  24. data/lib/mongo_mapper/extensions/array.rb +19 -0
  25. data/lib/mongo_mapper/extensions/binary.rb +22 -0
  26. data/lib/mongo_mapper/extensions/boolean.rb +44 -0
  27. data/lib/mongo_mapper/extensions/date.rb +25 -0
  28. data/lib/mongo_mapper/extensions/float.rb +14 -0
  29. data/lib/mongo_mapper/extensions/hash.rb +14 -0
  30. data/lib/mongo_mapper/extensions/integer.rb +19 -0
  31. data/lib/mongo_mapper/extensions/kernel.rb +9 -0
  32. data/lib/mongo_mapper/extensions/nil_class.rb +18 -0
  33. data/lib/mongo_mapper/extensions/object.rb +27 -0
  34. data/lib/mongo_mapper/extensions/object_id.rb +30 -0
  35. data/lib/mongo_mapper/extensions/set.rb +20 -0
  36. data/lib/mongo_mapper/extensions/string.rb +18 -0
  37. data/lib/mongo_mapper/extensions/time.rb +29 -0
  38. data/lib/mongo_mapper/plugins.rb +15 -0
  39. data/lib/mongo_mapper/plugins/accessible.rb +44 -0
  40. data/lib/mongo_mapper/plugins/associations.rb +97 -0
  41. data/lib/mongo_mapper/plugins/associations/base.rb +124 -0
  42. data/lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb +29 -0
  43. data/lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb +24 -0
  44. data/lib/mongo_mapper/plugins/associations/collection.rb +27 -0
  45. data/lib/mongo_mapper/plugins/associations/embedded_collection.rb +40 -0
  46. data/lib/mongo_mapper/plugins/associations/in_array_proxy.rb +127 -0
  47. data/lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb +28 -0
  48. data/lib/mongo_mapper/plugins/associations/many_documents_proxy.rb +109 -0
  49. data/lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb +32 -0
  50. data/lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb +24 -0
  51. data/lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb +14 -0
  52. data/lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb +40 -0
  53. data/lib/mongo_mapper/plugins/associations/one_proxy.rb +68 -0
  54. data/lib/mongo_mapper/plugins/associations/proxy.rb +139 -0
  55. data/lib/mongo_mapper/plugins/caching.rb +21 -0
  56. data/lib/mongo_mapper/plugins/callbacks.rb +241 -0
  57. data/lib/mongo_mapper/plugins/clone.rb +22 -0
  58. data/lib/mongo_mapper/plugins/descendants.rb +17 -0
  59. data/lib/mongo_mapper/plugins/dirty.rb +124 -0
  60. data/lib/mongo_mapper/plugins/document.rb +41 -0
  61. data/lib/mongo_mapper/plugins/dynamic_querying.rb +43 -0
  62. data/lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb +44 -0
  63. data/lib/mongo_mapper/plugins/embedded_document.rb +48 -0
  64. data/lib/mongo_mapper/plugins/equality.rb +17 -0
  65. data/lib/mongo_mapper/plugins/identity_map.rb +128 -0
  66. data/lib/mongo_mapper/plugins/indexes.rb +12 -0
  67. data/lib/mongo_mapper/plugins/inspect.rb +15 -0
  68. data/lib/mongo_mapper/plugins/keys.rb +313 -0
  69. data/lib/mongo_mapper/plugins/keys/key.rb +59 -0
  70. data/lib/mongo_mapper/plugins/logger.rb +18 -0
  71. data/lib/mongo_mapper/plugins/modifiers.rb +112 -0
  72. data/lib/mongo_mapper/plugins/pagination.rb +14 -0
  73. data/lib/mongo_mapper/plugins/persistence.rb +69 -0
  74. data/lib/mongo_mapper/plugins/protected.rb +53 -0
  75. data/lib/mongo_mapper/plugins/querying.rb +176 -0
  76. data/lib/mongo_mapper/plugins/querying/decorator.rb +46 -0
  77. data/lib/mongo_mapper/plugins/querying/plucky_methods.rb +15 -0
  78. data/lib/mongo_mapper/plugins/rails.rb +58 -0
  79. data/lib/mongo_mapper/plugins/safe.rb +28 -0
  80. data/lib/mongo_mapper/plugins/sci.rb +32 -0
  81. data/lib/mongo_mapper/plugins/scopes.rb +21 -0
  82. data/lib/mongo_mapper/plugins/serialization.rb +76 -0
  83. data/lib/mongo_mapper/plugins/timestamps.rb +22 -0
  84. data/lib/mongo_mapper/plugins/userstamps.rb +15 -0
  85. data/lib/mongo_mapper/plugins/validations.rb +50 -0
  86. data/lib/mongo_mapper/support/descendant_appends.rb +45 -0
  87. data/lib/mongo_mapper/version.rb +4 -0
  88. data/rails/init.rb +19 -0
  89. data/test/_NOTE_ON_TESTING +1 -0
  90. data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +63 -0
  91. data/test/functional/associations/test_belongs_to_proxy.rb +93 -0
  92. data/test/functional/associations/test_in_array_proxy.rb +319 -0
  93. data/test/functional/associations/test_many_documents_as_proxy.rb +229 -0
  94. data/test/functional/associations/test_many_documents_proxy.rb +615 -0
  95. data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +176 -0
  96. data/test/functional/associations/test_many_embedded_proxy.rb +256 -0
  97. data/test/functional/associations/test_many_polymorphic_proxy.rb +302 -0
  98. data/test/functional/associations/test_one_embedded_proxy.rb +81 -0
  99. data/test/functional/associations/test_one_proxy.rb +181 -0
  100. data/test/functional/test_accessible.rb +168 -0
  101. data/test/functional/test_associations.rb +44 -0
  102. data/test/functional/test_binary.rb +27 -0
  103. data/test/functional/test_caching.rb +76 -0
  104. data/test/functional/test_callbacks.rb +151 -0
  105. data/test/functional/test_dirty.rb +163 -0
  106. data/test/functional/test_document.rb +253 -0
  107. data/test/functional/test_dynamic_querying.rb +75 -0
  108. data/test/functional/test_embedded_document.rb +210 -0
  109. data/test/functional/test_identity_map.rb +514 -0
  110. data/test/functional/test_indexes.rb +42 -0
  111. data/test/functional/test_logger.rb +20 -0
  112. data/test/functional/test_modifiers.rb +416 -0
  113. data/test/functional/test_pagination.rb +91 -0
  114. data/test/functional/test_protected.rb +175 -0
  115. data/test/functional/test_querying.rb +873 -0
  116. data/test/functional/test_safe.rb +76 -0
  117. data/test/functional/test_sci.rb +230 -0
  118. data/test/functional/test_scopes.rb +171 -0
  119. data/test/functional/test_string_id_compatibility.rb +67 -0
  120. data/test/functional/test_timestamps.rb +62 -0
  121. data/test/functional/test_userstamps.rb +27 -0
  122. data/test/functional/test_validations.rb +342 -0
  123. data/test/models.rb +233 -0
  124. data/test/test_active_model_lint.rb +13 -0
  125. data/test/test_helper.rb +100 -0
  126. data/test/unit/associations/test_base.rb +212 -0
  127. data/test/unit/associations/test_proxy.rb +105 -0
  128. data/test/unit/serializers/test_json_serializer.rb +217 -0
  129. data/test/unit/test_clone.rb +69 -0
  130. data/test/unit/test_descendant_appends.rb +71 -0
  131. data/test/unit/test_document.rb +213 -0
  132. data/test/unit/test_dynamic_finder.rb +125 -0
  133. data/test/unit/test_embedded_document.rb +644 -0
  134. data/test/unit/test_extensions.rb +376 -0
  135. data/test/unit/test_key.rb +185 -0
  136. data/test/unit/test_keys.rb +89 -0
  137. data/test/unit/test_mongo_mapper.rb +110 -0
  138. data/test/unit/test_pagination.rb +11 -0
  139. data/test/unit/test_plugins.rb +50 -0
  140. data/test/unit/test_rails.rb +181 -0
  141. data/test/unit/test_rails_compatibility.rb +52 -0
  142. data/test/unit/test_serialization.rb +51 -0
  143. data/test/unit/test_time_zones.rb +39 -0
  144. data/test/unit/test_validations.rb +564 -0
  145. metadata +337 -0
metadata ADDED
@@ -0,0 +1,337 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jonbell-mongo_mapper
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 8
8
+ - 6
9
+ version: 0.8.6
10
+ platform: ruby
11
+ authors:
12
+ - John Nunemaker
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-06-29 00:00:00 -05:00
18
+ default_executable: mmconsole
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: activesupport
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 2
30
+ - 3
31
+ - 4
32
+ version: 2.3.4
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: jnunemaker-validatable
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 1
45
+ - 8
46
+ - 4
47
+ version: 1.8.4
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: jonbell-plucky
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
60
+ - 3
61
+ - 6
62
+ version: 0.3.6
63
+ type: :runtime
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: json
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ segments:
74
+ - 0
75
+ version: "0"
76
+ type: :development
77
+ version_requirements: *id004
78
+ - !ruby/object:Gem::Dependency
79
+ name: log_buddy
80
+ prerelease: false
81
+ requirement: &id005 !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
88
+ version: "0"
89
+ type: :development
90
+ version_requirements: *id005
91
+ - !ruby/object:Gem::Dependency
92
+ name: jnunemaker-matchy
93
+ prerelease: false
94
+ requirement: &id006 !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ~>
98
+ - !ruby/object:Gem::Version
99
+ segments:
100
+ - 0
101
+ - 4
102
+ - 0
103
+ version: 0.4.0
104
+ type: :development
105
+ version_requirements: *id006
106
+ - !ruby/object:Gem::Dependency
107
+ name: shoulda
108
+ prerelease: false
109
+ requirement: &id007 !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ~>
113
+ - !ruby/object:Gem::Version
114
+ segments:
115
+ - 2
116
+ - 11
117
+ version: "2.11"
118
+ type: :development
119
+ version_requirements: *id007
120
+ - !ruby/object:Gem::Dependency
121
+ name: timecop
122
+ prerelease: false
123
+ requirement: &id008 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ~>
127
+ - !ruby/object:Gem::Version
128
+ segments:
129
+ - 0
130
+ - 3
131
+ - 1
132
+ version: 0.3.1
133
+ type: :development
134
+ version_requirements: *id008
135
+ - !ruby/object:Gem::Dependency
136
+ name: mocha
137
+ prerelease: false
138
+ requirement: &id009 !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ~>
142
+ - !ruby/object:Gem::Version
143
+ segments:
144
+ - 0
145
+ - 9
146
+ - 8
147
+ version: 0.9.8
148
+ type: :development
149
+ version_requirements: *id009
150
+ description:
151
+ email:
152
+ - nunemaker@gmail.com
153
+ executables:
154
+ - mmconsole
155
+ extensions: []
156
+
157
+ extra_rdoc_files: []
158
+
159
+ files:
160
+ - bin/mmconsole
161
+ - examples/attr_accessible.rb
162
+ - examples/attr_protected.rb
163
+ - examples/cache_key.rb
164
+ - examples/custom_types.rb
165
+ - examples/identity_map/automatic.rb
166
+ - examples/identity_map/middleware.rb
167
+ - examples/identity_map.rb
168
+ - examples/keys.rb
169
+ - examples/modifiers/set.rb
170
+ - examples/plugins.rb
171
+ - examples/querying.rb
172
+ - examples/safe.rb
173
+ - examples/scopes.rb
174
+ - examples/validating/embedded_docs.rb
175
+ - lib/mongo_mapper/connection.rb
176
+ - lib/mongo_mapper/document.rb
177
+ - lib/mongo_mapper/embedded_document.rb
178
+ - lib/mongo_mapper/exceptions.rb
179
+ - lib/mongo_mapper/extensions/array.rb
180
+ - lib/mongo_mapper/extensions/binary.rb
181
+ - lib/mongo_mapper/extensions/boolean.rb
182
+ - lib/mongo_mapper/extensions/date.rb
183
+ - lib/mongo_mapper/extensions/float.rb
184
+ - lib/mongo_mapper/extensions/hash.rb
185
+ - lib/mongo_mapper/extensions/integer.rb
186
+ - lib/mongo_mapper/extensions/kernel.rb
187
+ - lib/mongo_mapper/extensions/nil_class.rb
188
+ - lib/mongo_mapper/extensions/object.rb
189
+ - lib/mongo_mapper/extensions/object_id.rb
190
+ - lib/mongo_mapper/extensions/set.rb
191
+ - lib/mongo_mapper/extensions/string.rb
192
+ - lib/mongo_mapper/extensions/time.rb
193
+ - lib/mongo_mapper/plugins/accessible.rb
194
+ - lib/mongo_mapper/plugins/associations/base.rb
195
+ - lib/mongo_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb
196
+ - lib/mongo_mapper/plugins/associations/belongs_to_proxy.rb
197
+ - lib/mongo_mapper/plugins/associations/collection.rb
198
+ - lib/mongo_mapper/plugins/associations/embedded_collection.rb
199
+ - lib/mongo_mapper/plugins/associations/in_array_proxy.rb
200
+ - lib/mongo_mapper/plugins/associations/many_documents_as_proxy.rb
201
+ - lib/mongo_mapper/plugins/associations/many_documents_proxy.rb
202
+ - lib/mongo_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb
203
+ - lib/mongo_mapper/plugins/associations/many_embedded_proxy.rb
204
+ - lib/mongo_mapper/plugins/associations/many_polymorphic_proxy.rb
205
+ - lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb
206
+ - lib/mongo_mapper/plugins/associations/one_proxy.rb
207
+ - lib/mongo_mapper/plugins/associations/proxy.rb
208
+ - lib/mongo_mapper/plugins/associations.rb
209
+ - lib/mongo_mapper/plugins/caching.rb
210
+ - lib/mongo_mapper/plugins/callbacks.rb
211
+ - lib/mongo_mapper/plugins/clone.rb
212
+ - lib/mongo_mapper/plugins/descendants.rb
213
+ - lib/mongo_mapper/plugins/dirty.rb
214
+ - lib/mongo_mapper/plugins/document.rb
215
+ - lib/mongo_mapper/plugins/dynamic_querying/dynamic_finder.rb
216
+ - lib/mongo_mapper/plugins/dynamic_querying.rb
217
+ - lib/mongo_mapper/plugins/embedded_document.rb
218
+ - lib/mongo_mapper/plugins/equality.rb
219
+ - lib/mongo_mapper/plugins/identity_map.rb
220
+ - lib/mongo_mapper/plugins/indexes.rb
221
+ - lib/mongo_mapper/plugins/inspect.rb
222
+ - lib/mongo_mapper/plugins/keys/key.rb
223
+ - lib/mongo_mapper/plugins/keys.rb
224
+ - lib/mongo_mapper/plugins/logger.rb
225
+ - lib/mongo_mapper/plugins/modifiers.rb
226
+ - lib/mongo_mapper/plugins/pagination.rb
227
+ - lib/mongo_mapper/plugins/persistence.rb
228
+ - lib/mongo_mapper/plugins/protected.rb
229
+ - lib/mongo_mapper/plugins/querying/decorator.rb
230
+ - lib/mongo_mapper/plugins/querying/plucky_methods.rb
231
+ - lib/mongo_mapper/plugins/querying.rb
232
+ - lib/mongo_mapper/plugins/rails.rb
233
+ - lib/mongo_mapper/plugins/safe.rb
234
+ - lib/mongo_mapper/plugins/sci.rb
235
+ - lib/mongo_mapper/plugins/scopes.rb
236
+ - lib/mongo_mapper/plugins/serialization.rb
237
+ - lib/mongo_mapper/plugins/timestamps.rb
238
+ - lib/mongo_mapper/plugins/userstamps.rb
239
+ - lib/mongo_mapper/plugins/validations.rb
240
+ - lib/mongo_mapper/plugins.rb
241
+ - lib/mongo_mapper/support/descendant_appends.rb
242
+ - lib/mongo_mapper/version.rb
243
+ - lib/mongo_mapper.rb
244
+ - rails/init.rb
245
+ - test/_NOTE_ON_TESTING
246
+ - test/functional/associations/test_belongs_to_polymorphic_proxy.rb
247
+ - test/functional/associations/test_belongs_to_proxy.rb
248
+ - test/functional/associations/test_in_array_proxy.rb
249
+ - test/functional/associations/test_many_documents_as_proxy.rb
250
+ - test/functional/associations/test_many_documents_proxy.rb
251
+ - test/functional/associations/test_many_embedded_polymorphic_proxy.rb
252
+ - test/functional/associations/test_many_embedded_proxy.rb
253
+ - test/functional/associations/test_many_polymorphic_proxy.rb
254
+ - test/functional/associations/test_one_embedded_proxy.rb
255
+ - test/functional/associations/test_one_proxy.rb
256
+ - test/functional/test_accessible.rb
257
+ - test/functional/test_associations.rb
258
+ - test/functional/test_binary.rb
259
+ - test/functional/test_caching.rb
260
+ - test/functional/test_callbacks.rb
261
+ - test/functional/test_dirty.rb
262
+ - test/functional/test_document.rb
263
+ - test/functional/test_dynamic_querying.rb
264
+ - test/functional/test_embedded_document.rb
265
+ - test/functional/test_identity_map.rb
266
+ - test/functional/test_indexes.rb
267
+ - test/functional/test_logger.rb
268
+ - test/functional/test_modifiers.rb
269
+ - test/functional/test_pagination.rb
270
+ - test/functional/test_protected.rb
271
+ - test/functional/test_querying.rb
272
+ - test/functional/test_safe.rb
273
+ - test/functional/test_sci.rb
274
+ - test/functional/test_scopes.rb
275
+ - test/functional/test_string_id_compatibility.rb
276
+ - test/functional/test_timestamps.rb
277
+ - test/functional/test_userstamps.rb
278
+ - test/functional/test_validations.rb
279
+ - test/models.rb
280
+ - test/test_active_model_lint.rb
281
+ - test/test_helper.rb
282
+ - test/unit/associations/test_base.rb
283
+ - test/unit/associations/test_proxy.rb
284
+ - test/unit/serializers/test_json_serializer.rb
285
+ - test/unit/test_clone.rb
286
+ - test/unit/test_descendant_appends.rb
287
+ - test/unit/test_document.rb
288
+ - test/unit/test_dynamic_finder.rb
289
+ - test/unit/test_embedded_document.rb
290
+ - test/unit/test_extensions.rb
291
+ - test/unit/test_key.rb
292
+ - test/unit/test_keys.rb
293
+ - test/unit/test_mongo_mapper.rb
294
+ - test/unit/test_pagination.rb
295
+ - test/unit/test_plugins.rb
296
+ - test/unit/test_rails.rb
297
+ - test/unit/test_rails_compatibility.rb
298
+ - test/unit/test_serialization.rb
299
+ - test/unit/test_time_zones.rb
300
+ - test/unit/test_validations.rb
301
+ - LICENSE
302
+ - UPGRADES
303
+ - README.rdoc
304
+ has_rdoc: true
305
+ homepage: http://github.com/jonbell/mongomapper
306
+ licenses: []
307
+
308
+ post_install_message:
309
+ rdoc_options: []
310
+
311
+ require_paths:
312
+ - lib
313
+ required_ruby_version: !ruby/object:Gem::Requirement
314
+ none: false
315
+ requirements:
316
+ - - ">="
317
+ - !ruby/object:Gem::Version
318
+ segments:
319
+ - 0
320
+ version: "0"
321
+ required_rubygems_version: !ruby/object:Gem::Requirement
322
+ none: false
323
+ requirements:
324
+ - - ">="
325
+ - !ruby/object:Gem::Version
326
+ segments:
327
+ - 0
328
+ version: "0"
329
+ requirements: []
330
+
331
+ rubyforge_project:
332
+ rubygems_version: 1.3.7
333
+ signing_key:
334
+ specification_version: 3
335
+ summary: A Ruby Object Mapper for Mongo
336
+ test_files: []
337
+