serialbench 0.12.1 → 0.12.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/.github/scripts/push-to-data.sh +23 -5
- data/Gemfile +2 -2
- data/lib/serialbench/serializers/cbor/yeptris_serializer.rb +2 -6
- data/lib/serialbench/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '06086099f5bb25ceb1e784b26ef5a2e66bc0529b4d96beae9a19fa33c8039ef4'
|
|
4
|
+
data.tar.gz: 0f3ab5f9d4fddac28db8f239ba0e2aec955133a91251906177aac8139291d248
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8eb041f1fce782a7a1ba78ac8bb73ecce811174da90b5aadcebf763669013de8925b8970cc76e75d9338ef1ea9f304db53f1b9d4a660712b6fc57883b57370b8
|
|
7
|
+
data.tar.gz: 47257d11443f97212634770660f8a3e2f80e268c48712d3d26d22470d9530f3fe7ab99924a17a1922306d5e8649f0d65aaf60b31d01aa09be969300aa1fb355d
|
|
@@ -31,14 +31,24 @@ echo "Pushing ${TARGET_PATH} to serialbench/data..."
|
|
|
31
31
|
|
|
32
32
|
# Try create; 409 (branch race) and 422 (exists) both retry with fresh sha
|
|
33
33
|
put_file() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
# The body goes through a file: passing it as a curl argument hits the
|
|
35
|
+
# ~32KB exec limit on windows/msys once a results.yaml grows ("Argument
|
|
36
|
+
# list too long" -> curl never runs -> the format silently drops).
|
|
37
|
+
local body
|
|
38
|
+
body=$(mktemp /tmp/push-body.XXXXXX)
|
|
39
|
+
if [ -n "${1:-}" ]; then
|
|
40
|
+
printf '{"message": "%s (update)", "content": "%s", "sha": "%s", "branch": "main"}' \
|
|
41
|
+
"${PLATFORM} ruby-${RUBY_VERSION} ${FMT}" "$CONTENT" "$1" > "$body"
|
|
42
|
+
else
|
|
43
|
+
printf '{"message": "%s", "content": "%s", "branch": "main"}' \
|
|
44
|
+
"${PLATFORM} ruby-${RUBY_VERSION} ${FMT}" "$CONTENT" > "$body"
|
|
45
|
+
fi
|
|
37
46
|
curl -s -o /tmp/data-push-resp.json -w "%{http_code}" -X PUT \
|
|
38
47
|
-H "Authorization: Bearer ${DATA_TOKEN}" \
|
|
39
48
|
-H "Accept: application/vnd.github+json" \
|
|
40
49
|
"https://api.github.com/repos/serialbench/data/contents/${TARGET_PATH}" \
|
|
41
|
-
"$
|
|
50
|
+
--data-binary @"$body" || echo 000
|
|
51
|
+
rm -f "$body"
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
# Sha of the existing data file, empty on any failure — guarded so a dead
|
|
@@ -58,6 +68,12 @@ for TRY in 1 2 3 4 5; do
|
|
|
58
68
|
echo "attempt $TRY got $HTTP_CODE — refetching sha and retrying"
|
|
59
69
|
sleep $((TRY * 3))
|
|
60
70
|
HTTP_CODE=$(put_file "$SHA")
|
|
71
|
+
elif [ "$HTTP_CODE" = "000" ]; then
|
|
72
|
+
# 000 = no HTTP response at all (connection-level blip). Retrying is
|
|
73
|
+
# the only recovery — breaking here silently drops the format.
|
|
74
|
+
echo "attempt $TRY got 000 (no response) — retrying"
|
|
75
|
+
sleep $((TRY * 5))
|
|
76
|
+
HTTP_CODE=$(put_file "")
|
|
61
77
|
else
|
|
62
78
|
break
|
|
63
79
|
fi
|
|
@@ -75,11 +91,13 @@ elif [ "$HTTP_CODE" = "422" ]; then
|
|
|
75
91
|
echo "::warning::422 but couldn't get sha for ${TARGET_PATH}"
|
|
76
92
|
break
|
|
77
93
|
fi
|
|
94
|
+
printf '{"message": "%s (update)", "content": "%s", "sha": "%s", "branch": "main"}' \
|
|
95
|
+
"${PLATFORM} ruby-${RUBY_VERSION} ${FMT}" "$CONTENT" "${SHA}" > /tmp/push-body.json
|
|
78
96
|
UPDATE_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X PUT \
|
|
79
97
|
-H "Authorization: Bearer ${DATA_TOKEN}" \
|
|
80
98
|
-H "Accept: application/vnd.github+json" \
|
|
81
99
|
"https://api.github.com/repos/serialbench/data/contents/${TARGET_PATH}" \
|
|
82
|
-
-
|
|
100
|
+
--data-binary @/tmp/push-body.json)
|
|
83
101
|
[ "$UPDATE_CODE" = "200" ] && break
|
|
84
102
|
echo "update attempt $TRY got $UPDATE_CODE — refetching sha"
|
|
85
103
|
sleep 2
|
data/Gemfile
CHANGED
|
@@ -12,8 +12,8 @@ unless Gem.win_platform? && RUBY_PLATFORM.include?('aarch64')
|
|
|
12
12
|
gem 'libxml-ruby'
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
gem 'leptris', '1.9.
|
|
16
|
-
gem 'yeptris', '0.6.
|
|
15
|
+
gem 'leptris', '1.9.380.1' # parse_html defaults :html4 (nokogiri-parity); :whatwg priced separately
|
|
16
|
+
gem 'yeptris', '0.6.36.0' # JSON + CBOR load/dump; faces load standalone (#300, fixed 0.6.35.2)
|
|
17
17
|
gem 'teptris', '0.3.6.3' # 0.3.x line (native-doc API); Teptris::TOML.load/dump unchanged
|
|
18
18
|
gem 'cbor' # RFC 7049 CBOR codec
|
|
19
19
|
gem 'benchmark' # Removed from stdlib in Ruby 4.0
|
|
@@ -15,13 +15,11 @@ module Serialbench
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def parse(cbor_bytes)
|
|
18
|
-
require 'yeptris'
|
|
19
18
|
require 'yeptris/cbor'
|
|
20
19
|
Yeptris::CBOR.load(cbor_bytes)
|
|
21
20
|
end
|
|
22
21
|
|
|
23
22
|
def generate(object, _options = {})
|
|
24
|
-
require 'yeptris'
|
|
25
23
|
require 'yeptris/cbor'
|
|
26
24
|
Yeptris::CBOR.dump(object)
|
|
27
25
|
end
|
|
@@ -34,10 +32,8 @@ module Serialbench
|
|
|
34
32
|
return @available if defined?(@available)
|
|
35
33
|
|
|
36
34
|
@available = begin
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
# NameError, so always load the parent first.
|
|
40
|
-
require 'yeptris'
|
|
35
|
+
# Faces bootstrap themselves since yeptris 0.6.35.2
|
|
36
|
+
# (yeptris-ruby#300) — standalone requires are safe.
|
|
41
37
|
require 'yeptris/cbor'
|
|
42
38
|
raise LoadError, 'libyeptris has no CBOR support' unless Yeptris::CBOR.available?
|
|
43
39
|
|
data/lib/serialbench/version.rb
CHANGED