bson 1.2.rc2-jruby → 1.2.1-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.

Binary file
@@ -1,11 +1,27 @@
1
1
  # encoding: UTF-8
2
+ #
3
+ # --
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ # ++
2
18
 
3
19
  $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
20
 
5
- MINIMUM_BSON_EXT_VERSION = "1.2.rc2"
21
+ MINIMUM_BSON_EXT_VERSION = "1.2.1"
6
22
 
7
23
  module BSON
8
- VERSION = "1.2.rc2"
24
+ VERSION = "1.2.1"
9
25
 
10
26
  if defined? Mongo::DEFAULT_MAX_BSON_SIZE
11
27
  DEFAULT_MAX_BSON_SIZE = Mongo::DEFAULT_MAX_BSON_SIZE
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  # --
4
- # Copyright (C) 2008-2010 10gen Inc.
4
+ # Copyright (C) 2008-2011 10gen Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -562,4 +562,47 @@ class BSONTest < Test::Unit::TestCase
562
562
  end
563
563
  end
564
564
 
565
+ def test_invalid_key_names
566
+ assert @encoder.serialize({"hello" => "world"}, true)
567
+ assert @encoder.serialize({"hello" => {"hello" => "world"}}, true)
568
+
569
+ assert @encoder.serialize({"he$llo" => "world"}, true)
570
+ assert @encoder.serialize({"hello" => {"hell$o" => "world"}}, true)
571
+
572
+ assert_raise BSON::InvalidDocument do
573
+ @encoder.serialize({"he\0llo" => "world"}, true)
574
+ end
575
+
576
+ assert_raise_error BSON::InvalidKeyName, "$hello" do
577
+ @encoder.serialize({"$hello" => "world"}, true)
578
+ end
579
+
580
+ assert_raise BSON::InvalidKeyName do
581
+ @encoder.serialize({"hello" => {"$hello" => "world"}}, true)
582
+ end
583
+
584
+ assert_raise_error BSON::InvalidKeyName, ".hello" do
585
+ @encoder.serialize({".hello" => "world"}, true)
586
+ end
587
+
588
+ assert_raise BSON::InvalidKeyName do
589
+ @encoder.serialize({"hello" => {".hello" => "world"}}, true)
590
+ end
591
+
592
+ assert_raise BSON::InvalidKeyName do
593
+ @encoder.serialize({"hello." => "world"}, true)
594
+ end
595
+
596
+ assert_raise BSON::InvalidKeyName do
597
+ @encoder.serialize({"hello" => {"hello." => "world"}}, true)
598
+ end
599
+
600
+ assert_raise BSON::InvalidKeyName do
601
+ @encoder.serialize({"hel.lo" => "world"}, true)
602
+ end
603
+
604
+ assert_raise BSON::InvalidKeyName do
605
+ @encoder.serialize({"hello" => {"hel.lo" => "world"}}, true)
606
+ end
607
+ end
565
608
  end
metadata CHANGED
@@ -1,14 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bson
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424225
5
- prerelease: 4
4
+ prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 2
9
- - rc
10
- - 2
11
- version: 1.2.rc2
8
+ - 1
9
+ version: 1.2.1
12
10
  platform: jruby
13
11
  authors:
14
12
  - Jim Menard
@@ -18,7 +16,7 @@ autorequire:
18
16
  bindir: bin
19
17
  cert_chain: []
20
18
 
21
- date: 2011-01-06 00:00:00 -05:00
19
+ date: 2011-02-10 00:00:00 -05:00
22
20
  default_executable:
23
21
  dependencies: []
24
22
 
@@ -71,25 +69,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
69
  requirements:
72
70
  - - ">="
73
71
  - !ruby/object:Gem::Version
74
- hash: 3
75
72
  segments:
76
73
  - 0
77
74
  version: "0"
78
75
  required_rubygems_version: !ruby/object:Gem::Requirement
79
76
  none: false
80
77
  requirements:
81
- - - ">"
78
+ - - ">="
82
79
  - !ruby/object:Gem::Version
83
- hash: 25
84
80
  segments:
85
- - 1
86
- - 3
87
- - 1
88
- version: 1.3.1
81
+ - 0
82
+ version: "0"
89
83
  requirements: []
90
84
 
91
85
  rubyforge_project:
92
- rubygems_version: 1.4.1
86
+ rubygems_version: 1.3.7
93
87
  signing_key:
94
88
  specification_version: 3
95
89
  summary: Ruby implementation of BSON