tpitale-mongo_mapper 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/.gitignore +10 -0
  2. data/LICENSE +20 -0
  3. data/README.rdoc +53 -0
  4. data/Rakefile +55 -0
  5. data/VERSION +1 -0
  6. data/bin/mmconsole +60 -0
  7. data/lib/mongo_mapper/associations/base.rb +110 -0
  8. data/lib/mongo_mapper/associations/belongs_to_polymorphic_proxy.rb +26 -0
  9. data/lib/mongo_mapper/associations/belongs_to_proxy.rb +21 -0
  10. data/lib/mongo_mapper/associations/collection.rb +19 -0
  11. data/lib/mongo_mapper/associations/many_documents_as_proxy.rb +26 -0
  12. data/lib/mongo_mapper/associations/many_documents_proxy.rb +115 -0
  13. data/lib/mongo_mapper/associations/many_embedded_polymorphic_proxy.rb +31 -0
  14. data/lib/mongo_mapper/associations/many_embedded_proxy.rb +54 -0
  15. data/lib/mongo_mapper/associations/many_polymorphic_proxy.rb +11 -0
  16. data/lib/mongo_mapper/associations/proxy.rb +113 -0
  17. data/lib/mongo_mapper/associations.rb +70 -0
  18. data/lib/mongo_mapper/callbacks.rb +109 -0
  19. data/lib/mongo_mapper/dirty.rb +136 -0
  20. data/lib/mongo_mapper/document.rb +472 -0
  21. data/lib/mongo_mapper/dynamic_finder.rb +74 -0
  22. data/lib/mongo_mapper/embedded_document.rb +384 -0
  23. data/lib/mongo_mapper/finder_options.rb +133 -0
  24. data/lib/mongo_mapper/key.rb +36 -0
  25. data/lib/mongo_mapper/observing.rb +50 -0
  26. data/lib/mongo_mapper/pagination.rb +55 -0
  27. data/lib/mongo_mapper/rails_compatibility/document.rb +15 -0
  28. data/lib/mongo_mapper/rails_compatibility/embedded_document.rb +27 -0
  29. data/lib/mongo_mapper/serialization.rb +54 -0
  30. data/lib/mongo_mapper/serializers/json_serializer.rb +92 -0
  31. data/lib/mongo_mapper/support.rb +206 -0
  32. data/lib/mongo_mapper/validations.rb +41 -0
  33. data/lib/mongo_mapper.rb +120 -0
  34. data/mongo_mapper.gemspec +173 -0
  35. data/specs.watchr +32 -0
  36. data/test/NOTE_ON_TESTING +1 -0
  37. data/test/functional/associations/test_belongs_to_polymorphic_proxy.rb +55 -0
  38. data/test/functional/associations/test_belongs_to_proxy.rb +48 -0
  39. data/test/functional/associations/test_many_documents_as_proxy.rb +246 -0
  40. data/test/functional/associations/test_many_documents_proxy.rb +387 -0
  41. data/test/functional/associations/test_many_embedded_polymorphic_proxy.rb +156 -0
  42. data/test/functional/associations/test_many_embedded_proxy.rb +192 -0
  43. data/test/functional/associations/test_many_polymorphic_proxy.rb +339 -0
  44. data/test/functional/test_associations.rb +44 -0
  45. data/test/functional/test_binary.rb +18 -0
  46. data/test/functional/test_callbacks.rb +85 -0
  47. data/test/functional/test_dirty.rb +159 -0
  48. data/test/functional/test_document.rb +1235 -0
  49. data/test/functional/test_embedded_document.rb +135 -0
  50. data/test/functional/test_logger.rb +20 -0
  51. data/test/functional/test_pagination.rb +95 -0
  52. data/test/functional/test_rails_compatibility.rb +25 -0
  53. data/test/functional/test_string_id_compatibility.rb +72 -0
  54. data/test/functional/test_validations.rb +378 -0
  55. data/test/models.rb +271 -0
  56. data/test/support/custom_matchers.rb +55 -0
  57. data/test/support/timing.rb +16 -0
  58. data/test/test_helper.rb +27 -0
  59. data/test/unit/associations/test_base.rb +166 -0
  60. data/test/unit/associations/test_proxy.rb +91 -0
  61. data/test/unit/serializers/test_json_serializer.rb +189 -0
  62. data/test/unit/test_document.rb +204 -0
  63. data/test/unit/test_dynamic_finder.rb +125 -0
  64. data/test/unit/test_embedded_document.rb +718 -0
  65. data/test/unit/test_finder_options.rb +296 -0
  66. data/test/unit/test_key.rb +172 -0
  67. data/test/unit/test_mongo_mapper.rb +65 -0
  68. data/test/unit/test_observing.rb +101 -0
  69. data/test/unit/test_pagination.rb +113 -0
  70. data/test/unit/test_rails_compatibility.rb +49 -0
  71. data/test/unit/test_serializations.rb +52 -0
  72. data/test/unit/test_support.rb +342 -0
  73. data/test/unit/test_time_zones.rb +40 -0
  74. data/test/unit/test_validations.rb +503 -0
  75. metadata +235 -0
@@ -0,0 +1,54 @@
1
+ require 'active_support/json'
2
+
3
+ module MongoMapper #:nodoc:
4
+ module Serialization
5
+ class Serializer #:nodoc:
6
+ attr_reader :options
7
+
8
+ def initialize(record, options={})
9
+ @record, @options = record, options.dup
10
+ end
11
+
12
+ def serializable_key_names
13
+ key_names = @record.attributes.keys
14
+
15
+ if options[:only]
16
+ options.delete(:except)
17
+ key_names = key_names & Array(options[:only]).collect { |n| n.to_s }
18
+ else
19
+ options[:except] = Array(options[:except])
20
+ key_names = key_names - options[:except].collect { |n| n.to_s }
21
+ end
22
+
23
+ key_names
24
+ end
25
+
26
+ def serializable_method_names
27
+ Array(options[:methods]).inject([]) do |method_attributes, name|
28
+ method_attributes << name if @record.respond_to?(name.to_s)
29
+ method_attributes
30
+ end
31
+ end
32
+
33
+ def serializable_names
34
+ serializable_key_names + serializable_method_names
35
+ end
36
+
37
+ def serializable_record
38
+ returning(serializable_record = {}) do
39
+ serializable_names.each { |name| serializable_record[name] = @record.send(name) }
40
+ end
41
+ end
42
+
43
+ def serialize
44
+ # overwrite to implement
45
+ end
46
+
47
+ def to_s(&block)
48
+ serialize(&block)
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ require 'mongo_mapper/serializers/json_serializer'
@@ -0,0 +1,92 @@
1
+ module MongoMapper #:nodoc:
2
+ module Serialization
3
+ def self.included(base)
4
+ base.cattr_accessor :include_root_in_json, :instance_writer => false
5
+ base.extend ClassMethods
6
+ end
7
+
8
+ # Returns a JSON string representing the model. Some configuration is
9
+ # available through +options+.
10
+ #
11
+ # The option <tt>include_root_in_json</tt> controls the top-level behavior of
12
+ # to_json. When it is <tt>true</tt>, to_json will emit a single root node named
13
+ # after the object's type. For example:
14
+ #
15
+ # konata = User.find(1)
16
+ # User.include_root_in_json = true
17
+ # konata.to_json
18
+ # # => { "user": {"id": 1, "name": "Konata Izumi", "age": 16,
19
+ # "created_at": "2006/08/01", "awesome": true} }
20
+ #
21
+ # User.include_root_in_json = false
22
+ # konata.to_json
23
+ # # => {"id": 1, "name": "Konata Izumi", "age": 16,
24
+ # "created_at": "2006/08/01", "awesome": true}
25
+ #
26
+ # The remainder of the examples in this section assume include_root_in_json is set to
27
+ # <tt>false</tt>.
28
+ #
29
+ # Without any +options+, the returned JSON string will include all
30
+ # the model's attributes. For example:
31
+ #
32
+ # konata = User.find(1)
33
+ # konata.to_json
34
+ # # => {"id": 1, "name": "Konata Izumi", "age": 16,
35
+ # "created_at": "2006/08/01", "awesome": true}
36
+ #
37
+ # The <tt>:only</tt> and <tt>:except</tt> options can be used to limit the attributes
38
+ # included, and work similar to the +attributes+ method. For example:
39
+ #
40
+ # konata.to_json(:only => [ :id, :name ])
41
+ # # => {"id": 1, "name": "Konata Izumi"}
42
+ #
43
+ # konata.to_json(:except => [ :id, :created_at, :age ])
44
+ # # => {"name": "Konata Izumi", "awesome": true}
45
+ #
46
+ # To include any methods on the model, use <tt>:methods</tt>.
47
+ #
48
+ # konata.to_json(:methods => :permalink)
49
+ # # => {"id": 1, "name": "Konata Izumi", "age": 16,
50
+ # "created_at": "2006/08/01", "awesome": true,
51
+ # "permalink": "1-konata-izumi"}
52
+ def to_json(options={})
53
+ apply_to_json_defaults(options)
54
+
55
+ if include_root_in_json
56
+ "{#{self.class.json_class_name}: #{JsonSerializer.new(self, options).to_s}}"
57
+ else
58
+ JsonSerializer.new(self, options).to_s
59
+ end
60
+ end
61
+
62
+ def from_json(json)
63
+ self.attributes = ActiveSupport::JSON.decode(json)
64
+ self
65
+ end
66
+
67
+ class JsonSerializer < MongoMapper::Serialization::Serializer #:nodoc:
68
+ def serialize
69
+ serializable_record.to_json
70
+ end
71
+ end
72
+
73
+ module ClassMethods
74
+ def json_class_name
75
+ @json_class_name ||= name.demodulize.underscore.inspect
76
+ end
77
+ end
78
+
79
+ private
80
+ def apply_to_json_defaults(options)
81
+ unless options[:only]
82
+ methods = [options.delete(:methods)].flatten.compact
83
+ methods << :id
84
+ options[:methods] = methods.uniq
85
+ end
86
+
87
+ except = [options.delete(:except)].flatten.compact
88
+ except << :_id
89
+ options[:except] = except
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,206 @@
1
+ require 'set'
2
+
3
+ class Array
4
+ def self.to_mongo(value)
5
+ value = value.respond_to?(:lines) ? value.lines : value
6
+ value.to_a
7
+ end
8
+
9
+ def self.from_mongo(value)
10
+ value || []
11
+ end
12
+ end
13
+
14
+ class Binary
15
+ def self.to_mongo(value)
16
+ if value.is_a?(ByteBuffer)
17
+ value
18
+ else
19
+ value.nil? ? nil : ByteBuffer.new(value)
20
+ end
21
+ end
22
+
23
+ def self.from_mongo(value)
24
+ value
25
+ end
26
+ end
27
+
28
+ class Boolean
29
+ def self.to_mongo(value)
30
+ if value.is_a?(Boolean)
31
+ value
32
+ else
33
+ ['true', 't', '1'].include?(value.to_s.downcase)
34
+ end
35
+ end
36
+
37
+ def self.from_mongo(value)
38
+ !!value
39
+ end
40
+ end
41
+
42
+ class Date
43
+ def self.to_mongo(value)
44
+ date = Date.parse(value.to_s)
45
+ Time.utc(date.year, date.month, date.day)
46
+ rescue
47
+ nil
48
+ end
49
+
50
+ def self.from_mongo(value)
51
+ value.to_date if value.present?
52
+ end
53
+ end
54
+
55
+ class Float
56
+ def self.to_mongo(value)
57
+ value.to_f
58
+ end
59
+ end
60
+
61
+ class Hash
62
+ def self.from_mongo(value)
63
+ HashWithIndifferentAccess.new(value || {})
64
+ end
65
+
66
+ def to_mongo
67
+ self
68
+ end
69
+ end
70
+
71
+ class Integer
72
+ def self.to_mongo(value)
73
+ value_to_i = value.to_i
74
+ if value_to_i == 0
75
+ value.to_s =~ /^(0x|0b)?0+/ ? 0 : nil
76
+ else
77
+ value_to_i
78
+ end
79
+ end
80
+ end
81
+
82
+ class NilClass
83
+ def to_mongo(value)
84
+ value
85
+ end
86
+
87
+ def from_mongo(value)
88
+ value
89
+ end
90
+ end
91
+
92
+ class Object
93
+ # The hidden singleton lurks behind everyone
94
+ def metaclass
95
+ class << self; self end
96
+ end
97
+
98
+ def meta_eval(&blk)
99
+ metaclass.instance_eval(&blk)
100
+ end
101
+
102
+ # Adds methods to a metaclass
103
+ def meta_def(name, &blk)
104
+ meta_eval { define_method(name, &blk) }
105
+ end
106
+
107
+ # Defines an instance method within a class
108
+ def class_def(name, &blk)
109
+ class_eval { define_method(name, &blk) }
110
+ end
111
+
112
+ def self.to_mongo(value)
113
+ value
114
+ end
115
+
116
+ def self.from_mongo(value)
117
+ value
118
+ end
119
+ end
120
+
121
+ class ObjectId
122
+ def self.to_mongo(value)
123
+ if value.nil?
124
+ nil
125
+ elsif value.is_a?(Mongo::ObjectID)
126
+ value
127
+ else
128
+ Mongo::ObjectID.from_string(value.to_s)
129
+ end
130
+ end
131
+
132
+ def self.from_mongo(value)
133
+ value
134
+ end
135
+ end
136
+
137
+ class Set
138
+ def self.to_mongo(value)
139
+ value.to_a
140
+ end
141
+
142
+ def self.from_mongo(value)
143
+ Set.new(value || [])
144
+ end
145
+ end
146
+
147
+ class String
148
+ def self.to_mongo(value)
149
+ value.nil? ? nil : value.to_s
150
+ end
151
+
152
+ def self.from_mongo(value)
153
+ value.nil? ? nil : value.to_s
154
+ end
155
+ end
156
+
157
+ if !defined?(DataMapper)
158
+ class Symbol
159
+ %w{gt lt gte lte ne in nin mod size where exists}.each do |operator|
160
+ define_method operator do
161
+ MongoMapper::FinderOperator.new(self, "$#{operator}")
162
+ end
163
+ end
164
+ end
165
+ else
166
+ # Compatability with DataMapper
167
+ class DataMapper::Query::Operator
168
+ def to_criteria(value)
169
+ {@target => {"$#{@operator}" => value}}
170
+ end
171
+ end
172
+
173
+ class Symbol
174
+ %w{ne nin mod size where exists}.each do |operator|
175
+ define_method operator do
176
+ DataMapper::Query::Operator.new(self, operator.to_sym)
177
+ end
178
+ end
179
+ end
180
+ end
181
+
182
+ class Time
183
+ def self.to_mongo(value)
184
+ if value.nil? || value == ''
185
+ nil
186
+ else
187
+ time = MongoMapper.time_class.parse(value.to_s)
188
+ time && time.utc
189
+ end
190
+ end
191
+
192
+ def self.from_mongo(value)
193
+ if MongoMapper.use_time_zone? && value.present?
194
+ value.in_time_zone(Time.zone)
195
+ else
196
+ value
197
+ end
198
+ end
199
+ end
200
+
201
+ # TODO: Remove when patch accepted into driver
202
+ class Mongo::ObjectID
203
+ def to_json(options = nil)
204
+ %Q("#{to_s}")
205
+ end
206
+ end
@@ -0,0 +1,41 @@
1
+ module MongoMapper
2
+ module Validations
3
+ module Macros
4
+ def validates_uniqueness_of(*args)
5
+ add_validations(args, MongoMapper::Validations::ValidatesUniquenessOf)
6
+ end
7
+ end
8
+
9
+ class ValidatesUniquenessOf < Validatable::ValidationBase
10
+ option :scope, :case_sensitive
11
+ default :case_sensitive => true
12
+
13
+ def valid?(instance)
14
+ value = instance[attribute]
15
+ return true if allow_blank && value.blank?
16
+ base_conditions = case_sensitive ? {self.attribute => value} : {}
17
+ doc = instance.class.first(base_conditions.merge(scope_conditions(instance)).merge(where_conditions(instance)))
18
+ doc.nil? || instance._id == doc._id
19
+ end
20
+
21
+ def message(instance)
22
+ super || "has already been taken"
23
+ end
24
+
25
+ def scope_conditions(instance)
26
+ return {} unless scope
27
+ Array(scope).inject({}) do |conditions, key|
28
+ conditions.merge(key => instance[key])
29
+ end
30
+ end
31
+
32
+ def where_conditions(instance)
33
+ conditions = {}
34
+ unless case_sensitive
35
+ conditions.merge!({'$where' => "this.#{attribute}.toLowerCase() == '#{instance[attribute].to_s.downcase}'"})
36
+ end
37
+ conditions
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,120 @@
1
+ # if Gem is defined i'll assume you are using rubygems and lock specific versions
2
+ # call me crazy but a plain old require will just get the latest version you have installed
3
+ # so i want to make sure that if you are using gems you do in fact have the correct versions
4
+ # if there is a better way to do this, please enlighten me!
5
+ if self.class.const_defined?(:Gem)
6
+ gem 'activesupport', '>= 2.3'
7
+ gem 'mongo', '0.18.1'
8
+ gem 'jnunemaker-validatable', '1.8.1'
9
+ end
10
+
11
+ require 'active_support'
12
+ require 'mongo'
13
+ require 'validatable'
14
+
15
+ module MongoMapper
16
+ # generic MM error
17
+ class MongoMapperError < StandardError; end
18
+
19
+ # raised when key expected to exist but not found
20
+ class KeyNotFound < MongoMapperError; end
21
+
22
+ # raised when document expected but not found
23
+ class DocumentNotFound < MongoMapperError; end
24
+
25
+ # raised when document not valid and using !
26
+ class DocumentNotValid < MongoMapperError
27
+ def initialize(document)
28
+ super("Validation failed: #{document.errors.full_messages.join(", ")}")
29
+ end
30
+ end
31
+
32
+ # @api public
33
+ def self.connection
34
+ @@connection ||= Mongo::Connection.new
35
+ end
36
+
37
+ # @api public
38
+ def self.connection=(new_connection)
39
+ @@connection = new_connection
40
+ end
41
+
42
+ # @api public
43
+ def self.logger
44
+ connection.logger
45
+ end
46
+
47
+ # @api public
48
+ def self.database=(name)
49
+ @@database = nil
50
+ @@database_name = name
51
+ end
52
+
53
+ # @api public
54
+ def self.database
55
+ if @@database_name.blank?
56
+ raise 'You forgot to set the default database name: MongoMapper.database = "foobar"'
57
+ end
58
+
59
+ @@database ||= MongoMapper.connection.db(@@database_name)
60
+ end
61
+
62
+ # @api private
63
+ def self.ensured_indexes
64
+ @@ensured_indexes ||= []
65
+ end
66
+
67
+ # @api private
68
+ def self.ensure_index(klass, keys, options={})
69
+ ensured_indexes << {:klass => klass, :keys => keys, :options => options}
70
+ end
71
+
72
+ # @api public
73
+ def self.ensure_indexes!
74
+ ensured_indexes.each do |index|
75
+ unique = index[:options].delete(:unique)
76
+ index[:klass].collection.create_index(index[:keys], unique)
77
+ end
78
+ end
79
+
80
+ # @api private
81
+ def self.use_time_zone?
82
+ Time.respond_to?(:zone) && Time.zone ? true : false
83
+ end
84
+
85
+ # @api private
86
+ def self.time_class
87
+ use_time_zone? ? Time.zone : Time
88
+ end
89
+
90
+ # @api private
91
+ def self.normalize_object_id(value)
92
+ value.is_a?(String) ? Mongo::ObjectID.from_string(value) : value
93
+ end
94
+ end
95
+
96
+ require 'mongo_mapper/support'
97
+ require 'mongo_mapper/callbacks'
98
+ require 'mongo_mapper/finder_options'
99
+ require 'mongo_mapper/dirty'
100
+ require 'mongo_mapper/dynamic_finder'
101
+ require 'mongo_mapper/key'
102
+ require 'mongo_mapper/observing'
103
+ require 'mongo_mapper/pagination'
104
+ require 'mongo_mapper/serialization'
105
+ require 'mongo_mapper/validations'
106
+ require 'mongo_mapper/rails_compatibility/document'
107
+ require 'mongo_mapper/rails_compatibility/embedded_document'
108
+ require 'mongo_mapper/embedded_document'
109
+ require 'mongo_mapper/document'
110
+ require 'mongo_mapper/associations'
111
+ require 'mongo_mapper/associations/base'
112
+ require 'mongo_mapper/associations/proxy'
113
+ require 'mongo_mapper/associations/collection'
114
+ require 'mongo_mapper/associations/many_documents_proxy'
115
+ require 'mongo_mapper/associations/belongs_to_proxy'
116
+ require 'mongo_mapper/associations/belongs_to_polymorphic_proxy'
117
+ require 'mongo_mapper/associations/many_polymorphic_proxy'
118
+ require 'mongo_mapper/associations/many_embedded_proxy'
119
+ require 'mongo_mapper/associations/many_embedded_polymorphic_proxy'
120
+ require 'mongo_mapper/associations/many_documents_as_proxy'
@@ -0,0 +1,173 @@
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{mongo_mapper}
8
+ s.version = "0.6.8"
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-12-15}
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
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "bin/mmconsole",
27
+ "lib/mongo_mapper.rb",
28
+ "lib/mongo_mapper/associations.rb",
29
+ "lib/mongo_mapper/associations/base.rb",
30
+ "lib/mongo_mapper/associations/belongs_to_polymorphic_proxy.rb",
31
+ "lib/mongo_mapper/associations/belongs_to_proxy.rb",
32
+ "lib/mongo_mapper/associations/collection.rb",
33
+ "lib/mongo_mapper/associations/many_documents_as_proxy.rb",
34
+ "lib/mongo_mapper/associations/many_documents_proxy.rb",
35
+ "lib/mongo_mapper/associations/many_embedded_polymorphic_proxy.rb",
36
+ "lib/mongo_mapper/associations/many_embedded_proxy.rb",
37
+ "lib/mongo_mapper/associations/many_polymorphic_proxy.rb",
38
+ "lib/mongo_mapper/associations/proxy.rb",
39
+ "lib/mongo_mapper/callbacks.rb",
40
+ "lib/mongo_mapper/dirty.rb",
41
+ "lib/mongo_mapper/document.rb",
42
+ "lib/mongo_mapper/dynamic_finder.rb",
43
+ "lib/mongo_mapper/embedded_document.rb",
44
+ "lib/mongo_mapper/finder_options.rb",
45
+ "lib/mongo_mapper/key.rb",
46
+ "lib/mongo_mapper/observing.rb",
47
+ "lib/mongo_mapper/pagination.rb",
48
+ "lib/mongo_mapper/rails_compatibility/document.rb",
49
+ "lib/mongo_mapper/rails_compatibility/embedded_document.rb",
50
+ "lib/mongo_mapper/serialization.rb",
51
+ "lib/mongo_mapper/serializers/json_serializer.rb",
52
+ "lib/mongo_mapper/support.rb",
53
+ "lib/mongo_mapper/validations.rb",
54
+ "mongo_mapper.gemspec",
55
+ "specs.watchr",
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_documents_proxy.rb",
61
+ "test/functional/associations/test_many_embedded_polymorphic_proxy.rb",
62
+ "test/functional/associations/test_many_embedded_proxy.rb",
63
+ "test/functional/associations/test_many_polymorphic_proxy.rb",
64
+ "test/functional/test_associations.rb",
65
+ "test/functional/test_binary.rb",
66
+ "test/functional/test_callbacks.rb",
67
+ "test/functional/test_dirty.rb",
68
+ "test/functional/test_document.rb",
69
+ "test/functional/test_embedded_document.rb",
70
+ "test/functional/test_logger.rb",
71
+ "test/functional/test_pagination.rb",
72
+ "test/functional/test_rails_compatibility.rb",
73
+ "test/functional/test_string_id_compatibility.rb",
74
+ "test/functional/test_validations.rb",
75
+ "test/models.rb",
76
+ "test/support/custom_matchers.rb",
77
+ "test/support/timing.rb",
78
+ "test/test_helper.rb",
79
+ "test/unit/associations/test_base.rb",
80
+ "test/unit/associations/test_proxy.rb",
81
+ "test/unit/serializers/test_json_serializer.rb",
82
+ "test/unit/test_document.rb",
83
+ "test/unit/test_dynamic_finder.rb",
84
+ "test/unit/test_embedded_document.rb",
85
+ "test/unit/test_finder_options.rb",
86
+ "test/unit/test_key.rb",
87
+ "test/unit/test_mongo_mapper.rb",
88
+ "test/unit/test_observing.rb",
89
+ "test/unit/test_pagination.rb",
90
+ "test/unit/test_rails_compatibility.rb",
91
+ "test/unit/test_serializations.rb",
92
+ "test/unit/test_support.rb",
93
+ "test/unit/test_time_zones.rb",
94
+ "test/unit/test_validations.rb"
95
+ ]
96
+ s.homepage = %q{http://github.com/jnunemaker/mongomapper}
97
+ s.rdoc_options = ["--charset=UTF-8"]
98
+ s.require_paths = ["lib"]
99
+ s.rubygems_version = %q{1.3.5}
100
+ s.summary = %q{Awesome gem for modeling your domain and storing it in mongo}
101
+ s.test_files = [
102
+ "test/functional/associations/test_belongs_to_polymorphic_proxy.rb",
103
+ "test/functional/associations/test_belongs_to_proxy.rb",
104
+ "test/functional/associations/test_many_documents_as_proxy.rb",
105
+ "test/functional/associations/test_many_documents_proxy.rb",
106
+ "test/functional/associations/test_many_embedded_polymorphic_proxy.rb",
107
+ "test/functional/associations/test_many_embedded_proxy.rb",
108
+ "test/functional/associations/test_many_polymorphic_proxy.rb",
109
+ "test/functional/test_associations.rb",
110
+ "test/functional/test_binary.rb",
111
+ "test/functional/test_callbacks.rb",
112
+ "test/functional/test_dirty.rb",
113
+ "test/functional/test_document.rb",
114
+ "test/functional/test_embedded_document.rb",
115
+ "test/functional/test_logger.rb",
116
+ "test/functional/test_pagination.rb",
117
+ "test/functional/test_rails_compatibility.rb",
118
+ "test/functional/test_string_id_compatibility.rb",
119
+ "test/functional/test_validations.rb",
120
+ "test/models.rb",
121
+ "test/support/custom_matchers.rb",
122
+ "test/support/timing.rb",
123
+ "test/test_helper.rb",
124
+ "test/unit/associations/test_base.rb",
125
+ "test/unit/associations/test_proxy.rb",
126
+ "test/unit/serializers/test_json_serializer.rb",
127
+ "test/unit/test_document.rb",
128
+ "test/unit/test_dynamic_finder.rb",
129
+ "test/unit/test_embedded_document.rb",
130
+ "test/unit/test_finder_options.rb",
131
+ "test/unit/test_key.rb",
132
+ "test/unit/test_mongo_mapper.rb",
133
+ "test/unit/test_observing.rb",
134
+ "test/unit/test_pagination.rb",
135
+ "test/unit/test_rails_compatibility.rb",
136
+ "test/unit/test_serializations.rb",
137
+ "test/unit/test_support.rb",
138
+ "test/unit/test_time_zones.rb",
139
+ "test/unit/test_validations.rb"
140
+ ]
141
+
142
+ if s.respond_to? :specification_version then
143
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
144
+ s.specification_version = 3
145
+
146
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
147
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3"])
148
+ s.add_runtime_dependency(%q<mongo>, ["= 0.18.1"])
149
+ s.add_runtime_dependency(%q<jnunemaker-validatable>, ["= 1.8.1"])
150
+ s.add_development_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
151
+ s.add_development_dependency(%q<shoulda>, ["= 2.10.2"])
152
+ s.add_development_dependency(%q<timecop>, ["= 0.3.1"])
153
+ s.add_development_dependency(%q<mocha>, ["= 0.9.8"])
154
+ else
155
+ s.add_dependency(%q<activesupport>, [">= 2.3"])
156
+ s.add_dependency(%q<mongo>, ["= 0.18.1"])
157
+ s.add_dependency(%q<jnunemaker-validatable>, ["= 1.8.1"])
158
+ s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
159
+ s.add_dependency(%q<shoulda>, ["= 2.10.2"])
160
+ s.add_dependency(%q<timecop>, ["= 0.3.1"])
161
+ s.add_dependency(%q<mocha>, ["= 0.9.8"])
162
+ end
163
+ else
164
+ s.add_dependency(%q<activesupport>, [">= 2.3"])
165
+ s.add_dependency(%q<mongo>, ["= 0.18.1"])
166
+ s.add_dependency(%q<jnunemaker-validatable>, ["= 1.8.1"])
167
+ s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
168
+ s.add_dependency(%q<shoulda>, ["= 2.10.2"])
169
+ s.add_dependency(%q<timecop>, ["= 0.3.1"])
170
+ s.add_dependency(%q<mocha>, ["= 0.9.8"])
171
+ end
172
+ end
173
+