bson 1.8.6 → 1.9.0

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc144587d6d22796d66d8f9ac5ee20ad96917f2e
4
- data.tar.gz: 52bbe2f746ab2413c7922650b3bc14fa331747b6
3
+ metadata.gz: 9c375bb84ba23c71298767480971b1e58596e51c
4
+ data.tar.gz: e632e932c077a0e9e0429e4c796c09e39f21bf5c
5
5
  SHA512:
6
- metadata.gz: ba3cc9e68f7a43da18620fec30661e762d8d565c53f2155be9f2f1dd8a99530f4f5fdf536417d93fb732a1d8af41cb162cba0af1c75fe069493d0350ade0395a
7
- data.tar.gz: 5359976d08c3a1b8551be6c90b670361cb499a810703f2677cce5e567d118c0e0834d8338921cd2e7a705a12a92a78c36ec20b5aa5cb472d7eef22bf62dc934d
6
+ metadata.gz: 80d34d78a66c13419fcf723d97d61fcc537fb78c2380958c884120b3ef1802d679b1d51983b6d07be16bef899991f1e57c235818356fea023983a49b04a61dfe
7
+ data.tar.gz: 0acd14056f9ef6201deecf161e197aea0e9af73e8544ee22150b62a3090ec85265cdd4f62e393cf89e9246bbaa5164ac2e5d8362e395487929733b9920a602c5
Binary file
data.tar.gz.sig CHANGED
Binary file
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.6
1
+ 1.9.0
data/bin/b2json CHANGED
@@ -1,6 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
3
 
4
+ # Copyright (C) 2013 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
+
4
18
  require 'rubygems'
5
19
  require 'bson'
6
20
 
@@ -10,7 +24,7 @@ begin
10
24
  require 'yajl'
11
25
  rescue LoadError
12
26
  puts "This script requires yajl. Please install as follows:"
13
- puts " gem install yajl-ruby"
27
+ puts " gem install yajl-ruby"
14
28
  Process.exit
15
29
  end
16
30
 
data/bin/j2bson CHANGED
@@ -1,6 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
3
 
4
+ # Copyright (C) 2013 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
+
4
18
  require 'rubygems'
5
19
  require 'bson'
6
20
 
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module BSON
2
16
  DEFAULT_MAX_BSON_SIZE = 4 * 1024 * 1024
3
17
 
@@ -1,4 +1,18 @@
1
- # A thin wrapper for the CBson class
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # A thin wrapper for the BSON C-Extension
2
16
  module BSON
3
17
  class BSON_C
4
18
 
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require 'jruby'
2
16
 
3
17
  include Java
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module BSON
2
16
  NULL_BYTE = "\x00"
3
17
 
@@ -1,4 +1,17 @@
1
- # A byte buffer.
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
2
15
  module BSON
3
16
  class ByteBuffer
4
17
 
@@ -71,7 +84,7 @@ module BSON
71
84
  end
72
85
  @cursor += 1
73
86
  end
74
-
87
+
75
88
  def put_binary(data, offset=nil)
76
89
  @cursor = offset if offset
77
90
  if defined?(BINARY_ENCODING)
@@ -85,7 +98,7 @@ module BSON
85
98
  end
86
99
  @cursor += data.length
87
100
  end
88
-
101
+
89
102
  def put_array(array, offset=nil)
90
103
  @cursor = offset if offset
91
104
  if more?
@@ -177,7 +190,7 @@ module BSON
177
190
  def more?
178
191
  @cursor < @str.size
179
192
  end
180
-
193
+
181
194
  def ==(other)
182
195
  other.respond_to?(:to_s) && @str == other.to_s
183
196
  end
@@ -208,7 +221,7 @@ module BSON
208
221
  @str << NULL_BYTE * (length - @str.size)
209
222
  end
210
223
  end
211
-
224
+
212
225
  def chr(byte)
213
226
  if byte < 0
214
227
  [byte].pack('c')
@@ -216,7 +229,7 @@ module BSON
216
229
  byte.chr
217
230
  end
218
231
  end
219
-
232
+
220
233
  def check_read_length(len)
221
234
  raise "attempt to read past end of buffer" if @cursor + len > @str.length
222
235
  end
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module BSON
2
16
  # Generic Mongo Ruby Driver exception class.
3
17
  class MongoRubyError < StandardError; end
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # A hash in which the order of keys are preserved.
2
16
  #
3
17
  # Under Ruby 1.9 and greater, this class has no added methods because Ruby's
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require 'active_support'
2
16
  begin
3
17
  require 'active_support/hash_with_indifferent_access'
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require 'bson/byte_buffer'
2
16
 
3
17
  module BSON
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module BSON
2
16
 
3
17
  # JavaScript code to be evaluated by MongoDB.
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module BSON
2
16
 
3
17
  # A reference to another object in a MongoDB database.
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module BSON
2
16
 
3
17
  # A class representing the BSON MaxKey type. MaxKey will always compare greater than
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require 'thread'
2
16
  require 'socket'
3
17
  require 'digest/md5'
@@ -69,7 +83,7 @@ module BSON
69
83
  #
70
84
  # @param [Hash] doc a document requiring an _id.
71
85
  #
72
- # @return [BSON::ObjectId, Object] returns a newly-created or
86
+ # @return [BSON::ObjectId, Object] returns a newly-created or
73
87
  # current _id for the given document.
74
88
  def self.create_pk(doc)
75
89
  doc.has_key?(:_id) || doc.has_key?('_id') ? doc : doc.merge!(:_id => self.new)
@@ -132,7 +146,7 @@ module BSON
132
146
  "{\"$oid\": \"#{to_s}\"}"
133
147
  end
134
148
 
135
- # Create the JSON hash structure convert to MongoDB extended format. Rails 2.3.3
149
+ # Create the JSON hash structure convert to MongoDB extended format. Rails 2.3.3
136
150
  # introduced as_json to create the needed hash structure to encode objects into JSON.
137
151
  #
138
152
  # @return [Hash] the hash representation as MongoDB extended JSON
@@ -1,3 +1,17 @@
1
+ # Copyright (C) 2013 10gen Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module BSON
2
16
 
3
17
  # A class for representing BSON Timestamps. The Timestamp type is used
@@ -10,7 +24,7 @@ module BSON
10
24
 
11
25
  # Create a new BSON Timestamp.
12
26
  #
13
- # @param [Integer] seconds The number of seconds
27
+ # @param [Integer] seconds The number of seconds
14
28
  # @param increment
15
29
  def initialize(seconds, increment)
16
30
  @seconds = seconds
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bson
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Brock
@@ -33,7 +33,7 @@ cert_chain:
33
33
  8v7zLF2XliYbfurYIwkcXs8yPn8ggApBIy9bX6VJxRs/l2+UvqzaHIFaFy/F8/GP
34
34
  RNTuXsVG5NDACo7Q
35
35
  -----END CERTIFICATE-----
36
- date: 2013-05-16 00:00:00.000000000 Z
36
+ date: 2013-06-11 00:00:00.000000000 Z
37
37
  dependencies: []
38
38
  description: A Ruby BSON implementation for MongoDB. For more information about Mongo,
39
39
  see http://www.mongodb.org. For more information on BSON, see http://www.bsonspec.org.
metadata.gz.sig CHANGED
Binary file