thorsson-mongo_mapper 0.8.2

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