bson 2.2.2 → 2.2.3
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/ext/bson/native.c +0 -40
- data/lib/bson/version.rb +1 -1
- data/spec/bson/document_spec.rb +16 -0
- metadata +4 -26
- checksums.yaml.gz.sig +0 -1
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9243f0f1528aa27def97c45d8da35f22ca6ebb7d
|
4
|
+
data.tar.gz: 70beb8ef6d44d9206ac83d17753e3fc835dbada9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57bc18e43c59df8d231f9ff3bef01c5f366d783e1995a1e5f3b8d3d9f346a28cc2bc8f997f42fc786df318f0b8f0b918c9f4a88e99aa80e2fec1cf2b7c6db3be
|
7
|
+
data.tar.gz: 95d717c28bbab4bed59a16c4ee53d7990439adbd0479ca5ca27b4f3952ea1ade2ec493571eafd494de6b58d42b3fe4f051c81d2ee277bf552203ce95e9de367c
|
data/CHANGELOG.md
CHANGED
data/ext/bson/native.c
CHANGED
@@ -89,24 +89,6 @@ static VALUE rb_utc_method;
|
|
89
89
|
|
90
90
|
#include <ruby/encoding.h>
|
91
91
|
|
92
|
-
/**
|
93
|
-
* Convert a ruby string into a utf-8 compatible binary string.
|
94
|
-
*
|
95
|
-
* @example Convert the string to utf-8 binary.
|
96
|
-
* rb_bson_to_utf8_binary("test");
|
97
|
-
*
|
98
|
-
* @param [ String ] string The ruby string.
|
99
|
-
*
|
100
|
-
* @return [ String ] The encoded string.
|
101
|
-
*
|
102
|
-
* @since 2.0.0
|
103
|
-
*/
|
104
|
-
static VALUE rb_bson_to_utf8_binary(VALUE string)
|
105
|
-
{
|
106
|
-
VALUE utf8 = rb_str_encode(string, rb_bson_utf8_string, 0, Qnil);
|
107
|
-
return rb_enc_associate(utf8, rb_ascii8bit_encoding());
|
108
|
-
}
|
109
|
-
|
110
92
|
/**
|
111
93
|
* Convert the binary string to a ruby utf8 string.
|
112
94
|
*
|
@@ -551,26 +533,6 @@ static VALUE rb_string_set_int32(VALUE str, VALUE pos, VALUE an_int32)
|
|
551
533
|
return str;
|
552
534
|
}
|
553
535
|
|
554
|
-
/**
|
555
|
-
* Convert the ruby string to a BSON string.
|
556
|
-
*
|
557
|
-
* @example Convert the Ruby string to a BSON string.
|
558
|
-
* rb_string_to_bson_string(0, Qnil, "test");
|
559
|
-
*
|
560
|
-
* @param [ String ] self The string value.
|
561
|
-
* @param [ String ] encoded The encoded string to append to.
|
562
|
-
*
|
563
|
-
* @return [ String ] The encoded string.
|
564
|
-
*
|
565
|
-
* @since 2.0.0
|
566
|
-
*/
|
567
|
-
static VALUE rb_string_to_bson_string(VALUE self, VALUE encoded)
|
568
|
-
{
|
569
|
-
const VALUE binary = rb_bson_to_utf8_binary(self);
|
570
|
-
rb_str_cat(encoded, RSTRING_PTR(binary), RSTRING_LEN(binary));
|
571
|
-
return encoded;
|
572
|
-
}
|
573
|
-
|
574
536
|
/**
|
575
537
|
* Check for illegal characters in string.
|
576
538
|
*
|
@@ -697,8 +659,6 @@ void Init_native()
|
|
697
659
|
// String optimizations.
|
698
660
|
rb_undef_method(string, "set_int32");
|
699
661
|
rb_define_method(string, "set_int32", rb_string_set_int32, 2);
|
700
|
-
rb_undef_method(string, "to_utf8_binary");
|
701
|
-
rb_define_private_method(string, "to_utf8_binary", rb_string_to_bson_string, 1);
|
702
662
|
rb_undef_method(string, "from_bson_string");
|
703
663
|
rb_define_method(string, "from_bson_string", rb_bson_from_bson_string, 0);
|
704
664
|
rb_undef_method(string, "check_for_illegal_characters!");
|
data/lib/bson/version.rb
CHANGED
data/spec/bson/document_spec.rb
CHANGED
@@ -630,6 +630,22 @@ describe BSON::Document do
|
|
630
630
|
|
631
631
|
it_behaves_like "a bson element"
|
632
632
|
|
633
|
+
context "when the hash has symbol keys" do
|
634
|
+
|
635
|
+
let(:obj) do
|
636
|
+
described_class[:ismaster, 1].freeze
|
637
|
+
end
|
638
|
+
|
639
|
+
let(:bson) do
|
640
|
+
"#{19.to_bson}#{BSON::Int32::BSON_TYPE}ismaster#{BSON::NULL_BYTE}" +
|
641
|
+
"#{1.to_bson}#{BSON::NULL_BYTE}"
|
642
|
+
end
|
643
|
+
|
644
|
+
it "properly serializes the symbol" do
|
645
|
+
expect(obj.to_bson).to eq(bson)
|
646
|
+
end
|
647
|
+
end
|
648
|
+
|
633
649
|
context "when the hash is a single level" do
|
634
650
|
|
635
651
|
let(:obj) do
|
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: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Brock
|
@@ -11,30 +11,8 @@ authors:
|
|
11
11
|
- Gary Murakami
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
|
-
cert_chain:
|
15
|
-
-
|
16
|
-
-----BEGIN CERTIFICATE-----
|
17
|
-
MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQUFADBCMRQwEgYDVQQDDAtkcml2
|
18
|
-
ZXItcnVieTEVMBMGCgmSJomT8ixkARkWBTEwZ2VuMRMwEQYKCZImiZPyLGQBGRYD
|
19
|
-
Y29tMB4XDTE0MDIxOTE1MTEyNloXDTE1MDIxOTE1MTEyNlowQjEUMBIGA1UEAwwL
|
20
|
-
ZHJpdmVyLXJ1YnkxFTATBgoJkiaJk/IsZAEZFgUxMGdlbjETMBEGCgmSJomT8ixk
|
21
|
-
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANFdS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 Z
|
14
|
+
cert_chain: []
|
15
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
38
16
|
dependencies: []
|
39
17
|
description: A full featured BSON specification implementation, in Ruby
|
40
18
|
email:
|
@@ -134,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
112
|
version: 1.3.6
|
135
113
|
requirements: []
|
136
114
|
rubyforge_project: bson
|
137
|
-
rubygems_version: 2.2.
|
115
|
+
rubygems_version: 2.2.2
|
138
116
|
signing_key:
|
139
117
|
specification_version: 4
|
140
118
|
summary: Ruby Implementation of the BSON specification
|
checksums.yaml.gz.sig
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
��s]�"{�b)�Иl�j���ℝ]��ٱ�͕C.amh��]e<��ă�u��*+�Q�j�����o��T<C�F���0ޣ*z��f��(����0yA1�}"��KlK��}E��+���h�7qT���R�@��F�ж��M�Ɵ�IɠKF�U�v>C�q>�<�;��`5zW�Z��ӯN���,$\�����یb�S���[�O����O�v0����5B�j�]�n�~��J�E�|
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|