bson 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/bson/read.c +36 -7
- data/ext/bson/write.c +36 -14
- data/lib/bson/array.rb +13 -8
- data/lib/bson/binary.rb +14 -1
- data/lib/bson/db_pointer.rb +16 -0
- data/lib/bson/dbref.rb +0 -15
- data/lib/bson/environment.rb +0 -13
- data/lib/bson/ext_json.rb +33 -4
- data/lib/bson/float.rb +3 -0
- data/lib/bson/hash.rb +13 -8
- data/lib/bson/int32.rb +6 -0
- data/lib/bson/int64.rb +3 -0
- data/lib/bson/integer.rb +9 -0
- data/lib/bson/open_struct.rb +1 -5
- data/lib/bson/regexp.rb +0 -7
- data/lib/bson/string.rb +0 -5
- data/lib/bson/timestamp.rb +0 -1
- data/lib/bson/version.rb +1 -1
- data/lib/bson.rb +34 -6
- data/spec/bson/array_spec.rb +24 -0
- data/spec/bson/binary_spec.rb +52 -0
- data/spec/bson/byte_buffer_write_spec.rb +15 -15
- data/spec/bson/date_spec.rb +2 -2
- data/spec/bson/date_time_spec.rb +2 -2
- data/spec/bson/db_pointer_spec.rb +163 -0
- data/spec/bson/decimal128_spec.rb +1 -1
- data/spec/bson/ext_json_parse_spec.rb +114 -0
- data/spec/bson/float_spec.rb +1 -1
- data/spec/bson/int32_spec.rb +4 -4
- data/spec/bson/int64_spec.rb +2 -2
- data/spec/bson/integer_spec.rb +2 -2
- data/spec/bson/max_nesting_depth_spec.rb +198 -0
- data/spec/bson/string_length_overflow_spec.rb +64 -0
- data/spec/bson/time_spec.rb +3 -3
- data/spec/bson/time_with_zone_spec.rb +2 -2
- data/spec/bson/timestamp_spec.rb +1 -1
- data/spec/bson_spec.rb +16 -4
- data/spec/support/pack_directives.rb +18 -0
- metadata +449 -392
- data/lib/bson/error/illegal_key.rb +0 -23
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# rubocop:todo all
|
|
3
|
-
|
|
4
|
-
module BSON
|
|
5
|
-
class Error
|
|
6
|
-
|
|
7
|
-
# Raised when validating keys and a key is illegal in MongoDB
|
|
8
|
-
class IllegalKey < Error
|
|
9
|
-
|
|
10
|
-
# Instantiate the exception.
|
|
11
|
-
#
|
|
12
|
-
# @example Instantiate the exception.
|
|
13
|
-
# BSON::Error::IllegalKey.new(string)
|
|
14
|
-
#
|
|
15
|
-
# @param [ String ] string The illegal string.
|
|
16
|
-
#
|
|
17
|
-
# @api private
|
|
18
|
-
def initialize(string)
|
|
19
|
-
super("'#{string}' is an illegal key in MongoDB. Keys may not start with '$' or contain a '.'.")
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|