forme-ruby 0.3.0-aarch64-linux-gnu
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 +7 -0
- data/CHANGELOG.md +123 -0
- data/CODE_OF_CONDUCT.md +18 -0
- data/CONTRIBUTING.md +67 -0
- data/LICENSE +21 -0
- data/NOTICE +5 -0
- data/README.md +72 -0
- data/SECURITY.md +16 -0
- data/THIRD_PARTY_LICENSES.txt +24805 -0
- data/docs/README.md +18 -0
- data/docs/github-setup.md +62 -0
- data/docs/installation.md +45 -0
- data/docs/rails.md +57 -0
- data/docs/releasing.md +98 -0
- data/docs/rendering.md +82 -0
- data/docs/security-exceptions.md +44 -0
- data/examples/hello.rb +6 -0
- data/lib/forme_pdf/errors.rb +7 -0
- data/lib/forme_pdf/native/libforme_pdf_native.so +0 -0
- data/lib/forme_pdf/native.rb +41 -0
- data/lib/forme_pdf/rails.rb +17 -0
- data/lib/forme_pdf/renderer.rb +60 -0
- data/lib/forme_pdf/result.rb +5 -0
- data/lib/forme_pdf/version.rb +6 -0
- data/lib/forme_pdf.rb +25 -0
- metadata +122 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: e178892bd932e7bed24c2338e12b028ef23f573e6ed078fe5d7dfc783c4b656b
|
|
4
|
+
data.tar.gz: b350c8944b6bcd316bf1a1604ff63b16cd732bad7313ffc77a106b8ca97c84c5
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3a9d4d595608e167cdd5e60ae9be2d431e79ce04e922a56d59dfc36728f5213811b26242cfc08a7bce06195ba2b0f91dd8cc693e6f502070ca3aa4716485aaf8
|
|
7
|
+
data.tar.gz: 1a9c4568ff3025269ac3ef8b9f07ae83b52f38a850b4e1fa3d273ec44431a7568eb33aaed73d6f9a6ea9cdc7c8405d6db225222985e49ea71a20943643df2b3a
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.3.0 (2026-12-02)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Native `aarch64-linux-gnu` gem for Linux ARM64 with glibc 2.28 or later,
|
|
8
|
+
built in the pinned UBI 8 arm64 image on native ARM runners. CI installs the
|
|
9
|
+
same package and renders on RHEL 8, 9 and 10, Ubuntu 24.04 and 26.04 and
|
|
10
|
+
Ruby 3.3, 3.4 and 4.0. Releases now promote four packages.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Update the native `base64` dependency to 0.23.1 and the `json` development
|
|
15
|
+
dependency to 3.2.0.
|
|
16
|
+
- Move `actions/checkout` to v7.0.1, `actions/attest-build-provenance` to
|
|
17
|
+
v4.2.2 and `actions/dependency-review-action` to v5.0.1.
|
|
18
|
+
|
|
19
|
+
### Security
|
|
20
|
+
|
|
21
|
+
- The Release workflow runs `sigstore-cli` 0.2.3 and `rubygems-await` 0.5.4
|
|
22
|
+
from `gemfiles/release.gemfile.lock` (exact versions with SHA-256
|
|
23
|
+
checksums, installed frozen before the RubyGems credentials are set)
|
|
24
|
+
instead of `gem exec`, which resolved their dependencies afresh in a job
|
|
25
|
+
holding `id-token: write` (EBA-20638).
|
|
26
|
+
- Pin `ruby/setup-ruby` v1.342.0, `actions/upload-artifact` v7.0.2,
|
|
27
|
+
`actions/download-artifact` v8.0.2, `github/codeql-action` v4.39.3 and
|
|
28
|
+
`actions/attest-build-provenance` v3.2.0 (EBA-20638), and the Ubuntu 24.04
|
|
29
|
+
and 26.04 CI images at their 2026-11-16 digests (EBA-20660). Runtime code and dependencies are
|
|
30
|
+
unchanged.
|
|
31
|
+
|
|
32
|
+
## 0.2.1 (2026-11-10)
|
|
33
|
+
|
|
34
|
+
### Security
|
|
35
|
+
|
|
36
|
+
- Update development dependencies to their patched releases: Action Pack and
|
|
37
|
+
Action View 8.1.4.1, Rack 3.2.8, Nokogiri 1.19.7, Loofah 2.25.3, Crass 1.0.8
|
|
38
|
+
and rails-html-sanitizer 1.7.2. `bundle-audit` reports no advisories. Runtime
|
|
39
|
+
dependencies and the packaged gem's behavior are unchanged.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- Build and release with Bundler and RubyGems 4.0.24.
|
|
44
|
+
- Pin `ruby/setup-ruby` to v1.338.0 and name each pinned action's exact
|
|
45
|
+
release in the workflows.
|
|
46
|
+
|
|
47
|
+
## 0.2.0 (2026-10-20)
|
|
48
|
+
|
|
49
|
+
### Breaking
|
|
50
|
+
|
|
51
|
+
- File image sources (`/`, `./`, `../`) are omitted with a warning unless the new
|
|
52
|
+
`image_root:` option names a directory containing them. Allowed files are
|
|
53
|
+
inlined after checking they are regular files of at most 64 MiB.
|
|
54
|
+
- Font `weight` must be an Integer from 1 to 1000 and `italic` true or false;
|
|
55
|
+
invalid values and non-UTF-8 `css:` or font families raise `ArgumentError`.
|
|
56
|
+
- `FormePDF::Rails#render_forme_pdf` is private, so Rails does not expose it as
|
|
57
|
+
a controller action. Call it from your own actions as before.
|
|
58
|
+
|
|
59
|
+
### Fixed
|
|
60
|
+
|
|
61
|
+
- Rendering deeply nested HTML on a non-main Ruby thread no longer overflows the
|
|
62
|
+
thread's stack and hangs the process. Renders run on a native thread with a
|
|
63
|
+
64 MiB stack, and documents nested deeper than 512 elements raise
|
|
64
|
+
`FormePDF::RenderError`.
|
|
65
|
+
- Failed source builds show Cargo's diagnostics instead of only
|
|
66
|
+
"Forme native build failed".
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
- Require Ruby 3.3 or later. The Ubuntu 24.04 package job installs a pinned
|
|
71
|
+
Ruby 3.3 build in its clean container.
|
|
72
|
+
- State only platform requirements in the README and installation guide.
|
|
73
|
+
- Update the native engine to Forme HTML 0.28.0 at
|
|
74
|
+
`b97dc101b705ea5d7fea6fb1b20fabfb5bd2d63d`; running headers and footers
|
|
75
|
+
no longer inherit `<body>` color and font.
|
|
76
|
+
- Allow the `json` 3.x runtime dependency.
|
|
77
|
+
- Refresh locked Rust and development dependencies and regenerate third-party notices.
|
|
78
|
+
- Publish on a `v*` tag push instead of a manual dispatch. The release promotes
|
|
79
|
+
the tagged commit's CI packages unchanged, attaches them with `SHA256SUMS` to
|
|
80
|
+
the GitHub release, and pushes each to RubyGems with a Sigstore attestation.
|
|
81
|
+
- Re-review native audit exceptions against the new engine revision.
|
|
82
|
+
- CI installs the source gem on macOS as well as Linux, verifies the rustup
|
|
83
|
+
installer checksum and pins the Ubuntu test images by digest.
|
|
84
|
+
|
|
85
|
+
## 0.1.0 (2026-09-18)
|
|
86
|
+
|
|
87
|
+
Released on [GitHub](https://github.com/clearstackio/forme-ruby/releases/tag/v0.1.0)
|
|
88
|
+
and [RubyGems](https://rubygems.org/gems/forme-ruby/versions/0.1.0)
|
|
89
|
+
with identical source and native gems.
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
|
|
93
|
+
- Native HTML-to-PDF rendering with binary output and preserved warnings/pass counts.
|
|
94
|
+
- CSS and local TTF options, typed load/render errors and explicit startup verification.
|
|
95
|
+
- Independent native result ownership, cleanup and concurrent rendering.
|
|
96
|
+
- Optional Rails template adapter with caller-owned permissions and responses.
|
|
97
|
+
- Source and native packaging for macOS ARM64 and Linux AMD64 glibc.
|
|
98
|
+
- Ruby CI across 3.2, 3.3, 3.4 and 4.0; clean source/native package installs
|
|
99
|
+
on Ruby 3.3 and distribution qualification jobs.
|
|
100
|
+
- Public installation, rendering, Rails, development, security and release guides.
|
|
101
|
+
|
|
102
|
+
### Hardened
|
|
103
|
+
|
|
104
|
+
- Preserve result ownership during Ruby thread cancellation and metadata failures.
|
|
105
|
+
- Replace rebuilt libraries atomically and retain runtime-user read permissions.
|
|
106
|
+
- Reject empty package verification runs and missing third-party license text.
|
|
107
|
+
|
|
108
|
+
### Native baseline
|
|
109
|
+
|
|
110
|
+
- Forme HTML 0.24.0 at `f408920e632c59da0651b5b6d32f8c1397477673`.
|
|
111
|
+
- Build toolchain: Rust 1.94.0; target minimums macOS 15 and glibc 2.28.
|
|
112
|
+
- Release commit `266628a` passed the full hosted platform matrix and CodeQL.
|
|
113
|
+
- Published all three packages through trusted publishing; registry downloads
|
|
114
|
+
match the qualified CI and GitHub release artifacts byte-for-byte.
|
|
115
|
+
|
|
116
|
+
### Release preparation
|
|
117
|
+
|
|
118
|
+
- Prepare macOS ARM native packages and a glibc 2.28 Linux AMD64 build, with
|
|
119
|
+
qualification jobs for UBI 8/9/10, Ubuntu 24.04/26.04 and Arch Linux.
|
|
120
|
+
- Add pinned GitHub Actions, dependency/security checks, contribution templates
|
|
121
|
+
and validated trusted publishing with release attestations.
|
|
122
|
+
- Document narrowly scoped native dependency audit exceptions and repository setup.
|
|
123
|
+
- Deduplicate and sort license files so notices match across macOS and Linux.
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Community Code of Conduct
|
|
2
|
+
|
|
3
|
+
Forme Ruby welcomes contributors of every background and experience level.
|
|
4
|
+
Treat people with respect, give specific and constructive feedback, and make
|
|
5
|
+
room for different perspectives. Discuss the code and ideas without attacking
|
|
6
|
+
the person. Respect privacy and use synthetic data in public examples.
|
|
7
|
+
|
|
8
|
+
Harassment, discriminatory language, threats, unwanted sexual attention,
|
|
9
|
+
publishing private information, and sustained disruption are unacceptable.
|
|
10
|
+
These expectations apply in repository discussions, issues, pull requests and
|
|
11
|
+
other spaces where someone represents the project.
|
|
12
|
+
|
|
13
|
+
Report concerns privately to ajaya@clearstack.io. Include relevant links and
|
|
14
|
+
context without sharing more personal information than necessary. Maintainers
|
|
15
|
+
will review reports discreetly, consider the affected people's needs, and may
|
|
16
|
+
request changes, remove content, restrict participation or ban participants.
|
|
17
|
+
Maintainers are expected to follow these standards too. Reporters may request
|
|
18
|
+
reconsideration by replying with additional context.
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Contributing to Forme Ruby
|
|
2
|
+
|
|
3
|
+
This guide covers local builds, verification and the boundary of the public gem.
|
|
4
|
+
Use synthetic documents and assets that can be redistributed.
|
|
5
|
+
|
|
6
|
+
## Set up a checkout
|
|
7
|
+
|
|
8
|
+
Use CRuby 3.3+ and Rust/Cargo 1.94.0, a native linker and make. From the repository:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
bundle install
|
|
12
|
+
bundle exec rake compile
|
|
13
|
+
bundle exec rspec
|
|
14
|
+
cargo test --locked --manifest-path ext/forme_pdf/Cargo.toml
|
|
15
|
+
bundle exec standardrb
|
|
16
|
+
bundle exec bundler-audit check --update
|
|
17
|
+
cargo install cargo-audit --version 0.22.2 --locked
|
|
18
|
+
cargo audit --file ext/forme_pdf/Cargo.lock
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`compile` retains Cargo build output for subsequent development. Source-gem
|
|
22
|
+
installation removes its temporary target directory. Build the extension before
|
|
23
|
+
running Ruby examples; the loader never compiles during `require`.
|
|
24
|
+
|
|
25
|
+
## Understand the code
|
|
26
|
+
|
|
27
|
+
- `lib/forme_pdf.rb` is the public facade; `lib/forme_pdf/` contains loading,
|
|
28
|
+
rendering, immutable results, errors and the explicit Rails adapter.
|
|
29
|
+
- `ext/forme_pdf/` owns the Rust C ABI and locked upstream dependencies.
|
|
30
|
+
- `spec/` tests Ruby behavior and ownership; Rust tests cover the native boundary.
|
|
31
|
+
- `script/` and `.github/workflows/` own notices, installed-package checks and releases.
|
|
32
|
+
|
|
33
|
+
Keep consumer templates, logos, data access and infrastructure conventions out
|
|
34
|
+
of the gem. Preserve per-render ownership, explicit lengths and cleanup in
|
|
35
|
+
`ensure`. Do not introduce global result buffers or runtime downloads.
|
|
36
|
+
|
|
37
|
+
## Test packaging
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
ruby script/notices.rb
|
|
41
|
+
bundle exec rake 'package[source]'
|
|
42
|
+
bundle exec rake 'package[native]'
|
|
43
|
+
ruby script/test_packages.rb
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The installed-package script installs every package in `pkg/` into temporary
|
|
47
|
+
GEM_HOME directories, then renders outside the checkout. Keep only packages for
|
|
48
|
+
the local platform and source in that directory. Pass package filenames as arguments to test only those artifacts.
|
|
49
|
+
It fails if no packages exist.
|
|
50
|
+
CI performs clean source/native installation on the supported platforms.
|
|
51
|
+
|
|
52
|
+
Regenerate and review notices after dependency changes. Notice generation fails
|
|
53
|
+
when a dependency has no license text; documented version-specific fallbacks live
|
|
54
|
+
under `script/licenses/`. Retain fixture font licenses as well.
|
|
55
|
+
|
|
56
|
+
## Submit a change
|
|
57
|
+
|
|
58
|
+
Explain the user-visible behavior, rationale and checks run. Add meaningful
|
|
59
|
+
regression coverage for behavior changes. Use StandardRB and update guides and
|
|
60
|
+
CHANGELOG when the public API, installation or support matrix changes.
|
|
61
|
+
See [release preparation](docs/releasing.md) before packaging a version.
|
|
62
|
+
|
|
63
|
+
Validate workflow changes with `actionlint`. Linux package reproduction uses
|
|
64
|
+
`script/ci/build-linux.sh` inside the pinned UBI 8 image in `ci.yml`; do not run
|
|
65
|
+
that container setup script directly on your workstation. Review
|
|
66
|
+
[security exceptions](docs/security-exceptions.md) whenever dependencies or the
|
|
67
|
+
native API change.
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ajaya Agrawalla
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/NOTICE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
forme-ruby is an independent binding, not an official Forme project.
|
|
2
|
+
Forme: https://github.com/danmolitor/forme
|
|
3
|
+
Pinned revision: b97dc101b705ea5d7fea6fb1b20fabfb5bd2d63d
|
|
4
|
+
Forme is MIT licensed. Native distributions must include upstream and dependency
|
|
5
|
+
license notices generated during their build (see third-party notices).
|
data/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# forme-ruby
|
|
2
|
+
|
|
3
|
+
[](https://github.com/clearstackio/forme-ruby/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Render HTML and print CSS to PDF inside Ruby, using the Rust
|
|
7
|
+
[Forme](https://github.com/danmolitor/forme) engine. No browser, Node.js,
|
|
8
|
+
WebAssembly or separate rendering service is needed.
|
|
9
|
+
|
|
10
|
+
This is an independent MIT-licensed binding maintained by
|
|
11
|
+
[ClearStack](https://github.com/clearstackio), not an official upstream project.
|
|
12
|
+
**[0.3.0 is available on RubyGems](https://rubygems.org/gems/forme-ruby/versions/0.3.0).**
|
|
13
|
+
|
|
14
|
+
## Getting started
|
|
15
|
+
|
|
16
|
+
Add to your Gemfile and run `bundle install`:
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
gem "forme-ruby", "~> 0.3.0", require: "forme_pdf"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or install directly:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
gem install forme-ruby -v 0.3.0
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
RubyGems selects a matching native package where available. The same packages
|
|
29
|
+
and checksums are available in the [GitHub release](https://github.com/clearstackio/forme-ruby/releases/tag/v0.3.0).
|
|
30
|
+
|
|
31
|
+
```ruby
|
|
32
|
+
require "forme_pdf"
|
|
33
|
+
|
|
34
|
+
pdf = FormePDF.render_html("<h1>Hello from Ruby</h1>")
|
|
35
|
+
File.binwrite("hello.pdf", pdf)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Requirements
|
|
39
|
+
|
|
40
|
+
- Ruby 3.3 or later.
|
|
41
|
+
- Native gems: macOS 15+ on Apple Silicon, or Linux AMD64 or ARM64 with glibc
|
|
42
|
+
2.28+.
|
|
43
|
+
- Source gem: Rust/Cargo 1.94.0, a C linker, make and network access to the
|
|
44
|
+
locked upstream dependencies.
|
|
45
|
+
|
|
46
|
+
See the [installation guide](docs/installation.md).
|
|
47
|
+
|
|
48
|
+
## Using Rails
|
|
49
|
+
|
|
50
|
+
Authorize and select application data first, then render explicitly:
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
html = render_to_string(template: "invoices/pdf", layout: "pdf", formats: [:html])
|
|
54
|
+
send_data FormePDF.render_html(html),
|
|
55
|
+
type: "application/pdf", disposition: "inline", filename: "invoice.pdf"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Rails is optional. The [Rails guide](docs/rails.md) also covers the opt-in
|
|
59
|
+
`FormePDF::Rails` adapter. The gem installs no middleware or routes.
|
|
60
|
+
|
|
61
|
+
## Learn more
|
|
62
|
+
|
|
63
|
+
- [Rendering guide](docs/rendering.md): CSS, fonts, diagnostics and error handling.
|
|
64
|
+
- [Development](CONTRIBUTING.md): build, test and contribute.
|
|
65
|
+
- [Community guidelines](CODE_OF_CONDUCT.md): participating respectfully.
|
|
66
|
+
- [Release guide](docs/releasing.md): package qualification and future publication.
|
|
67
|
+
- [Changelog](CHANGELOG.md), [license](LICENSE) and [third-party notices](THIRD_PARTY_LICENSES.txt).
|
|
68
|
+
|
|
69
|
+
Use trusted HTML and assets. Local image files are read only inside an explicit
|
|
70
|
+
`image_root:`, and the engine is not a sandbox for untrusted documents. See [security](SECURITY.md). Report reproducible
|
|
71
|
+
bugs through [GitHub issues](https://github.com/clearstackio/forme-ruby/issues)
|
|
72
|
+
with synthetic input, Ruby/platform versions and renderer diagnostics.
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
Render trusted HTML and caller-selected assets only. Local image files are read
|
|
4
|
+
only inside a caller-supplied `image_root:`, at most 64 MiB each. Rendering
|
|
5
|
+
consumes CPU/memory in the host process, and some layouts, such as deeply nested
|
|
6
|
+
tables, can take far longer than their size suggests. It is not an HTML sandbox;
|
|
7
|
+
thread cancellation is not a reliable rendering timeout.
|
|
8
|
+
|
|
9
|
+
Keep confidential documents out of logs and public issue attachments. Use a
|
|
10
|
+
minimal synthetic reproduction when reporting a problem. Send potential
|
|
11
|
+
security vulnerabilities privately to ajaya@clearstack.io rather than posting
|
|
12
|
+
sensitive details publicly. No response-time guarantee is offered.
|
|
13
|
+
|
|
14
|
+
Dependency audit exceptions and their call-path evidence are recorded in
|
|
15
|
+
[the security review](docs/security-exceptions.md). They must be re-reviewed
|
|
16
|
+
when the pinned engine or public native interface changes.
|