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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ca6124578f5055cf214d062c0a571d558461a967ca9c979b80a182293417534
4
- data.tar.gz: e5e52ebe63ea9424e16b673a6ad734eaf40ff2cb7d50e5591cc9ab50de4ab53b
3
+ metadata.gz: '06086099f5bb25ceb1e784b26ef5a2e66bc0529b4d96beae9a19fa33c8039ef4'
4
+ data.tar.gz: 0f3ab5f9d4fddac28db8f239ba0e2aec955133a91251906177aac8139291d248
5
5
  SHA512:
6
- metadata.gz: 410e6a37ed5123c06f8989ddc6a749c4c88b3e24b6074b245378805053fafdcad257dfcd91d5a94cceed70aaf0a40da6b995913061dfe36a54a59ecd5a95bd60
7
- data.tar.gz: 31bce82a87fd8ca1bf244803c059c89c3faace51e870246afa31e3354da1c0602eb560af8d59e441a171af656dc7a97c421f2cf2e8550a2eb508a7d7d541317b
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
- local sha_arg=()
35
- [ -n "${1:-}" ] && sha_arg=(-d "{\"message\": \"${PLATFORM} ruby-${RUBY_VERSION} ${FMT} (update)\", \"content\": \"${CONTENT}\", \"sha\": \"$1\", \"branch\": \"main\"}")
36
- [ -n "${1:-}" ] || sha_arg=(-d "{\"message\": \"${PLATFORM} ruby-${RUBY_VERSION} ${FMT}\", \"content\": \"${CONTENT}\", \"branch\": \"main\"}")
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
- "${sha_arg[@]}" || echo 000
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
- -d "{\"message\": \"${PLATFORM} ruby-${RUBY_VERSION} ${FMT} (update)\", \"content\": \"${CONTENT}\", \"sha\": \"${SHA}\", \"branch\": \"main\"}")
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.379.0' # parse_html defaults :html4 (nokogiri-parity); :whatwg priced separately
16
- gem 'yeptris', '0.6.35.1' # JSON + CBOR load/dump (0.6.35.1 ships the yeptris-ruby#293 fix)
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
- # yeptris/cbor assumes the bootstrap ('yeptris' defines
38
- # Yeptris::Error) — requiring the submodule alone raises
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Serialbench
4
- VERSION = '0.12.1'
4
+ VERSION = '0.12.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serialbench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose