ssherman-mongo_mapper 0.8.6

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