bson 1.5.0 → 1.5.1
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/test/bson/bson_string_test.rb +30 -0
- metadata +57 -38
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.5.
|
21
|
+
MINIMUM_BSON_EXT_VERSION = "1.5.1"
|
22
22
|
|
23
23
|
module BSON
|
24
|
-
VERSION = "1.5.
|
24
|
+
VERSION = "1.5.1"
|
25
25
|
|
26
26
|
if defined? Mongo::DEFAULT_MAX_BSON_SIZE
|
27
27
|
DEFAULT_MAX_BSON_SIZE = Mongo::DEFAULT_MAX_BSON_SIZE
|
@@ -0,0 +1,30 @@
|
|
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
|
metadata
CHANGED
@@ -1,85 +1,104 @@
|
|
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
|
+
hash: 1
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 5
|
9
|
+
- 1
|
10
|
+
version: 1.5.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Jim Menard
|
9
14
|
- Mike Dirolf
|
10
15
|
- Kyle Banker
|
11
16
|
autorequire:
|
12
17
|
bindir: bin
|
13
18
|
cert_chain: []
|
14
|
-
|
19
|
+
|
20
|
+
date: 2011-11-29 00:00:00 Z
|
15
21
|
dependencies: []
|
16
|
-
|
17
|
-
|
22
|
+
|
23
|
+
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.
|
18
24
|
email: mongodb-dev@googlegroups.com
|
19
|
-
executables:
|
25
|
+
executables:
|
20
26
|
- b2json
|
21
27
|
- j2bson
|
22
28
|
extensions: []
|
29
|
+
|
23
30
|
extra_rdoc_files: []
|
24
|
-
|
31
|
+
|
32
|
+
files:
|
25
33
|
- LICENSE.txt
|
26
34
|
- lib/bson.rb
|
35
|
+
- lib/bson/bson_c.rb
|
27
36
|
- lib/bson/bson_java.rb
|
37
|
+
- lib/bson/bson_ruby.rb
|
38
|
+
- lib/bson/byte_buffer.rb
|
39
|
+
- lib/bson/exceptions.rb
|
40
|
+
- lib/bson/ordered_hash.rb
|
28
41
|
- lib/bson/types/binary.rb
|
29
|
-
- lib/bson/types/min_max_keys.rb
|
30
|
-
- lib/bson/types/timestamp.rb
|
31
42
|
- lib/bson/types/code.rb
|
32
|
-
- lib/bson/types/object_id.rb
|
33
43
|
- lib/bson/types/dbref.rb
|
34
|
-
- lib/bson/
|
35
|
-
- lib/bson/
|
36
|
-
- lib/bson/
|
37
|
-
- lib/bson/byte_buffer.rb
|
38
|
-
- lib/bson/bson_ruby.rb
|
44
|
+
- lib/bson/types/min_max_keys.rb
|
45
|
+
- lib/bson/types/object_id.rb
|
46
|
+
- lib/bson/types/timestamp.rb
|
39
47
|
- bin/b2json
|
40
48
|
- bin/j2bson
|
41
49
|
- test/bson/binary_test.rb
|
42
|
-
- test/bson/
|
50
|
+
- test/bson/bson_string_test.rb
|
51
|
+
- test/bson/bson_test.rb
|
43
52
|
- test/bson/byte_buffer_test.rb
|
44
|
-
- test/bson/
|
53
|
+
- test/bson/hash_with_indifferent_access_test.rb
|
54
|
+
- test/bson/json_test.rb
|
45
55
|
- test/bson/object_id_test.rb
|
56
|
+
- test/bson/ordered_hash_test.rb
|
46
57
|
- test/bson/test_helper.rb
|
47
|
-
- test/bson/bson_test.rb
|
48
58
|
- test/bson/timestamp_test.rb
|
49
|
-
- test/bson/hash_with_indifferent_access_test.rb
|
50
59
|
- test/support/hash_with_indifferent_access.rb
|
51
60
|
homepage: http://www.mongodb.org
|
52
61
|
licenses: []
|
62
|
+
|
53
63
|
post_install_message:
|
54
64
|
rdoc_options: []
|
55
|
-
|
65
|
+
|
66
|
+
require_paths:
|
56
67
|
- lib
|
57
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
69
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
78
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
69
86
|
requirements: []
|
87
|
+
|
70
88
|
rubyforge_project:
|
71
|
-
rubygems_version: 1.8.
|
89
|
+
rubygems_version: 1.8.11
|
72
90
|
signing_key:
|
73
91
|
specification_version: 3
|
74
92
|
summary: Ruby implementation of BSON
|
75
|
-
test_files:
|
93
|
+
test_files:
|
76
94
|
- test/bson/binary_test.rb
|
77
|
-
- test/bson/
|
95
|
+
- test/bson/bson_string_test.rb
|
96
|
+
- test/bson/bson_test.rb
|
78
97
|
- test/bson/byte_buffer_test.rb
|
79
|
-
- test/bson/
|
98
|
+
- test/bson/hash_with_indifferent_access_test.rb
|
99
|
+
- test/bson/json_test.rb
|
80
100
|
- test/bson/object_id_test.rb
|
101
|
+
- test/bson/ordered_hash_test.rb
|
81
102
|
- test/bson/test_helper.rb
|
82
|
-
- test/bson/bson_test.rb
|
83
103
|
- test/bson/timestamp_test.rb
|
84
|
-
- test/bson/hash_with_indifferent_access_test.rb
|
85
104
|
- test/support/hash_with_indifferent_access.rb
|