leptris 1.9.163.3 → 1.9.163.4

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: eba09fc16aa561683806817a781f554c6cef6cde6a05fc0e578bba10c2184002
4
- data.tar.gz: 6c6b91d6a48cb4c9c9b1afce56d4d4e7e92517e1074fa4f02cb1c7eeb2d9d287
3
+ metadata.gz: 563c1898720e4a4830a4dd15aa33372ea54f9fe36f3f61f78f53783b29bda28d
4
+ data.tar.gz: fa70c8307df2f4ae2cc7db47206ce19088d59c41b4ca8372d3572b6778bc30e0
5
5
  SHA512:
6
- metadata.gz: c48d64aeddda261adb94f951031d88025704445cbb240b7807b9596834fdb60ebc8ef564438bf2c9d69fd96f6d18c121e4576f9e47b0fd54d7aba1d6c10ce095
7
- data.tar.gz: 4b06a2d719fb701186f69a2d8f7d88c06576b46846f3baa6683ee05122a771a42a2dc95e6b4268ec8877fd3e9def85671c2d244a4d4ab896910690c0e91bc1d2
6
+ metadata.gz: 2022e7e5b8490faa476bd04319351c90252507e910994d677bca98f51eb78c6346f56febcf248abb9dbcfaed54a4ec58b654ff40b674ea67d5b9283459fd910a
7
+ data.tar.gz: 3119ce57e8a1ce038c5aad76d72d5ce92cfb3a06a7416f2677fafb824233da229198b51a64b454da73e7d5d1aaa95aa6344755bf0069ae1cf518e6b65e021725
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to Leptris will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.163.4] - 2026-09-15
9
+
10
+ ### Fixed
11
+
12
+ - **`NativeNode#document`** (moxml #213): the TypedData struct
13
+ always held the owning Document but never exposed it — adapters
14
+ routing `native.document` (the Node#document contract) hit
15
+ NoMethodError. Returns the binding Document for the node and
16
+ every descendant.
17
+
8
18
  ## [1.9.163.3] - 2026-09-15
9
19
 
10
20
  ### Fixed
data/Rakefile CHANGED
@@ -28,25 +28,63 @@ CMAKE_FLAGS = %w[
28
28
  -DLEPTRIS_ENABLE_ICONV=OFF
29
29
  ].freeze
30
30
 
31
+ require "tmpdir"
32
+
31
33
  desc "Build libleptris #{LIBLEPTRIS_VERSION} (+ utf8proc) from release tarballs into lib/"
32
34
  task :compile do
35
+ # GitHub tarball downloads intermittently return a non-gzip body
36
+ # (rate-limit/redirect HTML) — the piped curl|tar form then fails
37
+ # with "not in gzip format" and takes the leg down. Download to a
38
+ # file with retries, validate the gzip magic, extract from the
39
+ # file.
40
+ # Whole-cycle retry: a truncated body can still start with the
41
+ # gzip magic (Windows runners) and only fail at tar EOF — refetch
42
+ # on any failure in the chain rather than trusting curl's exit
43
+ # code alone.
44
+ fetch_tarball = lambda do |url, dest_dir|
45
+ attempts = 0
46
+ begin
47
+ attempts += 1
48
+ tgz = File.join(Dir.tmpdir, "leptris-#{Time.now.to_i}-#{rand(1e9)}.tgz")
49
+ begin
50
+ sh "curl -sfL --retry 4 --retry-delay 2 --retry-all-errors -o #{tgz} #{url}"
51
+ magic = File.binread(tgz, 2)
52
+ unless magic.bytes == [0x1f, 0x8b]
53
+ raise "downloaded #{url} is not gzip (got #{magic.bytes.inspect})"
54
+ end
55
+ # GNU tar (Git-bundled, Windows) parses D:/... as a
56
+ # REMOTE host spec ("Cannot connect to D:") — the piped
57
+ # form never had a file argument, so this only surfaces
58
+ # with -o. --force-local is GNU tar; bsdtar (macOS) and
59
+ # plain GNU tar (linux) don't need it but tolerate being
60
+ # skipped.
61
+ local_flag = Gem.win_platform? ? " --force-local" : ""
62
+ sh "tar#{local_flag} -xzf #{tgz} -C #{dest_dir} --strip-components=1"
63
+ ensure
64
+ File.delete(tgz) if File.exist?(tgz)
65
+ end
66
+ rescue StandardError => e
67
+ raise if attempts >= 3
68
+ warn "tarball fetch attempt #{attempts} failed (#{e.message}); retrying"
69
+ retry
70
+ end
71
+ end
72
+
33
73
  version = ENV.fetch("LIBLEPTRIS_VERSION", LIBLEPTRIS_VERSION)
34
74
  build = File.expand_path("tmp/libleptris-#{version}", __dir__)
35
75
  rm_rf(build)
36
76
  mkdir_p(build)
37
- url = "https://api.github.com/repos/leptris/leptris/tarball/v#{version}"
38
- sh "curl -sL #{url} | tar xz -C #{build} --strip-components=1"
77
+ fetch_tarball.call(
78
+ "https://api.github.com/repos/leptris/leptris/tarball/v#{version}", build)
39
79
 
40
80
  # utf8proc: shared build only, @rpath install name, local prefix.
41
81
  u8_dir = File.expand_path("tmp/utf8proc-#{UTF8PROC_VERSION}", __dir__)
42
82
  u8_prefix = File.join(u8_dir, "prefix")
43
83
  rm_rf(u8_dir)
44
84
  mkdir_p(u8_dir)
45
- u8_url = "https://github.com/JuliaStrings/utf8proc/releases/download/v#{UTF8PROC_VERSION}/utf8proc-#{UTF8PROC_VERSION}.tar.gz"
46
- # The piped form is the shape the libleptris fetch already uses —
47
- # the -o file form produced a non-gzip artifact on the Windows
48
- # runners (tar child status 128).
49
- sh "curl -sL #{u8_url} | tar xz -C #{u8_dir} --strip-components=1"
85
+ fetch_tarball.call(
86
+ "https://github.com/JuliaStrings/utf8proc/releases/download/v#{UTF8PROC_VERSION}/utf8proc-#{UTF8PROC_VERSION}.tar.gz",
87
+ u8_dir)
50
88
  sh "cmake -B #{u8_dir}/build -S #{u8_dir} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DUTF8PROC_ENABLE_TESTING=OFF"
51
89
  sh "cmake --build #{u8_dir}/build --config Release -j 4"
52
90
  sh "cmake --install #{u8_dir}/build --prefix #{u8_prefix}"
@@ -467,6 +467,15 @@ static VALUE nn_byte_offset(VALUE self)
467
467
  return ULL2NUM((uint64_t)f_node_offset(n->ptr));
468
468
  }
469
469
 
470
+ /* The owning binding Document (moxml #213: adapters route
471
+ * native.document exactly like Node#document). */
472
+ static VALUE nn_document(VALUE self)
473
+ {
474
+ struct native_node *n;
475
+ TypedData_Get_Struct(self, struct native_node, &nn_type, n);
476
+ return n->document;
477
+ }
478
+
470
479
  static VALUE nn_address(VALUE self)
471
480
  {
472
481
  struct native_node *n;
@@ -840,6 +849,7 @@ void Init_native(void)
840
849
  rb_define_method(c_native_node, "append_child", nn_append_child, 1);
841
850
  rb_define_method(c_native_node, "add_child", nn_append_child, 1);
842
851
  rb_define_method(c_native_node, "address", nn_address, 0);
852
+ rb_define_method(c_native_node, "document", nn_document, 0);
843
853
  rb_define_method(c_native_node, "attributes", nn_attributes, 0);
844
854
  rb_define_method(c_native_node, "line", nn_line, 0);
845
855
  rb_define_method(c_native_node, "byte_offset", nn_byte_offset, 0);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.163.3"
4
+ VERSION = "1.9.163.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.163.3
4
+ version: 1.9.163.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-14 00:00:00.000000000 Z
11
+ date: 2026-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi