Repository navigation
Bind Action Mailer (go-ruby-actionmailer) as a native module - #194
Closed
tannevaled wants to merge 1 commit into
Closed
tannevaled wants to merge 1 commit into
tannevaled wants to merge 1 commit into
Conversation
Add `require "action_mailer"` support backed by github.com/go-ruby-actionmailer/actionmailer, so mailer classes compose and deliver mail with no .rb file, mirroring the existing Mail / ActiveJob bindings. Surface (ActionMailer::Base subclass model): - class DSL: `default`, `delivery_method=`/`delivery_method`, `perform_deliveries=`, `raise_delivery_errors=`, `register_interceptor`, `register_observer`, the shared `deliveries` sink and the `renderer=`/ `enqueuer=` injection points; - each mailer action method (`def welcome`) becomes a class method via the method_added hook, returning an ActionMailer::MessageDelivery (`deliver_now` / `deliver` / `deliver_later` / `message`); - the mailer instance surface a `def welcome` body runs against: `mail(...)`, `attachments` (regular + `attachments.inline`) and `headers(hash)`. Four Ruby-dispatch seams, all run INLINE under the GVL: - Action: the mailer method body is sent to a freshly allocated mailer instance bound to the library *Mailer; a raise maps to an error the delivery proxy re-raises faithfully; - RenderBody: body rendering sends #render to the configured Ruby renderer (Action View in the consolidated binary; a stub in tests); a nil renderer or nil result skips the format; - DeliveryMethod: defaults to the :test method (append to ActionMailer::Base.deliveries); a #deliver object plugs in a custom transport; - EnqueueJob: deliver_later sends #enqueue to the configured Ruby enqueuer (Active Job in the consolidated binary; a stub in tests), else runs inline. 100% coverage of the new files (compose/alternative/related/mixed, attachments, interceptors/observers, deliver_now/later, delivery-error raise paths, all seams via injected stubs). gofmt + go vet clean; builds on all six 64-bit arches. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Superseded by the wave-2 consolidation PR (single merge onto main; shared builtins/require/object_model/vm/arith/digest_bind). Work preserved verbatim; branch kept for reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
require "action_mailer"support backed bygo-ruby-actionmailer/actionmailer(pinned
@main,f116fa6), so mailer classes compose and deliver mail with no.rbfile — mirroring the existingMailandActiveJobbindings.Surface (
ActionMailer::Basesubclass model)default,delivery_method=/delivery_method,perform_deliveries=,raise_delivery_errors=,register_interceptor,register_observer, the shareddeliveriessink, and therenderer=/enqueuer=injection points.def welcome) becomes callable as a classmethod via the
method_addedhook, returning anActionMailer::MessageDelivery(deliver_now/deliver/deliver_later/message).def welcomebody runs against:mail(...),attachments(regular +attachments.inline),headers(hash).Four Ruby-dispatch seams (all INLINE under the GVL)
*Mailer; a raise maps to an error the delivery proxy re-raises faithfully#renderto the configured Ruby renderer (renderer=, wired to the bound go-ruby-actionview in the consolidated binary; a stub in tests); a nil renderer / nil result skips the formatActionMailer::Base.deliveries; a#deliverobject plugs in a custom transportdeliver_latersends#enqueueto the configured Ruby enqueuer (enqueuer=, wired to the bound go-ruby-activejob in the consolidated binary; a stub in tests), else runs inlineVerification
go build ./internal/vm/→ 0; classOf cases end inreturn(orphan scan clean).actionmailer.go,actionmailer_bind.go):compose (single / alternative / related / mixed / empty), attachments
(regular + inline), interceptors/observers,
deliver_now/deliver_later(inline + enqueuer stub), the RenderBody + EnqueueJob seams via injected stubs,
and the delivery-error raise paths.
go test ./internal/vm/ ./internal/object/→ both ok.gofmt -lclean;go vet ./internal/vm/→ 0.🤖 Generated with Claude Code