skyfall 0.2.1 → 0.2.2
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/CHANGELOG.md +4 -0
- data/lib/skyfall/car_archive.rb +28 -1
- data/lib/skyfall/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e7396b9d5f8de50025ea41e80b17578607e40aab7bfce17ffd948aa428cdd0f
|
4
|
+
data.tar.gz: 8915e1d9cc0169c9c8bf0c3995f92fd36a14a49cab846c876a766afd92e31ab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb7381a4fd818a6a9e956107dadb51e0a519898eb6b19f94d28cf3c41d2a25775460aace039b2b4713105e46ec5fef9bf9e5595a0170642f3d6cc59da56ca3f
|
7
|
+
data.tar.gz: db58dc53caacf3eda013732b9324bd03be5b93445500beac2b035d5e15273dd6f2f7b59f05887f3dab8518a95809126f31d7a6c79eac9c6760d268fc11cc5a19
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## [0.2.2] - 2023-09-06
|
2
|
+
|
3
|
+
- fixed image CIDs returned in the record JSON as CBOR tag objects (they are now returned decoded to the string form)
|
4
|
+
|
1
5
|
## [0.2.1] - 2023-08-19
|
2
6
|
|
3
7
|
- optimized `WebsocketMessage` parsing performance - lazy parsing of most properties (message decoding should be over 50% faster on average)
|
data/lib/skyfall/car_archive.rb
CHANGED
@@ -32,11 +32,38 @@ module Skyfall
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def section_with_cid(cid)
|
35
|
-
@sections.detect { |s| s.cid == cid }
|
35
|
+
section = @sections.detect { |s| s.cid == cid }
|
36
|
+
|
37
|
+
if section
|
38
|
+
convert_cids(section.body)
|
39
|
+
section.body
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
private
|
39
44
|
|
45
|
+
def convert_cids(object)
|
46
|
+
if object.is_a?(Hash)
|
47
|
+
object.each do |k, v|
|
48
|
+
if v.is_a?(Hash) || v.is_a?(Array)
|
49
|
+
convert_cids(v)
|
50
|
+
elsif v.is_a?(CBOR::Tagged)
|
51
|
+
object[k] = CID.from_cbor_tag(v)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
elsif object.is_a?(Array)
|
55
|
+
object.each_with_index do |v, i|
|
56
|
+
if v.is_a?(Hash) || v.is_a?(Array)
|
57
|
+
convert_cids(v)
|
58
|
+
elsif v.is_a?(CBOR::Tagged)
|
59
|
+
object[i] = CID.from_cbor_tag(v)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
else
|
63
|
+
raise DecodeError, "Unexpected value type in record: #{object}"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
40
67
|
def read_header(buffer)
|
41
68
|
len = buffer.read_varint
|
42
69
|
|
data/lib/skyfall/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skyfall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuba Suder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base32
|