djsun-mongomapper 0.3.5.5 → 0.4.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/README.rdoc +38 -38
  2. data/Rakefile +87 -73
  3. data/VERSION +1 -1
  4. data/lib/mongomapper.rb +67 -71
  5. data/lib/mongomapper/associations.rb +86 -84
  6. data/lib/mongomapper/associations/belongs_to_polymorphic_proxy.rb +34 -34
  7. data/lib/mongomapper/associations/many_embedded_proxy.rb +67 -17
  8. data/lib/mongomapper/associations/proxy.rb +74 -73
  9. data/lib/mongomapper/document.rb +342 -348
  10. data/lib/mongomapper/embedded_document.rb +354 -274
  11. data/lib/mongomapper/finder_options.rb +84 -84
  12. data/lib/mongomapper/key.rb +32 -76
  13. data/lib/mongomapper/rails_compatibility/document.rb +14 -14
  14. data/lib/mongomapper/rails_compatibility/embedded_document.rb +26 -24
  15. data/lib/mongomapper/support.rb +156 -29
  16. data/lib/mongomapper/validations.rb +69 -47
  17. data/test/custom_matchers.rb +48 -0
  18. data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +53 -56
  19. data/test/functional/associations/test_belongs_to_proxy.rb +48 -49
  20. data/test/functional/associations/test_many_documents_as_proxy.rb +208 -253
  21. data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +130 -130
  22. data/test/functional/associations/test_many_embedded_proxy.rb +168 -106
  23. data/test/functional/associations/test_many_polymorphic_proxy.rb +261 -262
  24. data/test/functional/test_binary.rb +21 -0
  25. data/test/functional/test_document.rb +946 -952
  26. data/test/functional/test_embedded_document.rb +98 -0
  27. data/test/functional/test_pagination.rb +87 -80
  28. data/test/functional/test_rails_compatibility.rb +29 -29
  29. data/test/functional/test_validations.rb +262 -172
  30. data/test/models.rb +169 -169
  31. data/test/test_helper.rb +28 -66
  32. data/test/unit/serializers/test_json_serializer.rb +193 -193
  33. data/test/unit/test_document.rb +161 -123
  34. data/test/unit/test_embedded_document.rb +643 -547
  35. data/test/unit/test_finder_options.rb +183 -183
  36. data/test/unit/test_key.rb +175 -247
  37. data/test/unit/test_rails_compatibility.rb +38 -33
  38. data/test/unit/test_serializations.rb +52 -52
  39. data/test/unit/test_support.rb +268 -0
  40. data/test/unit/test_time_zones.rb +40 -0
  41. data/test/unit/test_validations.rb +499 -258
  42. metadata +22 -12
  43. data/History +0 -76
  44. data/mongomapper.gemspec +0 -145
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: djsun-mongomapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5.5
4
+ version: 0.4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
+ - David James
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2009-08-29 00:00:00 -07:00
13
+ date: 2009-10-05 00:00:00 -04:00
13
14
  default_executable: mmconsole
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
@@ -23,14 +24,14 @@ dependencies:
23
24
  version: "0"
24
25
  version:
25
26
  - !ruby/object:Gem::Dependency
26
- name: mongodb-mongo
27
+ name: mongo
27
28
  type: :runtime
28
29
  version_requirement:
29
30
  version_requirements: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - "="
32
33
  - !ruby/object:Gem::Version
33
- version: 0.14.1
34
+ version: "0.15"
34
35
  version:
35
36
  - !ruby/object:Gem::Dependency
36
37
  name: jnunemaker-validatable
@@ -63,7 +64,7 @@ dependencies:
63
64
  version: 0.4.0
64
65
  version:
65
66
  description:
66
- email: nunemaker@gmail.com
67
+ email: djames@sunlightfoundation.com
67
68
  executables:
68
69
  - mmconsole
69
70
  extensions: []
@@ -73,7 +74,6 @@ extra_rdoc_files:
73
74
  - README.rdoc
74
75
  files:
75
76
  - .gitignore
76
- - History
77
77
  - LICENSE
78
78
  - README.rdoc
79
79
  - Rakefile
@@ -106,8 +106,8 @@ files:
106
106
  - lib/mongomapper/serializers/json_serializer.rb
107
107
  - lib/mongomapper/support.rb
108
108
  - lib/mongomapper/validations.rb
109
- - mongomapper.gemspec
110
109
  - test/NOTE_ON_TESTING
110
+ - test/custom_matchers.rb
111
111
  - test/functional/associations/test_belongs_to_polymorphic_proxy.rb
112
112
  - test/functional/associations/test_belongs_to_proxy.rb
113
113
  - test/functional/associations/test_many_documents_as_proxy.rb
@@ -116,8 +116,10 @@ files:
116
116
  - test/functional/associations/test_many_polymorphic_proxy.rb
117
117
  - test/functional/associations/test_many_proxy.rb
118
118
  - test/functional/test_associations.rb
119
+ - test/functional/test_binary.rb
119
120
  - test/functional/test_callbacks.rb
120
121
  - test/functional/test_document.rb
122
+ - test/functional/test_embedded_document.rb
121
123
  - test/functional/test_pagination.rb
122
124
  - test/functional/test_rails_compatibility.rb
123
125
  - test/functional/test_validations.rb
@@ -134,10 +136,13 @@ files:
134
136
  - test/unit/test_pagination.rb
135
137
  - test/unit/test_rails_compatibility.rb
136
138
  - test/unit/test_serializations.rb
139
+ - test/unit/test_support.rb
140
+ - test/unit/test_time_zones.rb
137
141
  - test/unit/test_validations.rb
138
- has_rdoc: false
139
- homepage: http://github.com/jnunemaker/mongomapper
140
- licenses:
142
+ has_rdoc: true
143
+ homepage: http://github.com/djsun/mongomapper
144
+ licenses: []
145
+
141
146
  post_install_message:
142
147
  rdoc_options:
143
148
  - --charset=UTF-8
@@ -157,12 +162,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
162
  version:
158
163
  requirements: []
159
164
 
160
- rubyforge_project: mongomapper
165
+ rubyforge_project:
161
166
  rubygems_version: 1.3.5
162
167
  signing_key:
163
168
  specification_version: 3
164
- summary: Awesome gem for modeling your domain and storing it in mongo
169
+ summary: Map your domain to MongoDB
165
170
  test_files:
171
+ - test/custom_matchers.rb
166
172
  - test/functional/associations/test_belongs_to_polymorphic_proxy.rb
167
173
  - test/functional/associations/test_belongs_to_proxy.rb
168
174
  - test/functional/associations/test_many_documents_as_proxy.rb
@@ -171,8 +177,10 @@ test_files:
171
177
  - test/functional/associations/test_many_polymorphic_proxy.rb
172
178
  - test/functional/associations/test_many_proxy.rb
173
179
  - test/functional/test_associations.rb
180
+ - test/functional/test_binary.rb
174
181
  - test/functional/test_callbacks.rb
175
182
  - test/functional/test_document.rb
183
+ - test/functional/test_embedded_document.rb
176
184
  - test/functional/test_pagination.rb
177
185
  - test/functional/test_rails_compatibility.rb
178
186
  - test/functional/test_validations.rb
@@ -189,4 +197,6 @@ test_files:
189
197
  - test/unit/test_pagination.rb
190
198
  - test/unit/test_rails_compatibility.rb
191
199
  - test/unit/test_serializations.rb
200
+ - test/unit/test_support.rb
201
+ - test/unit/test_time_zones.rb
192
202
  - test/unit/test_validations.rb
data/History DELETED
@@ -1,76 +0,0 @@
1
- 0.3.5 8/29/2009
2
- * updated to 0.14 of the ruby driver
3
- * _type key gets set automatically at initialize time if defined and blank
4
-
5
- 0.3.4 8/28/2009
6
- * BACKWORDS COMPATIBILITY BREAK: Timestamps are now optional. To use them add timestamps! to your model.
7
- * BACKWORDS COMPATIBILITY BREAK: Associations keys are no longer created automatically when you use belongs_to and many. Too much was hidden from the developer. You now have to declare them like key :creator_id, String and such.
8
- * to_json now includes dynamic keys and embedded stuff by default
9
- * added polymorphic many with :as option (dcu)
10
-
11
- 0.3.3 8/16/2009
12
- * BACKWORDS COMPATIBILITY BREAK: _id is now once again a string rather than an object id and will stay that way.
13
- * Custom id's can now be used because of the change to string id's
14
- * Added dynamic finders to document. (dcu)
15
- * Added destroy_all, delete_all and nullify for many document association
16
- * Added :dependent option for many documents assocation (dcu)
17
- * update_attributes now returns true or false instead of the document. (Durran Jordan and me)
18
- * Keys no longer require a type
19
- * Keys can now be added on the fly using []=
20
-
21
- 0.3.2 8/6/2009
22
- * Added many polymorphic documents association
23
- * Implemented build and create for many and many polymorphic documents
24
- * <<, push and concat now work correctly for many and many polymorphic documents
25
- * find(:first) now accepts order option
26
- * id is now included by default with to_json
27
- * _id is now always excluded from to_json
28
- * Times are now always returned as UTC
29
- * Default values are now a bit more intelligent for Array and Hash keys (djsun)
30
- * Embedded documents now have _id as well so they can be identified more easily
31
-
32
- 0.3.1 7/28/2009
33
- * 1 minor tweak
34
- * Removed deep_merge gem as dependency as ActiveSupport has deep_merge that works good enough
35
-
36
- 0.3.0 7/28/2009
37
- * 5 major additions, 3 minor additions, 3 bug fix, and other miscellany
38
- * BACKWORDS COMPATIBILITY BREAK: _id is now stored in binary form (recommended by mongodb team) instead of string, api is the same everywhere as before but data stored with string id's previous to change will need to be updated
39
- * Added Document#paginate which works just like find but adds pagination (dcu did basics and I pimped)
40
- * Added a basic console for playing around with MongoMapper (dcu)
41
- * Embedded associations can now be deeply nested (Keith Hanson)
42
- * Added support for many polymorphic documents (Felipe Coury and Me)
43
- * Fixed bug where conditions that disallowed using $in, $all and $any with an array
44
- * Bumped version of validatable so :if validation option supports symbol/string to proc.
45
- * Document#create with no attributes now creates a document as long as it is valid
46
- * Now defining accessor methods when key is declared rather than using method missing and all that jazz
47
- * Attributes now have boolean methods that return true or false based on whether they have value present
48
- * Added scoped finds and pagination on many document association.
49
- * find first and last now use natural order which is more reliable.
50
- * Updated to latest ruby driver (0.10.1)
51
-
52
-
53
- 0.2.0 7/7/2009
54
- * 2 major additions (observers, associations), several minor additions, and a few bug fixes
55
- * Added observers
56
- * many now supports embedded docs or docs in another collection (dcu on github)
57
- * added belongs_to association (dcu)
58
- * added validates_uniqueness_of (dcu)
59
- * added :unique key shortcut to add validates_uniqueness_of automatically
60
- * now tracking descendants of document (dcu)
61
- * added validates_exclusion_of and validates_inclusion_of
62
- * Bumped required version of validatable for callback fixes
63
- * More thorough use of converting find conditions and options to mongo speak
64
- * #attributes= no longer bombs when given nil
65
-
66
- 0.1.2 7/3/2009
67
- * 2 minor changes
68
- * Straightened out callbacks and added validate, validate_on_create and validate_on_update.
69
- * Attributes passed into attributes= now call writer methods if they exist. This is mostly for virtual attributes.
70
-
71
- 0.1.1 6/28/2009
72
- * 1 minor change
73
- * bumped ruby driver to 0.9 and removed hacks I had in while waiting for it
74
-
75
- 0.1.0 6/26/2009
76
- * Initial release
@@ -1,145 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{mongomapper}
8
- s.version = "0.3.5.5"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["John Nunemaker"]
12
- s.date = %q{2009-08-29}
13
- s.default_executable = %q{mmconsole}
14
- s.email = %q{nunemaker@gmail.com}
15
- s.executables = ["mmconsole"]
16
- s.extra_rdoc_files = [
17
- "LICENSE",
18
- "README.rdoc"
19
- ]
20
- s.files = [
21
- ".gitignore",
22
- "History",
23
- "LICENSE",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "bin/mmconsole",
28
- "lib/mongomapper.rb",
29
- "lib/mongomapper/associations.rb",
30
- "lib/mongomapper/associations/base.rb",
31
- "lib/mongomapper/associations/belongs_to_polymorphic_proxy.rb",
32
- "lib/mongomapper/associations/belongs_to_proxy.rb",
33
- "lib/mongomapper/associations/many_documents_as_proxy.rb",
34
- "lib/mongomapper/associations/many_documents_proxy.rb",
35
- "lib/mongomapper/associations/many_embedded_polymorphic_proxy.rb",
36
- "lib/mongomapper/associations/many_embedded_proxy.rb",
37
- "lib/mongomapper/associations/many_polymorphic_proxy.rb",
38
- "lib/mongomapper/associations/many_proxy.rb",
39
- "lib/mongomapper/associations/proxy.rb",
40
- "lib/mongomapper/callbacks.rb",
41
- "lib/mongomapper/document.rb",
42
- "lib/mongomapper/dynamic_finder.rb",
43
- "lib/mongomapper/embedded_document.rb",
44
- "lib/mongomapper/finder_options.rb",
45
- "lib/mongomapper/key.rb",
46
- "lib/mongomapper/observing.rb",
47
- "lib/mongomapper/pagination.rb",
48
- "lib/mongomapper/rails_compatibility/document.rb",
49
- "lib/mongomapper/rails_compatibility/embedded_document.rb",
50
- "lib/mongomapper/save_with_validation.rb",
51
- "lib/mongomapper/serialization.rb",
52
- "lib/mongomapper/serializers/json_serializer.rb",
53
- "lib/mongomapper/support.rb",
54
- "lib/mongomapper/validations.rb",
55
- "mongomapper.gemspec",
56
- "test/NOTE_ON_TESTING",
57
- "test/functional/associations/test_belongs_to_polymorphic_proxy.rb",
58
- "test/functional/associations/test_belongs_to_proxy.rb",
59
- "test/functional/associations/test_many_documents_as_proxy.rb",
60
- "test/functional/associations/test_many_embedded_polymorphic_proxy.rb",
61
- "test/functional/associations/test_many_embedded_proxy.rb",
62
- "test/functional/associations/test_many_polymorphic_proxy.rb",
63
- "test/functional/associations/test_many_proxy.rb",
64
- "test/functional/test_associations.rb",
65
- "test/functional/test_callbacks.rb",
66
- "test/functional/test_document.rb",
67
- "test/functional/test_pagination.rb",
68
- "test/functional/test_rails_compatibility.rb",
69
- "test/functional/test_validations.rb",
70
- "test/models.rb",
71
- "test/test_helper.rb",
72
- "test/unit/serializers/test_json_serializer.rb",
73
- "test/unit/test_association_base.rb",
74
- "test/unit/test_document.rb",
75
- "test/unit/test_embedded_document.rb",
76
- "test/unit/test_finder_options.rb",
77
- "test/unit/test_key.rb",
78
- "test/unit/test_mongomapper.rb",
79
- "test/unit/test_observing.rb",
80
- "test/unit/test_pagination.rb",
81
- "test/unit/test_rails_compatibility.rb",
82
- "test/unit/test_serializations.rb",
83
- "test/unit/test_validations.rb"
84
- ]
85
- s.homepage = %q{http://github.com/jnunemaker/mongomapper}
86
- s.rdoc_options = ["--charset=UTF-8"]
87
- s.require_paths = ["lib"]
88
- s.rubyforge_project = %q{mongomapper}
89
- s.rubygems_version = %q{1.3.5}
90
- s.summary = %q{Awesome gem for modeling your domain and storing it in mongo}
91
- s.test_files = [
92
- "test/functional/associations/test_belongs_to_polymorphic_proxy.rb",
93
- "test/functional/associations/test_belongs_to_proxy.rb",
94
- "test/functional/associations/test_many_documents_as_proxy.rb",
95
- "test/functional/associations/test_many_embedded_polymorphic_proxy.rb",
96
- "test/functional/associations/test_many_embedded_proxy.rb",
97
- "test/functional/associations/test_many_polymorphic_proxy.rb",
98
- "test/functional/associations/test_many_proxy.rb",
99
- "test/functional/test_associations.rb",
100
- "test/functional/test_callbacks.rb",
101
- "test/functional/test_document.rb",
102
- "test/functional/test_pagination.rb",
103
- "test/functional/test_rails_compatibility.rb",
104
- "test/functional/test_validations.rb",
105
- "test/models.rb",
106
- "test/test_helper.rb",
107
- "test/unit/serializers/test_json_serializer.rb",
108
- "test/unit/test_association_base.rb",
109
- "test/unit/test_document.rb",
110
- "test/unit/test_embedded_document.rb",
111
- "test/unit/test_finder_options.rb",
112
- "test/unit/test_key.rb",
113
- "test/unit/test_mongomapper.rb",
114
- "test/unit/test_observing.rb",
115
- "test/unit/test_pagination.rb",
116
- "test/unit/test_rails_compatibility.rb",
117
- "test/unit/test_serializations.rb",
118
- "test/unit/test_validations.rb"
119
- ]
120
-
121
- if s.respond_to? :specification_version then
122
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
123
- s.specification_version = 3
124
-
125
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
126
- s.add_runtime_dependency(%q<activesupport>, [">= 0"])
127
- s.add_runtime_dependency(%q<mongodb-mongo>, ["= 0.14.1"])
128
- s.add_runtime_dependency(%q<jnunemaker-validatable>, ["= 1.7.2"])
129
- s.add_development_dependency(%q<mocha>, ["= 0.9.4"])
130
- s.add_development_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
131
- else
132
- s.add_dependency(%q<activesupport>, [">= 0"])
133
- s.add_dependency(%q<mongodb-mongo>, ["= 0.14.1"])
134
- s.add_dependency(%q<jnunemaker-validatable>, ["= 1.7.2"])
135
- s.add_dependency(%q<mocha>, ["= 0.9.4"])
136
- s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
137
- end
138
- else
139
- s.add_dependency(%q<activesupport>, [">= 0"])
140
- s.add_dependency(%q<mongodb-mongo>, ["= 0.14.1"])
141
- s.add_dependency(%q<jnunemaker-validatable>, ["= 1.7.2"])
142
- s.add_dependency(%q<mocha>, ["= 0.9.4"])
143
- s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
144
- end
145
- end