Skip to content

Bootstrap Lasem Ruby wrapper gem#1

Merged
ronaldtse merged 12 commits into
chore/add-cifrom
feat/bootstrap-lasem-wrapper
Jun 25, 2026
Merged

Bootstrap Lasem Ruby wrapper gem#1
ronaldtse merged 12 commits into
chore/add-cifrom
feat/bootstrap-lasem-wrapper

Conversation

@suleman-uzair

Copy link
Copy Markdown
Member

Summary

Refs plurimath/plurimath#279

This bootstraps the lasem Ruby gem as a native wrapper around the Lasem C renderer.

  • Add the initial gem structure, gemspec, executable, rake integration, docs, and specs.
  • Add a native extension for rendering Lasem-supported XML/MathML/SVG/TeX input.
  • Add Lasem.render(...) as the public Ruby API with explicit input_type and output_format options.
  • Add option validation and dedicated custom error classes.
  • Add native dependency loading with a stub fallback when Lasem is unavailable.
  • Add vendored/system Lasem discovery and vendored Meson build support.
  • Add lasem-doctor dependency diagnostics for local setup troubleshooting.
  • Package runtime Ruby files, native extension sources, and required vendored Lasem build files via git ls-files --recurse-submodules.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bootstraps a new lasem Ruby gem that wraps the Lasem C renderer via a native extension, providing a single public entry point (Lasem.render) plus tooling for dependency discovery/build (vendored Meson build + lasem-doctor) and initial specs/docs.

Changes:

  • Add Ruby API layer (Lasem.render, option validation, error classes) and native loader behavior (real vs stub extension).
  • Add native C extension implementation (SVG/PNG/PDF/PS rendering) plus extconf logic for vendored/system Lasem discovery and optional vendored build.
  • Add dependency diagnostics (Lasem::DependencyDoctor, CLI executable) and Rake tasks/docs/specs.

Reviewed changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
spec/lasem/renderer_spec.rb Adds rendering/option validation specs (including native-only expectations).
spec/lasem/option_error_spec.rb Adds specs for Lasem::OptionError builders.
spec/lasem/dependency_doctor_spec.rb Adds specs for dependency doctor reporting and CLI status codes.
spec/lasem_spec.rb Verifies top-level API surface (native_available?, render) and absence of shortcuts.
README.adoc Documents gem purpose, API usage, vendored/system dependency strategy, and setup steps.
rakelib/lasem.rake Adds Meson-based vendored Lasem build tasks and a doctor task.
Rakefile Adds rake-compiler integration and sets default task to compile + spec.
lib/lasem/renderer.rb Implements Lasem::Renderer wrapper around native rendering.
lib/lasem/render_options.rb Implements option normalization/validation and native argument shaping.
lib/lasem/native_loader.rb Implements extension discovery/loading and native availability checks.
lib/lasem/error.rb Introduces base error class.
lib/lasem/error/render_error.rb Adds render error type for native/render failures.
lib/lasem/error/option_error.rb Adds structured option validation errors.
lib/lasem/error/dependency_error.rb Adds dependency error with actionable diagnostic messaging.
lib/lasem/dependency_doctor.rb Adds dependency checks and warning generation for local setup.
lib/lasem/dependency_doctor/cli.rb Adds CLI interface and option parsing for doctor.
lib/lasem/dependency_doctor/probe.rb Adds system probing helpers (PATH, pkg-config queries).
lib/lasem/dependency_doctor/report.rb Adds formatting/reporting for dependency doctor results.
lib/lasem.rb Defines the public API via autoloads, native_available?, and render.
lasem.gemspec Renames/defines gemspec and packages sources (including vendored Lasem submodule files).
lasem-ruby.gemspec Removes old gemspec.
Gemfile Updates gemspec reference and adds rake-compiler for native builds.
ext/lasem/extconf.rb Adds native/stub selection, pkg-config discovery, and vendored Meson build attempt.
ext/lasem/lasem_ext.c Adds the actual native renderer implementation using Lasem + Cairo.
ext/lasem/lasem_stub.c Adds stub extension that reports missing native dependency.
exe/lasem-doctor Adds executable entry point for dependency diagnostics.
.gitmodules Adds Lasem submodule configuration under vendor/lasem/source.
.gitignore Ignores built gem artifacts for the renamed gem.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/lasem/dependency_doctor_spec.rb Outdated
Comment thread lasem.gemspec Outdated
Comment thread ext/lasem/extconf.rb Outdated
Comment thread ext/lasem/extconf.rb Outdated
Comment thread lib/lasem/dependency_doctor.rb Outdated
Comment thread lib/lasem/render_options.rb
Comment thread ext/lasem/lasem_stub.c Outdated
Comment thread ext/lasem/lasem_ext.c Outdated
Comment thread rakelib/lasem.rake

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 29 changed files in this pull request and generated 2 comments.

Comment thread lib/lasem/dependency_doctor.rb Outdated
Comment thread lasem.gemspec Outdated
@suleman-uzair
suleman-uzair force-pushed the feat/bootstrap-lasem-wrapper branch from c41c426 to de5ef13 Compare May 13, 2026 12:11
@suleman-uzair
suleman-uzair changed the base branch from main to chore/add-ci May 13, 2026 12:12
@suleman-uzair suleman-uzair changed the title [WIP] Bootstrap Lasem Ruby wrapper gem Bootstrap Lasem Ruby wrapper gem May 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 35 changed files in this pull request and generated 7 comments.

Comment thread lib/lasem/dependency_doctor.rb Outdated
Comment thread ext/lasem/lasem_ext.c Outdated
Comment thread lasem.gemspec
Comment thread README.adoc Outdated
Comment thread ext/lasem/lasem_ext.c Outdated
Comment thread ext/lasem/lasem_ext.c Outdated
Comment thread lib/lasem/render_options.rb
@suleman-uzair
suleman-uzair marked this pull request as ready for review May 15, 2026 17:52
@suleman-uzair
suleman-uzair marked this pull request as draft June 17, 2026 17:27
… gerror, and Windows PATHEXT lookup in Probe
@suleman-uzair
suleman-uzair marked this pull request as ready for review June 18, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 39 changed files in this pull request and generated 1 comment.

Comment thread ext/lasem/lasem_ext.c
@ronaldtse

Copy link
Copy Markdown

Thanks @suleman-uzair !

@ronaldtse
ronaldtse merged commit 04778ba into chore/add-ci Jun 25, 2026
11 checks passed
@ronaldtse
ronaldtse deleted the feat/bootstrap-lasem-wrapper branch June 25, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants