bson 1.4.1-jruby → 1.5.0-jruby

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bson might be problematic. Click here for more details.

data/lib/bson.rb CHANGED
@@ -18,10 +18,10 @@
18
18
 
19
19
  $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
20
20
 
21
- MINIMUM_BSON_EXT_VERSION = "1.4.1"
21
+ MINIMUM_BSON_EXT_VERSION = "1.5.0"
22
22
 
23
23
  module BSON
24
- VERSION = "1.4.1"
24
+ VERSION = "1.5.0"
25
25
 
26
26
  if defined? Mongo::DEFAULT_MAX_BSON_SIZE
27
27
  DEFAULT_MAX_BSON_SIZE = Mongo::DEFAULT_MAX_BSON_SIZE
@@ -130,11 +130,12 @@ module BSON
130
130
  end
131
131
 
132
132
  def delete_if(&block)
133
- self.each do |k,v|
134
- if yield k, v
135
- delete(k)
133
+ keys.each do |key|
134
+ if yield key, self[key]
135
+ delete(key)
136
136
  end
137
137
  end
138
+ self
138
139
  end
139
140
 
140
141
  def reject(&block)
@@ -2,14 +2,12 @@
2
2
  require './test/bson/test_helper'
3
3
 
4
4
  class BinaryTest < Test::Unit::TestCase
5
- context "Inspecting" do
6
- setup do
7
- @data = ("THIS IS BINARY " * 50).unpack("c*")
8
- end
5
+ def setup
6
+ @data = ("THIS IS BINARY " * 50).unpack("c*")
7
+ end
9
8
 
10
- should "not display actual data" do
11
- binary = BSON::Binary.new(@data)
12
- assert_equal "<BSON::Binary:#{binary.object_id}>", binary.inspect
13
- end
9
+ def test_do_not_display_binary_data
10
+ binary = BSON::Binary.new(@data)
11
+ assert_equal "<BSON::Binary:#{binary.object_id}>", binary.inspect
14
12
  end
15
13
  end
@@ -9,6 +9,7 @@ end
9
9
  require 'bigdecimal'
10
10
 
11
11
  begin
12
+ require 'date'
12
13
  require 'tzinfo'
13
14
  require 'active_support/core_ext'
14
15
  Time.zone = "Pacific Time (US & Canada)"
@@ -212,6 +212,8 @@ class OrderedHashTest < Test::Unit::TestCase
212
212
  assert @oh.keys.include?('z')
213
213
  @oh.delete_if { |k,v| k == 'z' }
214
214
  assert !@oh.keys.include?('z')
215
+ @oh.delete_if { |k, v| v > 0 }
216
+ assert @oh.keys.empty?
215
217
  end
216
218
 
217
219
  def test_reject
@@ -10,23 +10,6 @@ def silently
10
10
  result
11
11
  end
12
12
 
13
- begin
14
- require 'rubygems' if RUBY_VERSION < "1.9.0" && !ENV['C_EXT']
15
- silently { require 'shoulda' }
16
- silently { require 'mocha' }
17
- rescue LoadError
18
- puts <<MSG
19
-
20
- This test suite requires shoulda and mocha.
21
- You can install them as follows:
22
- gem install shoulda
23
- gem install mocha
24
-
25
- MSG
26
-
27
- exit
28
- end
29
-
30
13
  require 'bson_ext/cbson' if !(RUBY_PLATFORM =~ /java/) && ENV['C_EXT']
31
14
 
32
15
  class Test::Unit::TestCase
metadata CHANGED
@@ -1,106 +1,85 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: bson
3
- version: !ruby/object:Gem::Version
4
- hash: 5
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 4
9
- - 1
10
- version: 1.4.1
11
6
  platform: jruby
12
- authors:
7
+ authors:
13
8
  - Jim Menard
14
9
  - Mike Dirolf
15
10
  - Kyle Banker
16
11
  autorequire:
17
12
  bindir: bin
18
13
  cert_chain: []
19
-
20
- date: 2011-10-17 00:00:00 -05:00
21
- default_executable:
14
+ date: 2011-11-28 00:00:00.000000000Z
22
15
  dependencies: []
23
-
24
- description: A Ruby BSON implementation for MongoDB. For more information about Mongo, see http://www.mongodb.org. For more information on BSON, see http://www.bsonspec.org.
16
+ description: A Ruby BSON implementation for MongoDB. For more information about Mongo,
17
+ see http://www.mongodb.org. For more information on BSON, see http://www.bsonspec.org.
25
18
  email: mongodb-dev@googlegroups.com
26
- executables:
19
+ executables:
27
20
  - b2json
28
21
  - j2bson
29
22
  extensions: []
30
-
31
23
  extra_rdoc_files: []
32
-
33
- files:
24
+ files:
34
25
  - LICENSE.txt
35
26
  - lib/bson.rb
36
- - lib/bson/bson_c.rb
37
27
  - lib/bson/bson_java.rb
38
- - lib/bson/bson_ruby.rb
39
- - lib/bson/byte_buffer.rb
40
- - lib/bson/exceptions.rb
41
- - lib/bson/ordered_hash.rb
42
28
  - lib/bson/types/binary.rb
43
- - lib/bson/types/code.rb
44
- - lib/bson/types/dbref.rb
45
29
  - lib/bson/types/min_max_keys.rb
46
- - lib/bson/types/object_id.rb
47
30
  - lib/bson/types/timestamp.rb
31
+ - lib/bson/types/code.rb
32
+ - lib/bson/types/object_id.rb
33
+ - lib/bson/types/dbref.rb
34
+ - lib/bson/exceptions.rb
35
+ - lib/bson/bson_c.rb
36
+ - lib/bson/ordered_hash.rb
37
+ - lib/bson/byte_buffer.rb
38
+ - lib/bson/bson_ruby.rb
48
39
  - bin/b2json
49
40
  - bin/j2bson
50
41
  - ext/java/jar/jbson.jar
51
42
  - ext/java/jar/mongo-2.6.5.jar
52
43
  - test/bson/binary_test.rb
53
- - test/bson/bson_string_test.rb
54
- - test/bson/bson_test.rb
55
- - test/bson/byte_buffer_test.rb
56
- - test/bson/hash_with_indifferent_access_test.rb
57
44
  - test/bson/json_test.rb
58
- - test/bson/object_id_test.rb
45
+ - test/bson/byte_buffer_test.rb
59
46
  - test/bson/ordered_hash_test.rb
47
+ - test/bson/object_id_test.rb
60
48
  - test/bson/test_helper.rb
49
+ - test/bson/bson_test.rb
61
50
  - test/bson/timestamp_test.rb
62
- has_rdoc: true
51
+ - test/bson/hash_with_indifferent_access_test.rb
63
52
  homepage: http://www.mongodb.org
64
53
  licenses: []
65
-
66
54
  post_install_message:
67
55
  rdoc_options: []
68
-
69
- require_paths:
56
+ require_paths:
70
57
  - lib
71
- required_ruby_version: !ruby/object:Gem::Requirement
58
+ required_ruby_version: !ruby/object:Gem::Requirement
72
59
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 0
79
- version: "0"
80
- required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
65
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
89
70
  requirements: []
90
-
91
71
  rubyforge_project:
92
- rubygems_version: 1.5.2
72
+ rubygems_version: 1.8.10
93
73
  signing_key:
94
74
  specification_version: 3
95
75
  summary: Ruby implementation of BSON
96
- test_files:
76
+ test_files:
97
77
  - test/bson/binary_test.rb
98
- - test/bson/bson_string_test.rb
99
- - test/bson/bson_test.rb
100
- - test/bson/byte_buffer_test.rb
101
- - test/bson/hash_with_indifferent_access_test.rb
102
78
  - test/bson/json_test.rb
103
- - test/bson/object_id_test.rb
79
+ - test/bson/byte_buffer_test.rb
104
80
  - test/bson/ordered_hash_test.rb
81
+ - test/bson/object_id_test.rb
105
82
  - test/bson/test_helper.rb
83
+ - test/bson/bson_test.rb
106
84
  - test/bson/timestamp_test.rb
85
+ - test/bson/hash_with_indifferent_access_test.rb
@@ -1,30 +0,0 @@
1
- # encoding:utf-8
2
- require './test/bson/test_helper'
3
- require 'complex'
4
- require 'bigdecimal'
5
- require 'rational'
6
-
7
- class BSONTest < Test::Unit::TestCase
8
-
9
- include BSON
10
-
11
- def setup
12
- @encoder = BSON::BSON_CODER
13
- end
14
-
15
- def assert_doc_pass(doc, options={})
16
- bson = @encoder.serialize(doc)
17
- if options[:debug]
18
- puts "DEBUGGING DOC:"
19
- p bson.to_a
20
- puts "DESERIALIZES TO:"
21
- end
22
- assert_equal @encoder.serialize(doc).to_a, bson.to_a
23
- assert_equal doc, @encoder.deserialize(bson)
24
- end
25
-
26
- def test_string
27
- assert_doc_pass({:a => "hello"})
28
- end
29
-
30
- end