cbor 0.5.9.2 → 0.5.9.3
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 +5 -5
- data/.travis.yml +5 -3
- data/README.rdoc +1 -1
- data/ext/cbor/packer.h +1 -1
- data/lib/cbor/version.rb +1 -1
- data/spec/format_spec.rb +44 -40
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 425cc6f7340767f49e322a3762368f24be166a9c7286b2de39a40e70f936e4c9
|
4
|
+
data.tar.gz: ce9edfb609f86a6922fe7eb6746acc06c78db474cc4d9414731ef82a2f02b16e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c6280839cfc5d0579a08c19b80eedeb2c9039d212907e21321cd0f77d88331b736f4fbda6bed1d7411b1e255f5952edfd3ddcb540d663212a92016bc2c60263
|
7
|
+
data.tar.gz: 2d0b265557125d652821b75c8fa8b5f9ebd761e6236d5503cc53a709b0ee1be95195f0026aca1d651e728272c9450c4603026f8145225a431eff2f1981f37a9a
|
data/.travis.yml
CHANGED
data/README.rdoc
CHANGED
@@ -37,7 +37,7 @@ Todos:
|
|
37
37
|
get some documentation in the directory +doc+ (see +index.html+ there).
|
38
38
|
|
39
39
|
* Cover more rubies.
|
40
|
-
* \[✔✔✔✔] tested on MRI (1.9.3, 2.0.0, 2.1.
|
40
|
+
* \[✔✔✔✔] tested on MRI (1.9.3, 2.0.0, 2.1.10, 2.2.10, 2.3.7, 2.4.4 and 2.5.1).
|
41
41
|
* (\[✔] There now also is some basic MRI 1.8.7 compatibility, however 1.8.7 does not support differentiation between byte and text strings.)
|
42
42
|
* \[✔] tested on Rubinius 2.4.1.
|
43
43
|
* \[_] Publish the pure-ruby version and make it work the same way on JRuby.
|
data/ext/cbor/packer.h
CHANGED
@@ -171,7 +171,7 @@ static inline void msgpack_packer_write_double(msgpack_packer_t* pk, double v)
|
|
171
171
|
castbuf.u32 = _msgpack_be_float(castbuf.u32);
|
172
172
|
msgpack_buffer_write_byte_and_data(PACKER_BUFFER_(pk), IB_FLOAT4, castbuf.mem, 4);
|
173
173
|
} else if (v != v) { /* NaN */
|
174
|
-
cbor_encoder_write_head(pk, 0xe0,
|
174
|
+
cbor_encoder_write_head(pk, 0xe0, 0x7e00);
|
175
175
|
} else {
|
176
176
|
msgpack_buffer_ensure_writable(PACKER_BUFFER_(pk), 9);
|
177
177
|
union {
|
data/lib/cbor/version.rb
CHANGED
data/spec/format_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# encoding:
|
1
|
+
# encoding: utf-8
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
def bignum_to_bytes(bn)
|
@@ -150,85 +150,89 @@ describe MessagePack do
|
|
150
150
|
end
|
151
151
|
|
152
152
|
it "nil" do
|
153
|
-
match nil, "\xf6"
|
153
|
+
match nil, "\xf6".b
|
154
154
|
end
|
155
155
|
|
156
156
|
it "false" do
|
157
|
-
match false, "\xf4"
|
157
|
+
match false, "\xf4".b
|
158
158
|
end
|
159
159
|
|
160
160
|
it "true" do
|
161
|
-
match true, "\xf5"
|
161
|
+
match true, "\xf5".b
|
162
162
|
end
|
163
163
|
|
164
164
|
it "0" do
|
165
|
-
match 0, "\x00"
|
165
|
+
match 0, "\x00".b
|
166
166
|
end
|
167
167
|
|
168
168
|
it "127" do
|
169
|
-
match 127, "\x18\x7f"
|
169
|
+
match 127, "\x18\x7f".b
|
170
170
|
end
|
171
171
|
|
172
172
|
it "128" do
|
173
|
-
match 128, "\x18\x80"
|
173
|
+
match 128, "\x18\x80".b
|
174
174
|
end
|
175
175
|
|
176
176
|
it "256" do
|
177
|
-
match 256, "\x19\x01\x00"
|
177
|
+
match 256, "\x19\x01\x00".b
|
178
178
|
end
|
179
179
|
|
180
180
|
it "-1" do
|
181
|
-
match -1, "\x20"
|
181
|
+
match -1, "\x20".b
|
182
182
|
end
|
183
183
|
|
184
184
|
it "-33" do
|
185
|
-
match -33, "\x38\x20"
|
185
|
+
match -33, "\x38\x20".b
|
186
186
|
end
|
187
187
|
|
188
188
|
it "-129" do
|
189
|
-
match -129, "\x38\x80"
|
189
|
+
match -129, "\x38\x80".b
|
190
190
|
end
|
191
191
|
|
192
192
|
it "-257" do
|
193
|
-
match -257, "\x39\x01\x00"
|
193
|
+
match -257, "\x39\x01\x00".b
|
194
194
|
end
|
195
195
|
|
196
196
|
it "{1=>1}" do
|
197
197
|
obj = {1=>1}
|
198
|
-
match obj, "\xA1\x01\x01"
|
198
|
+
match obj, "\xA1\x01\x01".b
|
199
199
|
end
|
200
200
|
|
201
201
|
it "1.0" do
|
202
|
-
match 1.0, "\xF9\x3c\x00"
|
202
|
+
match 1.0, "\xF9\x3c\x00".b
|
203
|
+
end
|
204
|
+
|
205
|
+
it "NaN" do
|
206
|
+
match Float::NAN, "\xF9\x7e\x00".b
|
203
207
|
end
|
204
208
|
|
205
209
|
it "[]" do
|
206
|
-
match [], "\x80"
|
210
|
+
match [], "\x80".b
|
207
211
|
end
|
208
212
|
|
209
213
|
it "[0, 1, ..., 14]" do
|
210
214
|
obj = (0..14).to_a
|
211
|
-
match obj, "\x8f\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e"
|
215
|
+
match obj, "\x8f\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e".b
|
212
216
|
end
|
213
217
|
|
214
218
|
it "[0, 1, ..., 15]" do
|
215
219
|
obj = (0..15).to_a
|
216
|
-
match obj, "\x90\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
|
220
|
+
match obj, "\x90\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f".b
|
217
221
|
end
|
218
222
|
|
219
223
|
it "[0, 1, ..., 22]" do
|
220
224
|
obj = (0..22).to_a
|
221
|
-
match obj, "\x97\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16"
|
225
|
+
match obj, "\x97\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16".b
|
222
226
|
end
|
223
227
|
|
224
228
|
it "[0, 1, ..., 23]" do
|
225
229
|
obj = (0..23).to_a
|
226
|
-
match obj, "\x98\x18\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17"
|
230
|
+
match obj, "\x98\x18\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17".b
|
227
231
|
end
|
228
232
|
|
229
233
|
it "{}" do
|
230
234
|
obj = {}
|
231
|
-
match obj, "\xA0"
|
235
|
+
match obj, "\xA0".b
|
232
236
|
end
|
233
237
|
|
234
238
|
it "very simple bignums" do
|
@@ -265,26 +269,26 @@ describe MessagePack do
|
|
265
269
|
end
|
266
270
|
|
267
271
|
it "fixnum/bignum switch" do
|
268
|
-
CBOR.encode(CBOR.decode("\xc2\x40")).should == "\x00"
|
269
|
-
CBOR.encode(CBOR.decode("\xc2\x41\x00")).should == "\x00"
|
270
|
-
CBOR.encode(CBOR.decode("\xc2\x41a")).should == "\x18a"
|
271
|
-
CBOR.encode(CBOR.decode("\xc2\x42aa")).should == "\x19aa"
|
272
|
-
CBOR.encode(CBOR.decode("\xc2\x43aaa")).should == "\x1A\x00aaa"
|
273
|
-
CBOR.encode(CBOR.decode("\xc2\x44aaaa")).should == "\x1Aaaaa"
|
274
|
-
CBOR.encode(CBOR.decode("\xc2\x45aaaaa")).should == "\e\x00\x00\x00aaaaa"
|
275
|
-
CBOR.encode(CBOR.decode("\xc2\x46aaaaaa")).should == "\e\x00\x00aaaaaa"
|
276
|
-
CBOR.encode(CBOR.decode("\xc2\x47aaaaaaa")).should == "\e\x00aaaaaaa"
|
277
|
-
CBOR.encode(CBOR.decode("\xc2\x48aaaaaaaa")).should == "\eaaaaaaaa"
|
278
|
-
CBOR.encode(CBOR.decode("\xc2\x49\x00aaaaaaaa")).should == "\eaaaaaaaa"
|
279
|
-
CBOR.encode(CBOR.decode("\xc2\x49aaaaaaaaa")).should == "\xC2Iaaaaaaaaa"
|
280
|
-
CBOR.encode(CBOR.decode("\xc2\x4a\x00aaaaaaaaa")).should == "\xC2Iaaaaaaaaa"
|
281
|
-
CBOR.encode(CBOR.decode("\xc2\x4aaaaaaaaaaa")).should == "\xC2Jaaaaaaaaaa"
|
282
|
-
CBOR.encode(CBOR.decode("\xc2\x4b\x00aaaaaaaaaa")).should == "\xC2Jaaaaaaaaaa"
|
283
|
-
CBOR.encode(CBOR.decode("\xc2\x4baaaaaaaaaaa")).should == "\xC2Kaaaaaaaaaaa"
|
284
|
-
CBOR.encode(CBOR.decode("\xc2\x4c\x00aaaaaaaaaaa")).should == "\xC2Kaaaaaaaaaaa"
|
285
|
-
CBOR.encode(CBOR.decode("\xc2\x4caaaaaaaaaaaa")).should == "\xC2Laaaaaaaaaaaa"
|
286
|
-
CBOR.encode(CBOR.decode("\xc2\x4d\x00aaaaaaaaaaaa")).should == "\xC2Laaaaaaaaaaaa"
|
287
|
-
CBOR.encode(CBOR.decode("\xc2\x4daaaaaaaaaaaaa")).should == "\xC2Maaaaaaaaaaaaa"
|
272
|
+
CBOR.encode(CBOR.decode("\xc2\x40")).should == "\x00".b
|
273
|
+
CBOR.encode(CBOR.decode("\xc2\x41\x00")).should == "\x00".b
|
274
|
+
CBOR.encode(CBOR.decode("\xc2\x41a")).should == "\x18a".b
|
275
|
+
CBOR.encode(CBOR.decode("\xc2\x42aa")).should == "\x19aa".b
|
276
|
+
CBOR.encode(CBOR.decode("\xc2\x43aaa")).should == "\x1A\x00aaa".b
|
277
|
+
CBOR.encode(CBOR.decode("\xc2\x44aaaa")).should == "\x1Aaaaa".b
|
278
|
+
CBOR.encode(CBOR.decode("\xc2\x45aaaaa")).should == "\e\x00\x00\x00aaaaa".b
|
279
|
+
CBOR.encode(CBOR.decode("\xc2\x46aaaaaa")).should == "\e\x00\x00aaaaaa".b
|
280
|
+
CBOR.encode(CBOR.decode("\xc2\x47aaaaaaa")).should == "\e\x00aaaaaaa".b
|
281
|
+
CBOR.encode(CBOR.decode("\xc2\x48aaaaaaaa")).should == "\eaaaaaaaa".b
|
282
|
+
CBOR.encode(CBOR.decode("\xc2\x49\x00aaaaaaaa")).should == "\eaaaaaaaa".b
|
283
|
+
CBOR.encode(CBOR.decode("\xc2\x49aaaaaaaaa")).should == "\xC2Iaaaaaaaaa".b
|
284
|
+
CBOR.encode(CBOR.decode("\xc2\x4a\x00aaaaaaaaa")).should == "\xC2Iaaaaaaaaa".b
|
285
|
+
CBOR.encode(CBOR.decode("\xc2\x4aaaaaaaaaaa")).should == "\xC2Jaaaaaaaaaa".b
|
286
|
+
CBOR.encode(CBOR.decode("\xc2\x4b\x00aaaaaaaaaa")).should == "\xC2Jaaaaaaaaaa".b
|
287
|
+
CBOR.encode(CBOR.decode("\xc2\x4baaaaaaaaaaa")).should == "\xC2Kaaaaaaaaaaa".b
|
288
|
+
CBOR.encode(CBOR.decode("\xc2\x4c\x00aaaaaaaaaaa")).should == "\xC2Kaaaaaaaaaaa".b
|
289
|
+
CBOR.encode(CBOR.decode("\xc2\x4caaaaaaaaaaaa")).should == "\xC2Laaaaaaaaaaaa".b
|
290
|
+
CBOR.encode(CBOR.decode("\xc2\x4d\x00aaaaaaaaaaaa")).should == "\xC2Laaaaaaaaaaaa".b
|
291
|
+
CBOR.encode(CBOR.decode("\xc2\x4daaaaaaaaaaaaa")).should == "\xC2Maaaaaaaaaaaaa".b
|
288
292
|
end
|
289
293
|
|
290
294
|
it "a-non-ascii" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.9.
|
4
|
+
version: 0.5.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann, standing on the tall shoulders of Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
176
|
version: '0'
|
177
177
|
requirements: []
|
178
178
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.6
|
179
|
+
rubygems_version: 2.7.6
|
180
180
|
signing_key:
|
181
181
|
specification_version: 4
|
182
182
|
summary: CBOR, Concise Binary Object Representation.
|