bson 1.10.0.rc1 → 1.10.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: d88105c0287d048c953a1dc0901be85de75557de
4
- data.tar.gz: c7e60033a14b9dadbc03c0b167e39a4196c1a19c
3
+ metadata.gz: 3b7e536f90a97d0a1e1edc2102c09e815427ef9e
4
+ data.tar.gz: dadc82a3b6a17b7a32467cffa9d99f1349db0e2f
5
5
  SHA512:
6
- metadata.gz: a9131fbe4fe0e4e7f0ff67382dd56e23a6db60fbdc8742e853f29687b887933f56ab05cc53a5eaee349784b352e9376462755aa9a3c1d4f23faea9416e5ccc52
7
- data.tar.gz: 41c501a61c2843931b7155cfb0fce1d9199a6936b54270b65f50d440454d5436b4ab6412c391e8ed04dea3eda7645337220bf7fe246d0c85ceda4487389c5f95
6
+ metadata.gz: 94cab5d278b393045e3a42b91fad6790094bfaa3346bed05f33f5baaa75dafdd7a0e33877c8949560216c8fd1aa952e0bc4d88c62d70bd3201e1136749a4b0f3
7
+ data.tar.gz: 1e715b96ced5464c999a9e74a9bbcad82b77a96c409b321e459a9b5a06a8dc2456fb9a869397cb350b455b45ec580c27eedd88e90f803dca71c113a5e50c0091
Binary file
data.tar.gz.sig CHANGED
Binary file
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.10.0.rc1
1
+ 1.10.0
@@ -16,7 +16,7 @@ require 'jruby'
16
16
 
17
17
  include Java
18
18
 
19
- jar_dir = File.join(File.dirname(__FILE__), '../../ext/jbson')
19
+ jar_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../ext/jbson'))
20
20
  require File.join(jar_dir, 'lib/java-bson.jar')
21
21
  require File.join(jar_dir, 'target/jbson.jar')
22
22
 
@@ -41,6 +41,16 @@ module BSON
41
41
  instance_of?(BSON::OrderedHash)
42
42
  end
43
43
 
44
+ def reject
45
+ return to_enum(:reject) unless block_given?
46
+ dup.tap {|hash| hash.reject!{|k, v| yield k, v}}
47
+ end
48
+
49
+ def select
50
+ return to_enum(:select) unless block_given?
51
+ dup.tap {|hash| hash.reject!{|k, v| ! yield k, v}}
52
+ end
53
+
44
54
  # We only need the body of this class if the RUBY_VERSION is before 1.9
45
55
  if RUBY_VERSION < '1.9'
46
56
  attr_accessor :ordered_keys
@@ -142,21 +152,16 @@ module BSON
142
152
  self
143
153
  end
144
154
 
145
- def reject(&block)
146
- clone = self.clone
147
- return clone unless block_given?
148
- clone.delete_if(&block)
149
- end
150
-
151
- def reject!(&block)
152
- changed = false
153
- self.each do |k,v|
154
- if yield k, v
155
- changed = true
156
- delete(k)
155
+ def reject!
156
+ return to_enum(:reject!) unless block_given?
157
+ raise "can't modify frozen BSON::OrderedHash" if frozen?
158
+ keys = @ordered_keys.dup
159
+ @ordered_keys.each do |k|
160
+ if yield k, self[k]
161
+ keys.delete(k)
157
162
  end
158
163
  end
159
- changed ? self : nil
164
+ keys == @ordered_keys ? nil : @ordered_keys = keys
160
165
  end
161
166
 
162
167
  def clear
@@ -49,6 +49,16 @@ module ActiveSupport
49
49
  end
50
50
  end
51
51
 
52
+ def reject
53
+ return to_enum(:reject) unless block_given?
54
+ dup.tap {|hash| hash.reject!{|k, v| yield k, v}}
55
+ end
56
+
57
+ def select
58
+ return to_enum(:select) unless block_given?
59
+ dup.tap {|hash| hash.reject!{|k, v| ! yield k, v}}
60
+ end
61
+
52
62
  alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
53
63
  alias_method :regular_update, :update unless method_defined?(:regular_update)
54
64
 
@@ -35,7 +35,7 @@ module BSON
35
35
  #
36
36
  # @param [Array, String] data to story as BSON binary. If a string is given, the on
37
37
  # Ruby 1.9 it will be forced to the binary encoding.
38
- # @param [Fixnum] one of four values specifying a BSON binary subtype. Possible values are
38
+ # @param [Fixnum] subtype one of four values specifying a BSON binary subtype. Possible values are
39
39
  # SUBTYPE_BYTES, SUBTYPE_UUID, SUBTYPE_MD5, and SUBTYPE_USER_DEFINED.
40
40
  #
41
41
  # @see http://www.mongodb.org/display/DOCS/BSON#BSON-noteondatabinary BSON binary subtypes.
@@ -23,7 +23,7 @@ module BSON
23
23
  # Wrap code to be evaluated by MongoDB.
24
24
  #
25
25
  # @param [String] code the JavaScript code.
26
- # @param [Hash] a document mapping identifiers to values, which
26
+ # @param [Hash] scope a document mapping identifiers to values, which
27
27
  # represent the scope in which the code is to be executed.
28
28
  def initialize(code, scope={})
29
29
  @code = code
@@ -21,8 +21,8 @@ module BSON
21
21
 
22
22
  # Create a DBRef. Use this class in conjunction with DB#dereference.
23
23
  #
24
- # @param [String] a collection name
25
- # @param [ObjectId] an object id
24
+ # @param [String] namespace a collection name.
25
+ # @param [ObjectId] object_id an object id.
26
26
  def initialize(namespace, object_id)
27
27
  @namespace = namespace
28
28
  @object_id = object_id
@@ -32,7 +32,7 @@ module BSON
32
32
  # Create a new regexp.
33
33
  #
34
34
  # @param pattern [String]
35
- # @param options [Array, String]
35
+ # @param opts [Array, String]
36
36
  def initialize(pattern, *opts)
37
37
  @pattern = pattern
38
38
  @options = opts.first.is_a?(Fixnum) ? opts.first : str_opts_to_int(opts.join)
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.10.0.rc1
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Brock
@@ -34,7 +34,7 @@ cert_chain:
34
34
  JrZM8w8wGbIOeLtoQqa7HB/jOYbTahH7KMNh2LHAbOR93hNIJxVRa4iwxiMQ75tN
35
35
  9WUIAJ4AEtjwRg1Bz0OwDo3aucPCBpx77+/FWhv7JYY=
36
36
  -----END CERTIFICATE-----
37
- date: 2014-03-17 00:00:00.000000000 Z
37
+ date: 2014-04-03 00:00:00.000000000 Z
38
38
  dependencies: []
39
39
  description: A Ruby BSON implementation for MongoDB. For more information about Mongo,
40
40
  see http://www.mongodb.org. For more information on BSON, see http://www.bsonspec.org.
@@ -81,9 +81,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - ">"
84
+ - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 1.3.1
86
+ version: '0'
87
87
  requirements: []
88
88
  rubyforge_project: bson
89
89
  rubygems_version: 2.2.2
metadata.gz.sig CHANGED
Binary file