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 +2 -2
- data/lib/bson/ordered_hash.rb +4 -3
- data/test/bson/binary_test.rb +6 -8
- data/test/bson/bson_test.rb +1 -0
- data/test/bson/ordered_hash_test.rb +2 -0
- data/test/bson/test_helper.rb +0 -17
- metadata +38 -59
- data/test/bson/bson_string_test.rb +0 -30
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.
|
21
|
+
MINIMUM_BSON_EXT_VERSION = "1.5.0"
|
22
22
|
|
23
23
|
module BSON
|
24
|
-
VERSION = "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
|
data/lib/bson/ordered_hash.rb
CHANGED
data/test/bson/binary_test.rb
CHANGED
@@ -2,14 +2,12 @@
|
|
2
2
|
require './test/bson/test_helper'
|
3
3
|
|
4
4
|
class BinaryTest < Test::Unit::TestCase
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
5
|
+
def setup
|
6
|
+
@data = ("THIS IS BINARY " * 50).unpack("c*")
|
7
|
+
end
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
data/test/bson/bson_test.rb
CHANGED
data/test/bson/test_helper.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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/
|
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
|
-
|
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
|
-
|
77
|
-
|
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
|
-
|
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.
|
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/
|
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
|