msgpack-inspect 0.1.0 → 0.1.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/.travis.yml +17 -0
- data/lib/msgpack/inspect/inspector.rb +23 -8
- data/lib/msgpack/inspect/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5a3c533c3c23728a626a5f6a92b0ded176cf1cb
|
4
|
+
data.tar.gz: 2a5d4ed28d7d5d02886d3a80ae88571ea966b450
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0748e0b795f82c17b95e44a065e59cea0a7cb23347d1503af7b551320f5c221e5440f468ef023075b460b643aaf9b5871acb63b9dacb1c82d033924d05433da
|
7
|
+
data.tar.gz: d827254fb029595163b033a211bdda005be4fc3eea5b41beb016f8d46f1c690d0284964057113c1d1416e7efb0ee072249a22e2a204dece8a1e62332f75cdf4c
|
data/.travis.yml
ADDED
@@ -204,7 +204,7 @@ module MessagePack
|
|
204
204
|
MAX_INT64 = 2 ** 64
|
205
205
|
|
206
206
|
def generate_int(io, fmt, header, current)
|
207
|
-
if :fixint
|
207
|
+
if fmt == :fixint
|
208
208
|
current[:data] = hex(header)
|
209
209
|
v = header.unpack('C').first
|
210
210
|
if v & 0b11100000 > 0 # negative fixint
|
@@ -232,24 +232,39 @@ module MessagePack
|
|
232
232
|
v1 = io.read(4)
|
233
233
|
v2 = io.read(4)
|
234
234
|
current[:data] = hex(v1) + hex(v2)
|
235
|
-
current[:value] = (v1.unpack('N').first << 32)
|
235
|
+
current[:value] = (v1.unpack('N').first << 32) | v2.unpack('N').first
|
236
236
|
when :int8
|
237
237
|
v = io.read(1)
|
238
238
|
current[:data] = hex(v)
|
239
239
|
current[:value] = v.unpack('c').first
|
240
240
|
when :int16
|
241
|
-
v = io.read(
|
241
|
+
v = io.read(2)
|
242
242
|
current[:data] = hex(v)
|
243
|
-
|
243
|
+
n = v.unpack('n').first
|
244
|
+
if (n & 0x8000) > 0 # negative
|
245
|
+
current[:value] = n - MAX_INT16
|
246
|
+
else
|
247
|
+
current[:value] = n
|
248
|
+
end
|
244
249
|
when :int32
|
245
|
-
v = io.read(
|
250
|
+
v = io.read(4)
|
246
251
|
current[:data] = hex(v)
|
247
|
-
|
252
|
+
n = v.unpack('N').first
|
253
|
+
if n & 0x80000000 > 0 # negative
|
254
|
+
current[:value] = n - MAX_INT32
|
255
|
+
else
|
256
|
+
current[:value] = n
|
257
|
+
end
|
248
258
|
when :int64
|
249
259
|
v1 = io.read(4)
|
250
260
|
v2 = io.read(4)
|
251
261
|
current[:data] = hex(v1) + hex(v2)
|
252
|
-
|
262
|
+
n = (v1.unpack('N').first << 32) | v2.unpack('N').first
|
263
|
+
if n & 0x8000_0000_0000_0000 > 0 # negative
|
264
|
+
current[:value] = n - MAX_INT64
|
265
|
+
else
|
266
|
+
current[:value] = n
|
267
|
+
end
|
253
268
|
else
|
254
269
|
raise "unknown int format #{fmt}"
|
255
270
|
end
|
@@ -290,7 +305,7 @@ module MessagePack
|
|
290
305
|
current[:data] = hex(v)
|
291
306
|
if [:fixstr, :str8, :str16, :str32].include?(fmt)
|
292
307
|
begin
|
293
|
-
current[:value] = v.
|
308
|
+
current[:value] = v.force_encoding('UTF-8')
|
294
309
|
rescue
|
295
310
|
current[:error] = $!.message
|
296
311
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgpack-inspect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -76,6 +76,7 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- ".gitignore"
|
79
|
+
- ".travis.yml"
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE
|
81
82
|
- README.md
|