rlp 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rlp/decode.rb +21 -0
- data/lib/rlp/sedes/list.rb +0 -3
- data/lib/rlp/sedes/serializable.rb +0 -3
- data/lib/rlp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb1c99e46dd34a67fd5fa9643202a3a90629a461
|
4
|
+
data.tar.gz: 7831231076cd749b0a9f5b4f4ac46264316366c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db4e9932905f0b8227da5fe2d92451a85339e4a520499c24d80fb7fb5a4d17e4649be51923e9a9a08e1edc60d21344bf38e06d3973e82cdbbfd15a32dd408567
|
7
|
+
data.tar.gz: bebd6210c1d5d9410b3816919dd1e8c848c8151055a30e9f62d57b4d871af04b8bcfbe4cf889a3f1cfb8c6b3344a520b3a69054ff1840b6339b89bb08d2e9581
|
data/lib/rlp/decode.rb
CHANGED
@@ -61,6 +61,27 @@ module RLP
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
def descend(rlp, *path)
|
65
|
+
rlp = str_to_bytes(rlp)
|
66
|
+
|
67
|
+
path.each do |pa|
|
68
|
+
pos = 0
|
69
|
+
|
70
|
+
type, len, pos = consume_length_prefix rlp, pos
|
71
|
+
raise DecodingError.new("Trying to descend through a non-list!", rlp) if type != :list
|
72
|
+
|
73
|
+
pa.times do |i|
|
74
|
+
t, l, s = consume_length_prefix(rlp, pos)
|
75
|
+
pos = l + s
|
76
|
+
end
|
77
|
+
|
78
|
+
t, l, s = consume_length_prefix rlp, pos
|
79
|
+
rlp = rlp[pos...(l+s)]
|
80
|
+
end
|
81
|
+
|
82
|
+
rlp
|
83
|
+
end
|
84
|
+
|
64
85
|
private
|
65
86
|
|
66
87
|
##
|
data/lib/rlp/sedes/list.rb
CHANGED
@@ -56,9 +56,6 @@ module RLP
|
|
56
56
|
begin
|
57
57
|
serializable_sedes.serialize(field_values)
|
58
58
|
rescue ListSerializationError => e
|
59
|
-
puts "Serializable.serialize"
|
60
|
-
puts e
|
61
|
-
puts e.backtrace[0,20].join("\n")
|
62
59
|
raise ObjectSerializationError.new(obj: obj, sedes: self, list_exception: e)
|
63
60
|
end
|
64
61
|
end
|
data/lib/rlp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rlp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Xie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|