mongo_mapper 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,10 @@
2
2
 
3
3
  A Ruby Object Mapper for Mongo.
4
4
 
5
+ == Install
6
+
7
+ $ gem install mongo_mapper
8
+
5
9
  == Note on Patches/Pull Requests
6
10
 
7
11
  * Fork the project.
@@ -10,9 +14,11 @@ A Ruby Object Mapper for Mongo.
10
14
  * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself in another branch so I can ignore when I pull)
11
15
  * Send me a pull request. Bonus points for topic branches.
12
16
 
13
- == Install
17
+ == Development
14
18
 
15
- $ gem install mongo_mapper
19
+ $ gem install bundler (if you don't have it)
20
+ $ bundle install
21
+ $ bundle exec rake
16
22
 
17
23
  == Problems or Questions?
18
24
 
@@ -26,7 +26,7 @@ module MongoMapper
26
26
  end
27
27
 
28
28
  # Active support in rails 3 beta 4 can override to_json after this is loaded,
29
- # at least when run in mongomapper tests. The implementation was changed in master
29
+ # at least when run in mongomapper tests. The implementation was changed in master
30
30
  # some time after this, so not sure whether this is still a problem.
31
31
  #
32
32
  # In rails 2, this isn't a problem however it also solves an issue where
@@ -41,7 +41,7 @@ module MongoMapper
41
41
  load_target
42
42
  target.as_json(*options)
43
43
  end
44
-
44
+
45
45
  def inspect
46
46
  load_target
47
47
  target.inspect
@@ -106,11 +106,7 @@ module MongoMapper
106
106
  protected
107
107
  def method_missing(method, *args, &block)
108
108
  if load_target
109
- if block_given?
110
- target.send(method, *args) { |*block_args| block.call(*block_args) }
111
- else
112
- target.send(method, *args)
113
- end
109
+ target.send(method, *args, &block)
114
110
  end
115
111
  end
116
112
 
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module MongoMapper
3
- Version = '0.8.4'
3
+ Version = '0.8.5'
4
4
  end
@@ -10,7 +10,7 @@ class BinaryTest < Test::Unit::TestCase
10
10
  doc.save
11
11
 
12
12
  doc = doc.reload
13
- doc.contents.to_s.should == BSON::ByteBuffer.new('010101').to_s
13
+ doc.contents.to_s.should == BSON::Binary.new('010101').to_s
14
14
  end
15
15
 
16
16
  context "Saving a document with a blank binary value" do
@@ -1,10 +1,5 @@
1
1
  require 'rubygems'
2
- gem 'activesupport', ENV['ACTIVE_SUPPORT_VERSION']
3
- gem 'json'
4
- gem 'jnunemaker-matchy', '~> 0.4.0'
5
- gem 'shoulda', '~> 2.11'
6
- gem 'timecop', '~> 0.3.5'
7
- gem 'mocha', '~> 0.9.8'
2
+ require 'bundler/setup'
8
3
 
9
4
  $:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
10
5
  require 'mongo_mapper'
@@ -55,7 +50,7 @@ class Test::Unit::TestCase
55
50
  klass.collection.drop_indexes
56
51
  end
57
52
  end
58
-
53
+
59
54
  custom_matcher :be_true do |receiver, matcher, args|
60
55
  matcher.positive_failure_message = "Expected #{receiver} to be true but it wasn't"
61
56
  matcher.negative_failure_message = "Expected #{receiver} not to be true but it was"
@@ -20,12 +20,12 @@ class SupportTest < Test::Unit::TestCase
20
20
  end
21
21
 
22
22
  context "Binary.to_mongo" do
23
- should "convert to byte buffer if not byte buffer" do
24
- Binary.to_mongo('asdfsadasdfs').is_a?(BSON::ByteBuffer).should be_true
23
+ should "convert to binary if not binary" do
24
+ Binary.to_mongo('asdfsadasdfs').is_a?(BSON::Binary).should be_true
25
25
  end
26
26
 
27
- should "be byte buffer if byte buffer" do
28
- Binary.to_mongo(BSON::ByteBuffer.new('asdfsadasdfs')).is_a?(BSON::ByteBuffer).should be_true
27
+ should "be binary if binary" do
28
+ Binary.to_mongo(BSON::Binary.new('asdfsadasdfs')).is_a?(BSON::Binary).should be_true
29
29
  end
30
30
 
31
31
  should "be nil if nil" do
@@ -35,8 +35,8 @@ class SupportTest < Test::Unit::TestCase
35
35
 
36
36
  context "Binary.from_mongo" do
37
37
  should "return value" do
38
- buffer = BSON::ByteBuffer.new('asdfasdfasdf')
39
- Binary.from_mongo(buffer).to_s.should == buffer.to_s
38
+ binary = BSON::Binary.new('asdfasdfasdf')
39
+ Binary.from_mongo(binary).to_s.should == binary.to_s
40
40
  end
41
41
  end
42
42
 
@@ -373,8 +373,4 @@ class SupportTest < Test::Unit::TestCase
373
373
  end
374
374
  end
375
375
  end
376
-
377
- context "BSON::ObjectId.to_json" do
378
-
379
- end
380
376
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_mapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 53
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 4
10
- version: 0.8.4
9
+ - 5
10
+ version: 0.8.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Nunemaker
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-29 00:00:00 -04:00
18
+ date: 2010-10-11 00:00:00 -04:00
19
19
  default_executable: mmconsole
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -58,12 +58,12 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- hash: 25
61
+ hash: 31
62
62
  segments:
63
63
  - 0
64
64
  - 3
65
- - 5
66
- version: 0.3.5
65
+ - 6
66
+ version: 0.3.6
67
67
  type: :runtime
68
68
  version_requirements: *id003
69
69
  - !ruby/object:Gem::Dependency