kp_anydoc 0.2.4-aarch64-linux
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 +11 -0
- data/LICENSE.txt +21 -0
- data/README.md +69 -0
- data/THIRD-PARTY-LICENSES.txt +2856 -0
- data/lib/anydoc/3.4/anydoc.so +0 -0
- data/lib/anydoc/4.0/anydoc.so +0 -0
- data/lib/anydoc/version.rb +5 -0
- data/lib/anydoc.rb +28 -0
- metadata +115 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 8ab1dc44d68d9daa04bfa05e92871ec6d69e42b4e1aa2732e7f7ba5acd48aef0
|
|
4
|
+
data.tar.gz: e01881b5fe262fbcd8bc68c3db1726064c6f51cb86f4f10ae0d379d01ddd4bd1
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9435472b176e04f9a110adcbe8904dc9a686b7dce27a9e560ba5d4f558b9ad39a8a7e2e54e4517c8789e1dd08bd4a155971bbdd344c649ec05d191ab5fd7fe28
|
|
7
|
+
data.tar.gz: d1ac9167e82614703680fe3bd059cb19be7165c4ef46f69b45dcb4fb124c5f289893822eebe8a3ea4cbdb7e9c9a456fd41f327faba3f71113b358dfffa8f4585
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Versions track the [`anydoc`](https://crates.io/crates/anydoc) Rust crate this gem wraps: `kp_anydoc` 0.2.4 wraps `anydoc` 0.2.4.
|
|
4
|
+
|
|
5
|
+
## [0.2.4] - Unreleased
|
|
6
|
+
|
|
7
|
+
- Initial release of `kp_anydoc`, wrapping the `anydoc` Rust crate 0.2.4.
|
|
8
|
+
- `Anydoc.to_markdown(bytes, filename:)` converts document bytes to Markdown.
|
|
9
|
+
- Typed errors: `Anydoc::UnsupportedError`, `MalformedError`, `EncryptedError`, `ResourceLimitError`, `MissingPartError`, `IoError`.
|
|
10
|
+
- Precompiled native gems published for `x86_64-linux`, `aarch64-linux`, `x86_64-linux-musl`, and `arm64-darwin`, each carrying a Ruby 3.4 and 4.0 extension, with a source gem fallback.
|
|
11
|
+
- Bundles `THIRD-PARTY-LICENSES.txt`, generated from the Rust dependency tree, so the compiled extension ships its linked-in dependencies' attribution.
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KirkpatrickPrice
|
|
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/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# kp_anydoc
|
|
2
|
+
|
|
3
|
+
Ruby bindings for the [`anydoc`](https://crates.io/crates/anydoc) Rust library. Converts documents (PDF, XLSX, CSV, and more) to Markdown in-process — no external service, conversions complete in milliseconds.
|
|
4
|
+
|
|
5
|
+
The gem is published on RubyGems as **`kp_anydoc`** but is required as **`anydoc`** and exposes the **`Anydoc`** module.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem "kp_anydoc"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires **Ruby 3.4 or newer**. The gem version tracks the [`anydoc`](https://crates.io/crates/anydoc) Rust crate it wraps — `kp_anydoc` 0.2.4 wraps `anydoc` 0.2.4. Precompiled native gems are published for the platforms below, each carrying a Ruby 3.4 and 4.0 extension, so installs need no Rust toolchain:
|
|
14
|
+
|
|
15
|
+
- `x86_64-linux`
|
|
16
|
+
- `aarch64-linux`
|
|
17
|
+
- `x86_64-linux-musl`
|
|
18
|
+
- `arm64-darwin`
|
|
19
|
+
|
|
20
|
+
On any other platform, the source gem compiles on install and requires a Rust toolchain (`cargo`) plus `libclang`.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
require "anydoc"
|
|
26
|
+
|
|
27
|
+
markdown = Anydoc.to_markdown(File.binread("report.pdf"), filename: "report.pdf")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`filename:` is used to detect the format from its extension. On failure a typed error is raised:
|
|
31
|
+
|
|
32
|
+
| Error | Meaning |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `Anydoc::UnsupportedError` | The format isn't recognized or supported. |
|
|
35
|
+
| `Anydoc::MalformedError` | The file is corrupt or unparseable. |
|
|
36
|
+
| `Anydoc::EncryptedError` | The file is password-protected. |
|
|
37
|
+
| `Anydoc::ResourceLimitError` | The file exceeded a processing limit. |
|
|
38
|
+
| `Anydoc::MissingPartError` | A required internal part was missing. |
|
|
39
|
+
| `Anydoc::IoError` | An I/O error occurred while reading. |
|
|
40
|
+
|
|
41
|
+
All inherit from `Anydoc::Error`.
|
|
42
|
+
|
|
43
|
+
## Development
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
bin/setup # bundle install
|
|
47
|
+
bundle exec rake compile # build the Rust extension
|
|
48
|
+
bundle exec rake spec # run the tests (compiles first)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Requires a Rust toolchain (`cargo`, `rustc`) and `libclang`.
|
|
52
|
+
|
|
53
|
+
## Releasing
|
|
54
|
+
|
|
55
|
+
Precompiled native gems are cross-compiled and published by the `Release` workflow. The per-platform binaries can only be built in CI (you can't build a Linux/musl gem on a Mac), so releasing runs through GitHub Actions rather than a local `gem push`.
|
|
56
|
+
|
|
57
|
+
One-time setup: on RubyGems.org, register a [trusted publisher](https://guides.rubygems.org/trusted-publishing/) for `kp_anydoc` pointing at this repository (`kirkpatrickprice/anydoc`) and the `release.yml` workflow. RubyGems lets you register a publisher for a gem that does not exist yet; the first release claims the name. No API key or repository secret is stored, and your account MFA can stay at "UI and API".
|
|
58
|
+
|
|
59
|
+
To cut a release:
|
|
60
|
+
|
|
61
|
+
1. Bump `anydoc_core` in `ext/anydoc/Cargo.toml` to the crate version you're wrapping, set `Anydoc::VERSION` in `lib/anydoc/version.rb` to that same version, and update `CHANGELOG.md`. The gem version always mirrors the crate version.
|
|
62
|
+
2. Commit, tag, and create a GitHub Release for the tag.
|
|
63
|
+
3. The `Release` workflow generates `THIRD-PARTY-LICENSES.txt` from the Rust dependency tree, builds a native gem per platform (`arm64-darwin`, `aarch64-linux`, `x86_64-linux`, `x86_64-linux-musl`, each carrying a Ruby 3.4 and 4.0 extension — see `CROSS_RUBIES` in the Rakefile for why more than one ABI is built), builds a source-gem fallback, smoke-tests the native gems, and pushes them all to RubyGems via OIDC.
|
|
64
|
+
|
|
65
|
+
Run the workflow manually (`workflow_dispatch`) for a dry run: it builds and tests everything but skips publishing.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
`kp_anydoc` is released under the MIT license (`LICENSE.txt`). The compiled extension statically links third-party Rust crates (MIT, Apache-2.0, BSD-3-Clause, ISC, Zlib, Unicode-3.0); their attribution is reproduced in `THIRD-PARTY-LICENSES.txt`, generated at release time and bundled into every published gem. Regenerate it locally with `cargo about generate -c about.toml -m ext/anydoc/Cargo.toml -o THIRD-PARTY-LICENSES.txt about.hbs`.
|