Skip to content

Bootstrap Lasem Ruby wrapper gem#1

Open
suleman-uzair wants to merge 8 commits into
chore/add-cifrom
feat/bootstrap-lasem-wrapper
Open

Bootstrap Lasem Ruby wrapper gem#1
suleman-uzair wants to merge 8 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.

Copy link
Copy Markdown

Copilot AI left a comment

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
Copy link
Copy Markdown

Copilot AI left a comment

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
@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
Copy link
Copy Markdown

Copilot AI left a comment

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
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
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.

2 participants