humanoid 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. data/.gitignore +6 -0
  2. data/.watchr +29 -0
  3. data/HISTORY +342 -0
  4. data/MIT_LICENSE +20 -0
  5. data/README.rdoc +56 -0
  6. data/Rakefile +53 -0
  7. data/VERSION +1 -0
  8. data/caliper.yml +4 -0
  9. data/humanoid.gemspec +374 -0
  10. data/lib/humanoid.rb +111 -0
  11. data/lib/humanoid/associations.rb +258 -0
  12. data/lib/humanoid/associations/belongs_to.rb +64 -0
  13. data/lib/humanoid/associations/belongs_to_related.rb +62 -0
  14. data/lib/humanoid/associations/has_many.rb +180 -0
  15. data/lib/humanoid/associations/has_many_related.rb +109 -0
  16. data/lib/humanoid/associations/has_one.rb +95 -0
  17. data/lib/humanoid/associations/has_one_related.rb +81 -0
  18. data/lib/humanoid/associations/options.rb +57 -0
  19. data/lib/humanoid/associations/proxy.rb +31 -0
  20. data/lib/humanoid/attributes.rb +184 -0
  21. data/lib/humanoid/callbacks.rb +23 -0
  22. data/lib/humanoid/collection.rb +118 -0
  23. data/lib/humanoid/collections/cyclic_iterator.rb +34 -0
  24. data/lib/humanoid/collections/master.rb +28 -0
  25. data/lib/humanoid/collections/mimic.rb +46 -0
  26. data/lib/humanoid/collections/operations.rb +41 -0
  27. data/lib/humanoid/collections/slaves.rb +44 -0
  28. data/lib/humanoid/commands.rb +182 -0
  29. data/lib/humanoid/commands/create.rb +21 -0
  30. data/lib/humanoid/commands/delete.rb +16 -0
  31. data/lib/humanoid/commands/delete_all.rb +23 -0
  32. data/lib/humanoid/commands/deletion.rb +18 -0
  33. data/lib/humanoid/commands/destroy.rb +19 -0
  34. data/lib/humanoid/commands/destroy_all.rb +23 -0
  35. data/lib/humanoid/commands/save.rb +27 -0
  36. data/lib/humanoid/components.rb +24 -0
  37. data/lib/humanoid/config.rb +84 -0
  38. data/lib/humanoid/contexts.rb +25 -0
  39. data/lib/humanoid/contexts/enumerable.rb +117 -0
  40. data/lib/humanoid/contexts/ids.rb +25 -0
  41. data/lib/humanoid/contexts/mongo.rb +224 -0
  42. data/lib/humanoid/contexts/paging.rb +42 -0
  43. data/lib/humanoid/criteria.rb +259 -0
  44. data/lib/humanoid/criterion/complex.rb +21 -0
  45. data/lib/humanoid/criterion/exclusion.rb +65 -0
  46. data/lib/humanoid/criterion/inclusion.rb +91 -0
  47. data/lib/humanoid/criterion/optional.rb +128 -0
  48. data/lib/humanoid/cursor.rb +82 -0
  49. data/lib/humanoid/document.rb +300 -0
  50. data/lib/humanoid/enslavement.rb +38 -0
  51. data/lib/humanoid/errors.rb +77 -0
  52. data/lib/humanoid/extensions.rb +84 -0
  53. data/lib/humanoid/extensions/array/accessors.rb +17 -0
  54. data/lib/humanoid/extensions/array/aliasing.rb +4 -0
  55. data/lib/humanoid/extensions/array/assimilation.rb +26 -0
  56. data/lib/humanoid/extensions/array/conversions.rb +29 -0
  57. data/lib/humanoid/extensions/array/parentization.rb +13 -0
  58. data/lib/humanoid/extensions/boolean/conversions.rb +16 -0
  59. data/lib/humanoid/extensions/date/conversions.rb +15 -0
  60. data/lib/humanoid/extensions/datetime/conversions.rb +17 -0
  61. data/lib/humanoid/extensions/float/conversions.rb +16 -0
  62. data/lib/humanoid/extensions/hash/accessors.rb +38 -0
  63. data/lib/humanoid/extensions/hash/assimilation.rb +30 -0
  64. data/lib/humanoid/extensions/hash/conversions.rb +15 -0
  65. data/lib/humanoid/extensions/hash/criteria_helpers.rb +20 -0
  66. data/lib/humanoid/extensions/hash/scoping.rb +12 -0
  67. data/lib/humanoid/extensions/integer/conversions.rb +16 -0
  68. data/lib/humanoid/extensions/nil/assimilation.rb +13 -0
  69. data/lib/humanoid/extensions/object/conversions.rb +33 -0
  70. data/lib/humanoid/extensions/proc/scoping.rb +12 -0
  71. data/lib/humanoid/extensions/string/conversions.rb +15 -0
  72. data/lib/humanoid/extensions/string/inflections.rb +97 -0
  73. data/lib/humanoid/extensions/symbol/inflections.rb +36 -0
  74. data/lib/humanoid/extensions/time/conversions.rb +18 -0
  75. data/lib/humanoid/factory.rb +19 -0
  76. data/lib/humanoid/field.rb +39 -0
  77. data/lib/humanoid/fields.rb +62 -0
  78. data/lib/humanoid/finders.rb +224 -0
  79. data/lib/humanoid/identity.rb +39 -0
  80. data/lib/humanoid/indexes.rb +30 -0
  81. data/lib/humanoid/matchers.rb +36 -0
  82. data/lib/humanoid/matchers/all.rb +11 -0
  83. data/lib/humanoid/matchers/default.rb +26 -0
  84. data/lib/humanoid/matchers/exists.rb +13 -0
  85. data/lib/humanoid/matchers/gt.rb +11 -0
  86. data/lib/humanoid/matchers/gte.rb +11 -0
  87. data/lib/humanoid/matchers/in.rb +11 -0
  88. data/lib/humanoid/matchers/lt.rb +11 -0
  89. data/lib/humanoid/matchers/lte.rb +11 -0
  90. data/lib/humanoid/matchers/ne.rb +11 -0
  91. data/lib/humanoid/matchers/nin.rb +11 -0
  92. data/lib/humanoid/matchers/size.rb +11 -0
  93. data/lib/humanoid/memoization.rb +27 -0
  94. data/lib/humanoid/named_scope.rb +40 -0
  95. data/lib/humanoid/scope.rb +75 -0
  96. data/lib/humanoid/timestamps.rb +30 -0
  97. data/lib/humanoid/versioning.rb +28 -0
  98. data/perf/benchmark.rb +77 -0
  99. data/spec/integration/humanoid/associations_spec.rb +301 -0
  100. data/spec/integration/humanoid/attributes_spec.rb +22 -0
  101. data/spec/integration/humanoid/commands_spec.rb +216 -0
  102. data/spec/integration/humanoid/contexts/enumerable_spec.rb +33 -0
  103. data/spec/integration/humanoid/criteria_spec.rb +224 -0
  104. data/spec/integration/humanoid/document_spec.rb +587 -0
  105. data/spec/integration/humanoid/extensions_spec.rb +26 -0
  106. data/spec/integration/humanoid/finders_spec.rb +119 -0
  107. data/spec/integration/humanoid/inheritance_spec.rb +137 -0
  108. data/spec/integration/humanoid/named_scope_spec.rb +46 -0
  109. data/spec/models/address.rb +39 -0
  110. data/spec/models/animal.rb +6 -0
  111. data/spec/models/comment.rb +8 -0
  112. data/spec/models/country_code.rb +6 -0
  113. data/spec/models/employer.rb +5 -0
  114. data/spec/models/game.rb +6 -0
  115. data/spec/models/inheritance.rb +56 -0
  116. data/spec/models/location.rb +5 -0
  117. data/spec/models/mixed_drink.rb +4 -0
  118. data/spec/models/name.rb +13 -0
  119. data/spec/models/namespacing.rb +11 -0
  120. data/spec/models/patient.rb +4 -0
  121. data/spec/models/person.rb +98 -0
  122. data/spec/models/pet.rb +7 -0
  123. data/spec/models/pet_owner.rb +6 -0
  124. data/spec/models/phone.rb +7 -0
  125. data/spec/models/post.rb +15 -0
  126. data/spec/models/translation.rb +5 -0
  127. data/spec/models/vet_visit.rb +5 -0
  128. data/spec/spec.opts +3 -0
  129. data/spec/spec_helper.rb +31 -0
  130. data/spec/unit/mongoid/associations/belongs_to_related_spec.rb +141 -0
  131. data/spec/unit/mongoid/associations/belongs_to_spec.rb +193 -0
  132. data/spec/unit/mongoid/associations/has_many_related_spec.rb +387 -0
  133. data/spec/unit/mongoid/associations/has_many_spec.rb +471 -0
  134. data/spec/unit/mongoid/associations/has_one_related_spec.rb +179 -0
  135. data/spec/unit/mongoid/associations/has_one_spec.rb +282 -0
  136. data/spec/unit/mongoid/associations/options_spec.rb +191 -0
  137. data/spec/unit/mongoid/associations_spec.rb +545 -0
  138. data/spec/unit/mongoid/attributes_spec.rb +484 -0
  139. data/spec/unit/mongoid/callbacks_spec.rb +55 -0
  140. data/spec/unit/mongoid/collection_spec.rb +171 -0
  141. data/spec/unit/mongoid/collections/cyclic_iterator_spec.rb +75 -0
  142. data/spec/unit/mongoid/collections/master_spec.rb +41 -0
  143. data/spec/unit/mongoid/collections/mimic_spec.rb +43 -0
  144. data/spec/unit/mongoid/collections/slaves_spec.rb +81 -0
  145. data/spec/unit/mongoid/commands/create_spec.rb +30 -0
  146. data/spec/unit/mongoid/commands/delete_all_spec.rb +58 -0
  147. data/spec/unit/mongoid/commands/delete_spec.rb +35 -0
  148. data/spec/unit/mongoid/commands/destroy_all_spec.rb +23 -0
  149. data/spec/unit/mongoid/commands/destroy_spec.rb +44 -0
  150. data/spec/unit/mongoid/commands/save_spec.rb +105 -0
  151. data/spec/unit/mongoid/commands_spec.rb +282 -0
  152. data/spec/unit/mongoid/config_spec.rb +165 -0
  153. data/spec/unit/mongoid/contexts/enumerable_spec.rb +374 -0
  154. data/spec/unit/mongoid/contexts/mongo_spec.rb +505 -0
  155. data/spec/unit/mongoid/contexts_spec.rb +25 -0
  156. data/spec/unit/mongoid/criteria_spec.rb +769 -0
  157. data/spec/unit/mongoid/criterion/complex_spec.rb +19 -0
  158. data/spec/unit/mongoid/criterion/exclusion_spec.rb +91 -0
  159. data/spec/unit/mongoid/criterion/inclusion_spec.rb +211 -0
  160. data/spec/unit/mongoid/criterion/optional_spec.rb +329 -0
  161. data/spec/unit/mongoid/cursor_spec.rb +74 -0
  162. data/spec/unit/mongoid/document_spec.rb +986 -0
  163. data/spec/unit/mongoid/enslavement_spec.rb +63 -0
  164. data/spec/unit/mongoid/errors_spec.rb +103 -0
  165. data/spec/unit/mongoid/extensions/array/accessors_spec.rb +50 -0
  166. data/spec/unit/mongoid/extensions/array/assimilation_spec.rb +24 -0
  167. data/spec/unit/mongoid/extensions/array/conversions_spec.rb +35 -0
  168. data/spec/unit/mongoid/extensions/array/parentization_spec.rb +20 -0
  169. data/spec/unit/mongoid/extensions/boolean/conversions_spec.rb +49 -0
  170. data/spec/unit/mongoid/extensions/date/conversions_spec.rb +102 -0
  171. data/spec/unit/mongoid/extensions/datetime/conversions_spec.rb +70 -0
  172. data/spec/unit/mongoid/extensions/float/conversions_spec.rb +61 -0
  173. data/spec/unit/mongoid/extensions/hash/accessors_spec.rb +184 -0
  174. data/spec/unit/mongoid/extensions/hash/assimilation_spec.rb +46 -0
  175. data/spec/unit/mongoid/extensions/hash/conversions_spec.rb +21 -0
  176. data/spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb +17 -0
  177. data/spec/unit/mongoid/extensions/hash/scoping_spec.rb +14 -0
  178. data/spec/unit/mongoid/extensions/integer/conversions_spec.rb +61 -0
  179. data/spec/unit/mongoid/extensions/nil/assimilation_spec.rb +24 -0
  180. data/spec/unit/mongoid/extensions/object/conversions_spec.rb +43 -0
  181. data/spec/unit/mongoid/extensions/proc/scoping_spec.rb +34 -0
  182. data/spec/unit/mongoid/extensions/string/conversions_spec.rb +17 -0
  183. data/spec/unit/mongoid/extensions/string/inflections_spec.rb +208 -0
  184. data/spec/unit/mongoid/extensions/symbol/inflections_spec.rb +91 -0
  185. data/spec/unit/mongoid/extensions/time/conversions_spec.rb +70 -0
  186. data/spec/unit/mongoid/factory_spec.rb +31 -0
  187. data/spec/unit/mongoid/field_spec.rb +81 -0
  188. data/spec/unit/mongoid/fields_spec.rb +158 -0
  189. data/spec/unit/mongoid/finders_spec.rb +368 -0
  190. data/spec/unit/mongoid/identity_spec.rb +88 -0
  191. data/spec/unit/mongoid/indexes_spec.rb +93 -0
  192. data/spec/unit/mongoid/matchers/all_spec.rb +27 -0
  193. data/spec/unit/mongoid/matchers/default_spec.rb +27 -0
  194. data/spec/unit/mongoid/matchers/exists_spec.rb +56 -0
  195. data/spec/unit/mongoid/matchers/gt_spec.rb +39 -0
  196. data/spec/unit/mongoid/matchers/gte_spec.rb +49 -0
  197. data/spec/unit/mongoid/matchers/in_spec.rb +27 -0
  198. data/spec/unit/mongoid/matchers/lt_spec.rb +39 -0
  199. data/spec/unit/mongoid/matchers/lte_spec.rb +49 -0
  200. data/spec/unit/mongoid/matchers/ne_spec.rb +27 -0
  201. data/spec/unit/mongoid/matchers/nin_spec.rb +27 -0
  202. data/spec/unit/mongoid/matchers/size_spec.rb +27 -0
  203. data/spec/unit/mongoid/matchers_spec.rb +329 -0
  204. data/spec/unit/mongoid/memoization_spec.rb +75 -0
  205. data/spec/unit/mongoid/named_scope_spec.rb +123 -0
  206. data/spec/unit/mongoid/scope_spec.rb +240 -0
  207. data/spec/unit/mongoid/timestamps_spec.rb +25 -0
  208. data/spec/unit/mongoid/versioning_spec.rb +41 -0
  209. data/spec/unit/mongoid_spec.rb +37 -0
  210. metadata +431 -0
@@ -0,0 +1,53 @@
1
+ require "rubygems"
2
+ require "rake"
3
+ require "rake/rdoctask"
4
+ require "spec/rake/spectask"
5
+
6
+ begin
7
+ require "jeweler"
8
+ Jeweler::Tasks.new do |gem|
9
+ gem.name = "humanoid"
10
+ gem.summary = "A mirror of Mongoid (an awesome Ruby ODM framework for MongoDB) with a name I can say out loud."
11
+ gem.email = "durran@gmail.com"
12
+ gem.homepage = "http://mongoid.org"
13
+ gem.authors = ["Durran Jordan"]
14
+
15
+ gem.add_dependency("activesupport", "<= 2.3.5")
16
+ gem.add_dependency("mongo", ">= 0.18.3")
17
+ gem.add_dependency("durran-validatable", ">= 2.0.1")
18
+ gem.add_dependency("will_paginate", "< 3.0.pre")
19
+
20
+ gem.add_development_dependency("rspec", ">= 1.2.9")
21
+ gem.add_development_dependency("mocha", ">= 0.9.8")
22
+ end
23
+ Jeweler::GemcutterTasks.new
24
+ rescue LoadError
25
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
26
+ end
27
+
28
+ Spec::Rake::SpecTask.new(:spec) do |spec|
29
+ spec.pattern = "spec/**/*_spec.rb"
30
+ spec.spec_opts = ["--options", "spec/spec.opts"]
31
+ end
32
+
33
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
34
+ spec.libs << "lib" << "spec"
35
+ spec.pattern = "spec/**/*_spec.rb"
36
+ spec.spec_opts = ["--options", "spec/spec.opts"]
37
+ spec.rcov = true
38
+ end
39
+
40
+ Rake::RDocTask.new do |rdoc|
41
+ if File.exist?("VERSION.yml")
42
+ config = File.read("VERSION")
43
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
44
+ else
45
+ version = ""
46
+ end
47
+ rdoc.rdoc_dir = "rdoc"
48
+ rdoc.title = "humanoid #{version}"
49
+ rdoc.rdoc_files.include("README*")
50
+ rdoc.rdoc_files.include("lib/**/*.rb")
51
+ end
52
+
53
+ task :default => ["spec"]
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.2.7
@@ -0,0 +1,4 @@
1
+ test_directories_to_calculate:
2
+ - spec/unit
3
+ - spec/integration
4
+ - spec/integration/humanoid
@@ -0,0 +1,374 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{humanoid}
8
+ s.version = "1.2.7"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Durran Jordan"]
12
+ s.date = %q{2010-02-20}
13
+ s.email = %q{durran@gmail.com}
14
+ s.extra_rdoc_files = [
15
+ "README.rdoc"
16
+ ]
17
+ s.files = [
18
+ ".gitignore",
19
+ ".watchr",
20
+ "HISTORY",
21
+ "MIT_LICENSE",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "caliper.yml",
26
+ "humanoid.gemspec",
27
+ "lib/humanoid.rb",
28
+ "lib/humanoid/associations.rb",
29
+ "lib/humanoid/associations/belongs_to.rb",
30
+ "lib/humanoid/associations/belongs_to_related.rb",
31
+ "lib/humanoid/associations/has_many.rb",
32
+ "lib/humanoid/associations/has_many_related.rb",
33
+ "lib/humanoid/associations/has_one.rb",
34
+ "lib/humanoid/associations/has_one_related.rb",
35
+ "lib/humanoid/associations/options.rb",
36
+ "lib/humanoid/associations/proxy.rb",
37
+ "lib/humanoid/attributes.rb",
38
+ "lib/humanoid/callbacks.rb",
39
+ "lib/humanoid/collection.rb",
40
+ "lib/humanoid/collections/cyclic_iterator.rb",
41
+ "lib/humanoid/collections/master.rb",
42
+ "lib/humanoid/collections/mimic.rb",
43
+ "lib/humanoid/collections/operations.rb",
44
+ "lib/humanoid/collections/slaves.rb",
45
+ "lib/humanoid/commands.rb",
46
+ "lib/humanoid/commands/create.rb",
47
+ "lib/humanoid/commands/delete.rb",
48
+ "lib/humanoid/commands/delete_all.rb",
49
+ "lib/humanoid/commands/deletion.rb",
50
+ "lib/humanoid/commands/destroy.rb",
51
+ "lib/humanoid/commands/destroy_all.rb",
52
+ "lib/humanoid/commands/save.rb",
53
+ "lib/humanoid/components.rb",
54
+ "lib/humanoid/config.rb",
55
+ "lib/humanoid/contexts.rb",
56
+ "lib/humanoid/contexts/enumerable.rb",
57
+ "lib/humanoid/contexts/ids.rb",
58
+ "lib/humanoid/contexts/mongo.rb",
59
+ "lib/humanoid/contexts/paging.rb",
60
+ "lib/humanoid/criteria.rb",
61
+ "lib/humanoid/criterion/complex.rb",
62
+ "lib/humanoid/criterion/exclusion.rb",
63
+ "lib/humanoid/criterion/inclusion.rb",
64
+ "lib/humanoid/criterion/optional.rb",
65
+ "lib/humanoid/cursor.rb",
66
+ "lib/humanoid/document.rb",
67
+ "lib/humanoid/enslavement.rb",
68
+ "lib/humanoid/errors.rb",
69
+ "lib/humanoid/extensions.rb",
70
+ "lib/humanoid/extensions/array/accessors.rb",
71
+ "lib/humanoid/extensions/array/aliasing.rb",
72
+ "lib/humanoid/extensions/array/assimilation.rb",
73
+ "lib/humanoid/extensions/array/conversions.rb",
74
+ "lib/humanoid/extensions/array/parentization.rb",
75
+ "lib/humanoid/extensions/boolean/conversions.rb",
76
+ "lib/humanoid/extensions/date/conversions.rb",
77
+ "lib/humanoid/extensions/datetime/conversions.rb",
78
+ "lib/humanoid/extensions/float/conversions.rb",
79
+ "lib/humanoid/extensions/hash/accessors.rb",
80
+ "lib/humanoid/extensions/hash/assimilation.rb",
81
+ "lib/humanoid/extensions/hash/conversions.rb",
82
+ "lib/humanoid/extensions/hash/criteria_helpers.rb",
83
+ "lib/humanoid/extensions/hash/scoping.rb",
84
+ "lib/humanoid/extensions/integer/conversions.rb",
85
+ "lib/humanoid/extensions/nil/assimilation.rb",
86
+ "lib/humanoid/extensions/object/conversions.rb",
87
+ "lib/humanoid/extensions/proc/scoping.rb",
88
+ "lib/humanoid/extensions/string/conversions.rb",
89
+ "lib/humanoid/extensions/string/inflections.rb",
90
+ "lib/humanoid/extensions/symbol/inflections.rb",
91
+ "lib/humanoid/extensions/time/conversions.rb",
92
+ "lib/humanoid/factory.rb",
93
+ "lib/humanoid/field.rb",
94
+ "lib/humanoid/fields.rb",
95
+ "lib/humanoid/finders.rb",
96
+ "lib/humanoid/identity.rb",
97
+ "lib/humanoid/indexes.rb",
98
+ "lib/humanoid/matchers.rb",
99
+ "lib/humanoid/matchers/all.rb",
100
+ "lib/humanoid/matchers/default.rb",
101
+ "lib/humanoid/matchers/exists.rb",
102
+ "lib/humanoid/matchers/gt.rb",
103
+ "lib/humanoid/matchers/gte.rb",
104
+ "lib/humanoid/matchers/in.rb",
105
+ "lib/humanoid/matchers/lt.rb",
106
+ "lib/humanoid/matchers/lte.rb",
107
+ "lib/humanoid/matchers/ne.rb",
108
+ "lib/humanoid/matchers/nin.rb",
109
+ "lib/humanoid/matchers/size.rb",
110
+ "lib/humanoid/memoization.rb",
111
+ "lib/humanoid/named_scope.rb",
112
+ "lib/humanoid/scope.rb",
113
+ "lib/humanoid/timestamps.rb",
114
+ "lib/humanoid/versioning.rb",
115
+ "perf/benchmark.rb",
116
+ "spec/integration/humanoid/associations_spec.rb",
117
+ "spec/integration/humanoid/attributes_spec.rb",
118
+ "spec/integration/humanoid/commands_spec.rb",
119
+ "spec/integration/humanoid/contexts/enumerable_spec.rb",
120
+ "spec/integration/humanoid/criteria_spec.rb",
121
+ "spec/integration/humanoid/document_spec.rb",
122
+ "spec/integration/humanoid/extensions_spec.rb",
123
+ "spec/integration/humanoid/finders_spec.rb",
124
+ "spec/integration/humanoid/inheritance_spec.rb",
125
+ "spec/integration/humanoid/named_scope_spec.rb",
126
+ "spec/models/address.rb",
127
+ "spec/models/animal.rb",
128
+ "spec/models/comment.rb",
129
+ "spec/models/country_code.rb",
130
+ "spec/models/employer.rb",
131
+ "spec/models/game.rb",
132
+ "spec/models/inheritance.rb",
133
+ "spec/models/location.rb",
134
+ "spec/models/mixed_drink.rb",
135
+ "spec/models/name.rb",
136
+ "spec/models/namespacing.rb",
137
+ "spec/models/patient.rb",
138
+ "spec/models/person.rb",
139
+ "spec/models/pet.rb",
140
+ "spec/models/pet_owner.rb",
141
+ "spec/models/phone.rb",
142
+ "spec/models/post.rb",
143
+ "spec/models/translation.rb",
144
+ "spec/models/vet_visit.rb",
145
+ "spec/spec.opts",
146
+ "spec/spec_helper.rb",
147
+ "spec/unit/mongoid/associations/belongs_to_related_spec.rb",
148
+ "spec/unit/mongoid/associations/belongs_to_spec.rb",
149
+ "spec/unit/mongoid/associations/has_many_related_spec.rb",
150
+ "spec/unit/mongoid/associations/has_many_spec.rb",
151
+ "spec/unit/mongoid/associations/has_one_related_spec.rb",
152
+ "spec/unit/mongoid/associations/has_one_spec.rb",
153
+ "spec/unit/mongoid/associations/options_spec.rb",
154
+ "spec/unit/mongoid/associations_spec.rb",
155
+ "spec/unit/mongoid/attributes_spec.rb",
156
+ "spec/unit/mongoid/callbacks_spec.rb",
157
+ "spec/unit/mongoid/collection_spec.rb",
158
+ "spec/unit/mongoid/collections/cyclic_iterator_spec.rb",
159
+ "spec/unit/mongoid/collections/master_spec.rb",
160
+ "spec/unit/mongoid/collections/mimic_spec.rb",
161
+ "spec/unit/mongoid/collections/slaves_spec.rb",
162
+ "spec/unit/mongoid/commands/create_spec.rb",
163
+ "spec/unit/mongoid/commands/delete_all_spec.rb",
164
+ "spec/unit/mongoid/commands/delete_spec.rb",
165
+ "spec/unit/mongoid/commands/destroy_all_spec.rb",
166
+ "spec/unit/mongoid/commands/destroy_spec.rb",
167
+ "spec/unit/mongoid/commands/save_spec.rb",
168
+ "spec/unit/mongoid/commands_spec.rb",
169
+ "spec/unit/mongoid/config_spec.rb",
170
+ "spec/unit/mongoid/contexts/enumerable_spec.rb",
171
+ "spec/unit/mongoid/contexts/mongo_spec.rb",
172
+ "spec/unit/mongoid/contexts_spec.rb",
173
+ "spec/unit/mongoid/criteria_spec.rb",
174
+ "spec/unit/mongoid/criterion/complex_spec.rb",
175
+ "spec/unit/mongoid/criterion/exclusion_spec.rb",
176
+ "spec/unit/mongoid/criterion/inclusion_spec.rb",
177
+ "spec/unit/mongoid/criterion/optional_spec.rb",
178
+ "spec/unit/mongoid/cursor_spec.rb",
179
+ "spec/unit/mongoid/document_spec.rb",
180
+ "spec/unit/mongoid/enslavement_spec.rb",
181
+ "spec/unit/mongoid/errors_spec.rb",
182
+ "spec/unit/mongoid/extensions/array/accessors_spec.rb",
183
+ "spec/unit/mongoid/extensions/array/assimilation_spec.rb",
184
+ "spec/unit/mongoid/extensions/array/conversions_spec.rb",
185
+ "spec/unit/mongoid/extensions/array/parentization_spec.rb",
186
+ "spec/unit/mongoid/extensions/boolean/conversions_spec.rb",
187
+ "spec/unit/mongoid/extensions/date/conversions_spec.rb",
188
+ "spec/unit/mongoid/extensions/datetime/conversions_spec.rb",
189
+ "spec/unit/mongoid/extensions/float/conversions_spec.rb",
190
+ "spec/unit/mongoid/extensions/hash/accessors_spec.rb",
191
+ "spec/unit/mongoid/extensions/hash/assimilation_spec.rb",
192
+ "spec/unit/mongoid/extensions/hash/conversions_spec.rb",
193
+ "spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb",
194
+ "spec/unit/mongoid/extensions/hash/scoping_spec.rb",
195
+ "spec/unit/mongoid/extensions/integer/conversions_spec.rb",
196
+ "spec/unit/mongoid/extensions/nil/assimilation_spec.rb",
197
+ "spec/unit/mongoid/extensions/object/conversions_spec.rb",
198
+ "spec/unit/mongoid/extensions/proc/scoping_spec.rb",
199
+ "spec/unit/mongoid/extensions/string/conversions_spec.rb",
200
+ "spec/unit/mongoid/extensions/string/inflections_spec.rb",
201
+ "spec/unit/mongoid/extensions/symbol/inflections_spec.rb",
202
+ "spec/unit/mongoid/extensions/time/conversions_spec.rb",
203
+ "spec/unit/mongoid/factory_spec.rb",
204
+ "spec/unit/mongoid/field_spec.rb",
205
+ "spec/unit/mongoid/fields_spec.rb",
206
+ "spec/unit/mongoid/finders_spec.rb",
207
+ "spec/unit/mongoid/identity_spec.rb",
208
+ "spec/unit/mongoid/indexes_spec.rb",
209
+ "spec/unit/mongoid/matchers/all_spec.rb",
210
+ "spec/unit/mongoid/matchers/default_spec.rb",
211
+ "spec/unit/mongoid/matchers/exists_spec.rb",
212
+ "spec/unit/mongoid/matchers/gt_spec.rb",
213
+ "spec/unit/mongoid/matchers/gte_spec.rb",
214
+ "spec/unit/mongoid/matchers/in_spec.rb",
215
+ "spec/unit/mongoid/matchers/lt_spec.rb",
216
+ "spec/unit/mongoid/matchers/lte_spec.rb",
217
+ "spec/unit/mongoid/matchers/ne_spec.rb",
218
+ "spec/unit/mongoid/matchers/nin_spec.rb",
219
+ "spec/unit/mongoid/matchers/size_spec.rb",
220
+ "spec/unit/mongoid/matchers_spec.rb",
221
+ "spec/unit/mongoid/memoization_spec.rb",
222
+ "spec/unit/mongoid/named_scope_spec.rb",
223
+ "spec/unit/mongoid/scope_spec.rb",
224
+ "spec/unit/mongoid/timestamps_spec.rb",
225
+ "spec/unit/mongoid/versioning_spec.rb",
226
+ "spec/unit/mongoid_spec.rb"
227
+ ]
228
+ s.homepage = %q{http://mongoid.org}
229
+ s.rdoc_options = ["--charset=UTF-8"]
230
+ s.require_paths = ["lib"]
231
+ s.rubygems_version = %q{1.3.5}
232
+ s.summary = %q{A mirror of Mongoid (an awesome Ruby ODM framework for MongoDB) with a name I can say out loud.}
233
+ s.test_files = [
234
+ "spec/integration/humanoid/associations_spec.rb",
235
+ "spec/integration/humanoid/attributes_spec.rb",
236
+ "spec/integration/humanoid/commands_spec.rb",
237
+ "spec/integration/humanoid/contexts/enumerable_spec.rb",
238
+ "spec/integration/humanoid/criteria_spec.rb",
239
+ "spec/integration/humanoid/document_spec.rb",
240
+ "spec/integration/humanoid/extensions_spec.rb",
241
+ "spec/integration/humanoid/finders_spec.rb",
242
+ "spec/integration/humanoid/inheritance_spec.rb",
243
+ "spec/integration/humanoid/named_scope_spec.rb",
244
+ "spec/models/address.rb",
245
+ "spec/models/animal.rb",
246
+ "spec/models/comment.rb",
247
+ "spec/models/country_code.rb",
248
+ "spec/models/employer.rb",
249
+ "spec/models/game.rb",
250
+ "spec/models/inheritance.rb",
251
+ "spec/models/location.rb",
252
+ "spec/models/mixed_drink.rb",
253
+ "spec/models/name.rb",
254
+ "spec/models/namespacing.rb",
255
+ "spec/models/patient.rb",
256
+ "spec/models/person.rb",
257
+ "spec/models/pet.rb",
258
+ "spec/models/pet_owner.rb",
259
+ "spec/models/phone.rb",
260
+ "spec/models/post.rb",
261
+ "spec/models/translation.rb",
262
+ "spec/models/vet_visit.rb",
263
+ "spec/spec_helper.rb",
264
+ "spec/unit/mongoid/associations/belongs_to_related_spec.rb",
265
+ "spec/unit/mongoid/associations/belongs_to_spec.rb",
266
+ "spec/unit/mongoid/associations/has_many_related_spec.rb",
267
+ "spec/unit/mongoid/associations/has_many_spec.rb",
268
+ "spec/unit/mongoid/associations/has_one_related_spec.rb",
269
+ "spec/unit/mongoid/associations/has_one_spec.rb",
270
+ "spec/unit/mongoid/associations/options_spec.rb",
271
+ "spec/unit/mongoid/associations_spec.rb",
272
+ "spec/unit/mongoid/attributes_spec.rb",
273
+ "spec/unit/mongoid/callbacks_spec.rb",
274
+ "spec/unit/mongoid/collection_spec.rb",
275
+ "spec/unit/mongoid/collections/cyclic_iterator_spec.rb",
276
+ "spec/unit/mongoid/collections/master_spec.rb",
277
+ "spec/unit/mongoid/collections/mimic_spec.rb",
278
+ "spec/unit/mongoid/collections/slaves_spec.rb",
279
+ "spec/unit/mongoid/commands/create_spec.rb",
280
+ "spec/unit/mongoid/commands/delete_all_spec.rb",
281
+ "spec/unit/mongoid/commands/delete_spec.rb",
282
+ "spec/unit/mongoid/commands/destroy_all_spec.rb",
283
+ "spec/unit/mongoid/commands/destroy_spec.rb",
284
+ "spec/unit/mongoid/commands/save_spec.rb",
285
+ "spec/unit/mongoid/commands_spec.rb",
286
+ "spec/unit/mongoid/config_spec.rb",
287
+ "spec/unit/mongoid/contexts/enumerable_spec.rb",
288
+ "spec/unit/mongoid/contexts/mongo_spec.rb",
289
+ "spec/unit/mongoid/contexts_spec.rb",
290
+ "spec/unit/mongoid/criteria_spec.rb",
291
+ "spec/unit/mongoid/criterion/complex_spec.rb",
292
+ "spec/unit/mongoid/criterion/exclusion_spec.rb",
293
+ "spec/unit/mongoid/criterion/inclusion_spec.rb",
294
+ "spec/unit/mongoid/criterion/optional_spec.rb",
295
+ "spec/unit/mongoid/cursor_spec.rb",
296
+ "spec/unit/mongoid/document_spec.rb",
297
+ "spec/unit/mongoid/enslavement_spec.rb",
298
+ "spec/unit/mongoid/errors_spec.rb",
299
+ "spec/unit/mongoid/extensions/array/accessors_spec.rb",
300
+ "spec/unit/mongoid/extensions/array/assimilation_spec.rb",
301
+ "spec/unit/mongoid/extensions/array/conversions_spec.rb",
302
+ "spec/unit/mongoid/extensions/array/parentization_spec.rb",
303
+ "spec/unit/mongoid/extensions/boolean/conversions_spec.rb",
304
+ "spec/unit/mongoid/extensions/date/conversions_spec.rb",
305
+ "spec/unit/mongoid/extensions/datetime/conversions_spec.rb",
306
+ "spec/unit/mongoid/extensions/float/conversions_spec.rb",
307
+ "spec/unit/mongoid/extensions/hash/accessors_spec.rb",
308
+ "spec/unit/mongoid/extensions/hash/assimilation_spec.rb",
309
+ "spec/unit/mongoid/extensions/hash/conversions_spec.rb",
310
+ "spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb",
311
+ "spec/unit/mongoid/extensions/hash/scoping_spec.rb",
312
+ "spec/unit/mongoid/extensions/integer/conversions_spec.rb",
313
+ "spec/unit/mongoid/extensions/nil/assimilation_spec.rb",
314
+ "spec/unit/mongoid/extensions/object/conversions_spec.rb",
315
+ "spec/unit/mongoid/extensions/proc/scoping_spec.rb",
316
+ "spec/unit/mongoid/extensions/string/conversions_spec.rb",
317
+ "spec/unit/mongoid/extensions/string/inflections_spec.rb",
318
+ "spec/unit/mongoid/extensions/symbol/inflections_spec.rb",
319
+ "spec/unit/mongoid/extensions/time/conversions_spec.rb",
320
+ "spec/unit/mongoid/factory_spec.rb",
321
+ "spec/unit/mongoid/field_spec.rb",
322
+ "spec/unit/mongoid/fields_spec.rb",
323
+ "spec/unit/mongoid/finders_spec.rb",
324
+ "spec/unit/mongoid/identity_spec.rb",
325
+ "spec/unit/mongoid/indexes_spec.rb",
326
+ "spec/unit/mongoid/matchers/all_spec.rb",
327
+ "spec/unit/mongoid/matchers/default_spec.rb",
328
+ "spec/unit/mongoid/matchers/exists_spec.rb",
329
+ "spec/unit/mongoid/matchers/gt_spec.rb",
330
+ "spec/unit/mongoid/matchers/gte_spec.rb",
331
+ "spec/unit/mongoid/matchers/in_spec.rb",
332
+ "spec/unit/mongoid/matchers/lt_spec.rb",
333
+ "spec/unit/mongoid/matchers/lte_spec.rb",
334
+ "spec/unit/mongoid/matchers/ne_spec.rb",
335
+ "spec/unit/mongoid/matchers/nin_spec.rb",
336
+ "spec/unit/mongoid/matchers/size_spec.rb",
337
+ "spec/unit/mongoid/matchers_spec.rb",
338
+ "spec/unit/mongoid/memoization_spec.rb",
339
+ "spec/unit/mongoid/named_scope_spec.rb",
340
+ "spec/unit/mongoid/scope_spec.rb",
341
+ "spec/unit/mongoid/timestamps_spec.rb",
342
+ "spec/unit/mongoid/versioning_spec.rb",
343
+ "spec/unit/mongoid_spec.rb"
344
+ ]
345
+
346
+ if s.respond_to? :specification_version then
347
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
348
+ s.specification_version = 3
349
+
350
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
351
+ s.add_runtime_dependency(%q<activesupport>, ["<= 2.3.5"])
352
+ s.add_runtime_dependency(%q<mongo>, [">= 0.18.3"])
353
+ s.add_runtime_dependency(%q<durran-validatable>, [">= 2.0.1"])
354
+ s.add_runtime_dependency(%q<will_paginate>, ["< 3.0.pre"])
355
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
356
+ s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
357
+ else
358
+ s.add_dependency(%q<activesupport>, ["<= 2.3.5"])
359
+ s.add_dependency(%q<mongo>, [">= 0.18.3"])
360
+ s.add_dependency(%q<durran-validatable>, [">= 2.0.1"])
361
+ s.add_dependency(%q<will_paginate>, ["< 3.0.pre"])
362
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
363
+ s.add_dependency(%q<mocha>, [">= 0.9.8"])
364
+ end
365
+ else
366
+ s.add_dependency(%q<activesupport>, ["<= 2.3.5"])
367
+ s.add_dependency(%q<mongo>, [">= 0.18.3"])
368
+ s.add_dependency(%q<durran-validatable>, [">= 2.0.1"])
369
+ s.add_dependency(%q<will_paginate>, ["< 3.0.pre"])
370
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
371
+ s.add_dependency(%q<mocha>, [">= 0.9.8"])
372
+ end
373
+ end
374
+
@@ -0,0 +1,111 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) 2009 Durran Jordan
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ require "rubygems"
23
+
24
+ gem "activesupport", ">= 2.2.2", "<3.0.pre"
25
+ gem "mongo", ">= 0.18.3"
26
+ gem "durran-validatable", ">= 2.0.1"
27
+ gem "will_paginate", ">= 2.3.11", "<3.0.pre"
28
+
29
+ require "delegate"
30
+ require "observer"
31
+ require "singleton"
32
+ require "time"
33
+ require "validatable"
34
+ require "active_support/callbacks"
35
+ require "active_support/core_ext"
36
+ require "active_support/inflector"
37
+ require "active_support/time_with_zone"
38
+ require "will_paginate/collection"
39
+ require "mongo"
40
+ require "humanoid/associations"
41
+ require "humanoid/associations/options"
42
+ require "humanoid/attributes"
43
+ require "humanoid/callbacks"
44
+ require "humanoid/collection"
45
+ require "humanoid/commands"
46
+ require "humanoid/config"
47
+ require "humanoid/contexts"
48
+ require "humanoid/criteria"
49
+ require "humanoid/cursor"
50
+ require "humanoid/enslavement"
51
+ require "humanoid/extensions"
52
+ require "humanoid/errors"
53
+ require "humanoid/factory"
54
+ require "humanoid/field"
55
+ require "humanoid/fields"
56
+ require "humanoid/finders"
57
+ require "humanoid/identity"
58
+ require "humanoid/indexes"
59
+ require "humanoid/matchers"
60
+ require "humanoid/memoization"
61
+ require "humanoid/named_scope"
62
+ require "humanoid/scope"
63
+ require "humanoid/timestamps"
64
+ require "humanoid/versioning"
65
+ require "humanoid/components"
66
+ require "humanoid/document"
67
+
68
+ module Humanoid #:nodoc
69
+
70
+ class << self
71
+
72
+ # Sets the Humanoid configuration options. Best used by passing a block.
73
+ #
74
+ # Example:
75
+ #
76
+ # Humanoid.configure do |config|
77
+ # name = "humanoid_test"
78
+ # host = "localhost"
79
+ # config.allow_dynamic_fields = false
80
+ # config.master = Mongo::Connection.new.db(name)
81
+ # config.slaves = [
82
+ # Mongo::Connection.new(host, 27018, :slave_ok => true).db(name),
83
+ # Mongo::Connection.new(host, 27019, :slave_ok => true).db(name)
84
+ # ]
85
+ # end
86
+ #
87
+ # Returns:
88
+ #
89
+ # The Humanoid +Config+ singleton instance.
90
+ def configure
91
+ config = Config.instance
92
+ block_given? ? yield(config) : config
93
+ end
94
+
95
+ alias :config :configure
96
+ end
97
+
98
+ # Take all the public instance methods from the Config singleton and allow
99
+ # them to be accessed through the Humanoid module directly.
100
+ #
101
+ # Example:
102
+ #
103
+ # <tt>Humanoid.database = Mongo::Connection.new.db("test")</tt>
104
+ Config.public_instance_methods(false).each do |name|
105
+ (class << self; self; end).class_eval <<-EOT
106
+ def #{name}(*args)
107
+ configure.send("#{name}", *args)
108
+ end
109
+ EOT
110
+ end
111
+ end