pdfrb 0.6.0 → 0.7.1

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: 6f24b6c90eb4e01436139908a7aaa0472ed8a22704e40e934f651c0265763d62
4
- data.tar.gz: da4e7fc8a4f9c4cecbbf22ca2ab2288ca8f07c4bc974dc6eac8b2166fb784d94
3
+ metadata.gz: 14c300c425848b557b210be218c07de40adbb5188e0c36c15d7d72336395d7c9
4
+ data.tar.gz: 672e663a9efe0991f97aceda226a1fa909ef804d8dd2a94e1cb7f2df4d1cd1c8
5
5
  SHA512:
6
- metadata.gz: 550b8e52600d4ebe1cffbce341d0725d750a41ba8585c1b85c827f9c7a4b6fda7e24d6dd6f3c2ed6f5f83e442729e792f3fef05a9d34459118a9720d039bf3bb
7
- data.tar.gz: c950a24d0cf3af6734edbe2819d0390c07442fa941e026be4744fb6db0e02beadc4e3d2ac220fbb5d4f52eee67bc3e9d19e03602dabaaefdf65929ecbe1a61d3
6
+ metadata.gz: 18c8b3c2c2a15a4fd6dff6f8d58c4403e2e23067f9ad8c655e4a8fe5d43678d748f8d0378eddfc92c9d98f118b710887c0bf95374756088f4885461373d1e30c
7
+ data.tar.gz: cfcbe27e32085ad4a9e753645a8e56571630c230f69aae6f289c7d618bc23bba98b49830be6e01a5317de922f78faba5ec3b1d106436dd75cf600872ab5e75e1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,57 @@
2
2
 
3
3
  All notable changes to the pdfrb gem will be documented in this file.
4
4
 
5
+ ## [0.7.0] — 2026-08-08
6
+
7
+ ### Added — Release infrastructure
8
+
9
+ * `.github/workflows/rake.yml` — Metanorma CI generic-rake workflow
10
+ for tests on every push, PR, tag, and dispatch.
11
+ * `.github/workflows/release.yml` — Metanorma CI rubygems-release
12
+ workflow driven by `workflow_dispatch` with `next_version` input
13
+ or `repository_dispatch` of type `do-release`.
14
+ * `RELEASE.md` — documents the publish flow and required secrets.
15
+
16
+ ### Added — Image subsystem
17
+
18
+ * `Pdfrb::Image::Audit` — read-only metadata extractor (ImageInfo
19
+ struct per image XObject) with `each_image`, `all`, `oversized`
20
+ helpers.
21
+ * `Pdfrb::Image::Downsampler` — pure-Ruby nearest-neighbour for
22
+ FlateDecode-encoded 8-bpc non-palette images. PNG predictor
23
+ round-trip on both decode and encode. JPEG/JP2K skipped (no
24
+ native deps).
25
+ * `Pdfrb::Task::Optimize#downsample_images!(factor:)` — applies the
26
+ downsampler across every image XObject in the document.
27
+
28
+ ### Added — Layout bidi
29
+
30
+ * `Pdfrb::Layout::Bidi` — paragraph-level UAX #9 bidi reordering
31
+ (P2-P3 paragraph level, BD1 type classification, I1/I2 implicit
32
+ levels, L2 reverse by level, L4 paired-bracket mirroring).
33
+ * `Pdfrb::Layout::TextLayouter#layout` calls `Bidi.reorder` before
34
+ line breaking, so Hebrew and Arabic render in visual order.
35
+
36
+ ### Fixed
37
+
38
+ * Issue #63: `Document::Fonts#add` now extracts the PostScript name
39
+ (name table nameID 6) and uses it in `/BaseFont` (e.g.
40
+ `ABCDEF+MinionPro-Regular` instead of `ABCDEF+EmbeddedFont3132`).
41
+ * Issue #64: `Model::Type::Resources#empty?` handles Hash, Array,
42
+ Cos::Dictionary, and PdfArray values via a single
43
+ `empty_collection?` helper.
44
+
45
+ ### Changed
46
+
47
+ * `Pdfrb::Task::Optimize.dedup_streams!` now actually rewrites
48
+ references to duplicate streams (was a stub).
49
+ * `Pdfrb::Writer#write_xref_stream` emits a free entry for every
50
+ gap in the oid space, so dedup'd oids don't misalign the reader's
51
+ per-oid index.
52
+ * `Pdfrb::Document::Form#flatten!` stamps each field's `/AP /N`
53
+ appearance stream into the page content via the `/Do` operator
54
+ (was a stubbed no-op).
55
+
5
56
  ## [0.3.0] — 2026-08-02
6
57
 
7
58
  ### Added — Semantic PDF diff
data/RELEASE.md CHANGED
@@ -1,48 +1,61 @@
1
1
  # Releasing pdfrb
2
2
 
3
- Releases are driven by git tags. The release workflow is at
4
- `.github/workflows/release.yml` and runs on tag push (or manual dispatch
5
- for an existing tag).
3
+ Releases are driven by the Metanorma CI reusable workflow at
4
+ `.github/workflows/release.yml`. It supports two triggers:
6
5
 
7
- ## Publish flow
6
+ 1. **`workflow_dispatch`** with a `next_version` input — manual run
7
+ from the Actions UI. Accepted values: `x.y.z`, `major`, `minor`,
8
+ `patch`, or `pre|rc|etc` to bump to a prerelease.
9
+ 2. **`repository_dispatch`** with event type `do-release` — for
10
+ automation triggers from other repos.
8
11
 
9
- 1. Ensure `lib/pdfrb/version.rb` has the target version.
10
- 2. Merge the version-bump change via a PR (never commit directly to main).
11
- 3. When the PR lands, tag the merged commit:
12
+ Both call
13
+ [`metanorma/ci/.github/workflows/rubygems-release.yml@main`](https://github.com/metanorma/ci/blob/main/.github/workflows/rubygems-release.yml),
14
+ which handles version bumping, tag creation, gem build, RubyGems
15
+ publish, and GitHub release creation.
12
16
 
13
- ```sh
14
- git tag v$(ruby -Ilib -e 'require "pdfrb/version"; print Pdfrb::VERSION')
15
- git push origin v<VERSION>
16
- ```
17
+ ## Required secrets
17
18
 
18
- 4. The `Release` workflow fires automatically:
19
- - Verifies tag `lib/pdfrb/version.rb` match.
20
- - Builds the gem (`bundle exec rake build`).
21
- - Publishes to RubyGems via OIDC trusted publishing (no stored API key).
22
- - Creates a GitHub release with auto-generated notes.
19
+ * `CLARICLE_CI_RUBYGEMS_API_KEY` RubyGems API key with `push`
20
+ permission on the `pdfrb` gem. Set in repo Settings → Secrets and
21
+ Variables Actions.
22
+ * `GITHUB_TOKEN` automatic; used for creating the GitHub release.
23
23
 
24
- ## Trusted publishing (OIDC)
24
+ ## Triggering a release
25
25
 
26
- The workflow uses `rubygems/configure-rubygems-credentials` with OIDC.
27
- To enable, on RubyGems:
26
+ ### From the Actions UI
28
27
 
29
- 1. Open the `pdfrb` gem settings.
30
- 2. Add the GitHub workflow as a trusted publisher:
31
- - Repository: `claricle/pdfrb`
32
- - Workflow filename: `release.yml`
33
- - Environment: (leave blank)
28
+ 1. Go to Actions → `release` workflow.
29
+ 2. Click "Run workflow".
30
+ 3. Enter the next version (e.g., `0.7.0`, `patch`, `minor`, `major`).
31
+ 4. Click "Run workflow".
34
32
 
35
- Until that is configured, the `Publish to RubyGems` step will fail.
33
+ ### From the API / CI
36
34
 
37
- ## Manual dispatch
35
+ ```sh
36
+ gh workflow run release.yml \
37
+ -f next_version=0.7.0
38
+ ```
38
39
 
39
- The workflow accepts a `tag` input. Run it from the Actions UI on a
40
- previously-pushed tag if the auto-trigger missed (e.g., the workflow
41
- file was added after the tag was pushed).
40
+ Or via `repository_dispatch` from another repo:
41
+
42
+ ```sh
43
+ gh api /repos/claricle/pdfrb/dispatches \
44
+ -f event_type=do-release \
45
+ -f 'client_payload[next_version]=0.7.0'
46
+ ```
47
+
48
+ ## CI (test) workflow
49
+
50
+ `.github/workflows/rake.yml` runs the standard Metanorma CI
51
+ generic-rake workflow on every push to `main`/`master`, every tag
52
+ push, every pull request, and via manual `workflow_dispatch`. It
53
+ fires the test matrix across supported Ruby versions.
42
54
 
43
55
  ## Pre-release checklist
44
56
 
45
- - `bundle exec rake` is green.
46
- - `lib/pdfrb/version.rb` matches the intended tag.
47
- - `CHANGELOG.md` has an entry for the new version.
48
- - No uncommitted changes on `main`.
57
+ * `bundle exec rake` is green locally.
58
+ * `lib/pdfrb/version.rb` matches the intended release (the release
59
+ workflow handles this automatically when given `next_version`).
60
+ * `CHANGELOG.md` has an entry for the new version.
61
+ * No uncommitted changes on `main`.