mongo_doc 0.6.19 → 0.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongo_doc (0.6.19)
4
+ mongo_doc (0.6.20)
5
5
  activemodel (>= 3.0.0.beta.4)
6
6
  activesupport (>= 3.0.0.beta.4)
7
7
  bson (>= 1.0.0)
data/README.textile CHANGED
@@ -1,6 +1,6 @@
1
1
  h1. MongoDoc
2
2
 
3
- Version: 0.6.19 2010/08/15
3
+ Version: 0.6.20 2010/08/18
4
4
 
5
5
  h2. Notes
6
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.19
1
+ 0.6.20
@@ -1,4 +1,5 @@
1
1
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..'))
2
3
  require 'cucumber'
3
4
  require 'rspec/expectations'
4
5
  require 'spec/bson_matchers'
@@ -21,7 +21,9 @@ module MongoDoc
21
21
  end
22
22
 
23
23
  class CriteriaProxy
24
- undef id
24
+ if RUBY_VERSION.starts_with?('1.8')
25
+ undef id
26
+ end
25
27
 
26
28
  attr_accessor :criteria, :klass, :parent_scope
27
29
 
data/lib/mongo_doc.rb CHANGED
@@ -3,7 +3,7 @@ require 'active_support'
3
3
  require 'active_support/core_ext'
4
4
 
5
5
  module MongoDoc
6
- VERSION = '0.6.19'
6
+ VERSION = '0.6.20'
7
7
  end
8
8
 
9
9
  require 'mongo_doc/connection'
data/mongo_doc.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongo_doc}
8
- s.version = "0.6.19"
8
+ s.version = "0.6.20"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Les Hill"]
12
- s.date = %q{2010-08-15}
12
+ s.date = %q{2010-08-18}
13
13
  s.description = %q{ODM for MongoDB}
14
14
  s.email = %q{leshill@gmail.com}
15
15
  s.extra_rdoc_files = [
data/spec/bson_spec.rb CHANGED
@@ -157,7 +157,7 @@ describe "BSON for Mongo (BSON)" do
157
157
  attr_accessor :value
158
158
  end
159
159
 
160
- class Complex
160
+ class Contained
161
161
  attr_accessor :array_of_simple
162
162
  end
163
163
 
@@ -168,7 +168,7 @@ describe "BSON for Mongo (BSON)" do
168
168
  @value2 = 'value2'
169
169
  @simple2 = Simple.new
170
170
  @simple2.value = @value2
171
- @complex = Complex.new
171
+ @complex = Contained.new
172
172
  @complex.array_of_simple = [@simple1, @simple2]
173
173
  end
174
174
 
@@ -177,15 +177,15 @@ describe "BSON for Mongo (BSON)" do
177
177
  end
178
178
 
179
179
  it "renders a json representation of an object with embedded objects" do
180
- @complex.to_bson.should be_bson_eql({MongoDoc::BSON::CLASS_KEY => Complex.name, "array_of_simple" => [@simple1.to_bson, @simple2.to_bson]})
180
+ @complex.to_bson.should be_bson_eql({MongoDoc::BSON::CLASS_KEY => Contained.name, "array_of_simple" => [@simple1.to_bson, @simple2.to_bson]})
181
181
  end
182
182
 
183
183
  it "ignores a class hash when the :raw_json option is used" do
184
- Complex.bson_create(@complex.to_bson.except(MongoDoc::BSON::CLASS_KEY), :raw_json => true).array_of_simple.first.should == @simple1.to_bson
184
+ Contained.bson_create(@complex.to_bson.except(MongoDoc::BSON::CLASS_KEY), :raw_json => true).array_of_simple.first.should == @simple1.to_bson
185
185
  end
186
186
 
187
187
  it "roundtrips the object" do
188
- MongoDoc::BSON.decode(@complex.to_bson).should be_kind_of(Complex)
188
+ MongoDoc::BSON.decode(@complex.to_bson).should be_kind_of(Contained)
189
189
  end
190
190
 
191
191
  it "allows for embedded arrays of objects" do
@@ -424,19 +424,19 @@ describe "MongoDoc::Document" do
424
424
  end
425
425
 
426
426
  context "misc class methods" do
427
- class ClassMethods
427
+ class MiscClassMethods
428
428
  include MongoDoc::Document
429
429
  end
430
430
 
431
431
  it ".collection_name returns the name of the collection for this class" do
432
- ClassMethods.collection_name.should == ClassMethods.to_s.tableize.gsub('/', '.')
432
+ MiscClassMethods.collection_name.should == MiscClassMethods.to_s.tableize.gsub('/', '.')
433
433
  end
434
434
 
435
435
  it ".collection returns a wrapped MongoDoc::Collection" do
436
436
  db = stub('db')
437
- db.should_receive(:collection).with(ClassMethods.to_s.tableize.gsub('/', '.'))
437
+ db.should_receive(:collection).with(MiscClassMethods.to_s.tableize.gsub('/', '.'))
438
438
  MongoDoc::Connection.should_receive(:database).and_return(db)
439
- MongoDoc::Collection.should === ClassMethods.collection
439
+ MongoDoc::Collection.should === MiscClassMethods.collection
440
440
  end
441
441
  end
442
442
 
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_doc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 33
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 6
9
- - 19
10
- version: 0.6.19
8
+ - 20
9
+ version: 0.6.20
11
10
  platform: ruby
12
11
  authors:
13
12
  - Les Hill
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-08-15 00:00:00 -04:00
17
+ date: 2010-08-18 00:00:00 -04:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 62196427
30
28
  segments:
31
29
  - 3
32
30
  - 0
@@ -44,7 +42,6 @@ dependencies:
44
42
  requirements:
45
43
  - - ">="
46
44
  - !ruby/object:Gem::Version
47
- hash: 62196427
48
45
  segments:
49
46
  - 3
50
47
  - 0
@@ -62,7 +59,6 @@ dependencies:
62
59
  requirements:
63
60
  - - ">="
64
61
  - !ruby/object:Gem::Version
65
- hash: 23
66
62
  segments:
67
63
  - 1
68
64
  - 0
@@ -78,7 +74,6 @@ dependencies:
78
74
  requirements:
79
75
  - - ">="
80
76
  - !ruby/object:Gem::Version
81
- hash: 23
82
77
  segments:
83
78
  - 1
84
79
  - 0
@@ -94,7 +89,6 @@ dependencies:
94
89
  requirements:
95
90
  - - ">="
96
91
  - !ruby/object:Gem::Version
97
- hash: 23
98
92
  segments:
99
93
  - 1
100
94
  - 0
@@ -110,7 +104,6 @@ dependencies:
110
104
  requirements:
111
105
  - - ">="
112
106
  - !ruby/object:Gem::Version
113
- hash: 63
114
107
  segments:
115
108
  - 0
116
109
  - 3
@@ -126,7 +119,6 @@ dependencies:
126
119
  requirements:
127
120
  - - ">="
128
121
  - !ruby/object:Gem::Version
129
- hash: 53
130
122
  segments:
131
123
  - 0
132
124
  - 8
@@ -142,7 +134,6 @@ dependencies:
142
134
  requirements:
143
135
  - - ">="
144
136
  - !ruby/object:Gem::Version
145
- hash: 7
146
137
  segments:
147
138
  - 1
148
139
  - 4
@@ -158,7 +149,6 @@ dependencies:
158
149
  requirements:
159
150
  - - ">="
160
151
  - !ruby/object:Gem::Version
161
- hash: 62196423
162
152
  segments:
163
153
  - 2
164
154
  - 0
@@ -355,7 +345,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
355
345
  requirements:
356
346
  - - ">="
357
347
  - !ruby/object:Gem::Version
358
- hash: 3
359
348
  segments:
360
349
  - 0
361
350
  version: "0"
@@ -364,7 +353,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
364
353
  requirements:
365
354
  - - ">="
366
355
  - !ruby/object:Gem::Version
367
- hash: 3
368
356
  segments:
369
357
  - 0
370
358
  version: "0"