diff --git a/CHANGELOG.md b/CHANGELOG.md index 04aad56..6143998 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.1] - 2026-07-01 + +### Changed + +- Renamed the internal `ActiveMail::Core#release_the_kraken` to `#transpile`. +- Neutralised test fixtures (example URLs) and severed the upstream fork link. + ## [1.2.0] - 2026-07-01 ### Added diff --git a/README.md b/README.md index 9f2d00a..719c652 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ tokens, automatic CSS inlining, generators, and test-time quality guards — so responsive, accessible email renders **out of the box**, with every default overridable. -A fork and modernization of the now-unmaintained `inky-rb`. Not affiliated with Rails core. +Not affiliated with Rails core. Write this: @@ -289,7 +289,7 @@ Helpers available from `Base`: `combine_classes`, `combine_attributes`, Per-instance overrides (including replacing a built-in tag) are also possible: ```ruby -ActiveMail::Core.new(components: { 'button' => MyButton }).release_the_kraken(source) +ActiveMail::Core.new(components: { 'button' => MyButton }).transpile(source) ``` ## Generators @@ -356,8 +356,8 @@ Targets the real-world client landscape as of 2026: ## Programmatic use ```ruby -ActiveMail::Core.new.release_the_kraken('Hi') -ActiveMail::Core.new(column_count: 24, container_width: 480).release_the_kraken(source) +ActiveMail::Core.new.transpile('Hi') +ActiveMail::Core.new(column_count: 24, container_width: 480).transpile(source) ``` ## Development @@ -371,4 +371,4 @@ bundle exec srb tc # Sorbet ## License -MIT. See [`LICENSE.txt`](LICENSE.txt). +MIT. See [`LICENSE.txt`](LICENSE.txt), which retains the original ZURB copyright. diff --git a/lib/activemail.rb b/lib/activemail.rb index bf1fa11..1de38e9 100644 --- a/lib/activemail.rb +++ b/lib/activemail.rb @@ -73,7 +73,7 @@ def initialize(options = {}) # Object, not String: ActionView::OutputBuffer is no longer a String since Rails 7.1. sig { params(html_string: Object).returns(String) } - def release_the_kraken(html_string) + def transpile(html_string) raws, str = extract_raws(normalize_input(html_string)) parse_cmd = ::ActiveMail.full_document?(str) ? :parse : :fragment html = Nokogiri::HTML.public_send(parse_cmd, str) diff --git a/lib/activemail/rails/template_handler.rb b/lib/activemail/rails/template_handler.rb index bb93ffd..3d36a62 100644 --- a/lib/activemail/rails/template_handler.rb +++ b/lib/activemail/rails/template_handler.rb @@ -37,7 +37,7 @@ def call(template, source = nil) else engine_handler.call(template) end - "ActiveMail::Core.new.release_the_kraken(begin; #{compiled_source};end)" + "ActiveMail::Core.new.transpile(begin; #{compiled_source};end)" end module Composer diff --git a/lib/activemail/version.rb b/lib/activemail/version.rb index 45a9cdb..3d85965 100644 --- a/lib/activemail/version.rb +++ b/lib/activemail/version.rb @@ -2,5 +2,5 @@ # frozen_string_literal: true module ActiveMail - VERSION = '1.2.0' + VERSION = '1.2.1' end diff --git a/test/components/button_test.rb b/test/components/button_test.rb index 13579e3..6d87a6f 100644 --- a/test/components/button_test.rb +++ b/test/components/button_test.rb @@ -5,11 +5,11 @@ class ButtonTest < ActiveMailTest def test_simple_button_is_bulletproof assert_renders( - '', + '', <<~HTML HTML diff --git a/test/components/menu_test.rb b/test/components/menu_test.rb index 1a16a93..dd5ed8a 100644 --- a/test/components/menu_test.rb +++ b/test/components/menu_test.rb @@ -5,11 +5,11 @@ class MenuTest < ActiveMailTest def test_menu_with_item assert_renders( - 'Item', + 'Item', <<~HTML HTML diff --git a/test/rails/template_handler_test.rb b/test/rails/template_handler_test.rb index 2c79261..ba82a93 100644 --- a/test/rails/template_handler_test.rb +++ b/test/rails/template_handler_test.rb @@ -36,7 +36,7 @@ def test_call_wraps_the_underlying_engine_output_with_inky template = ActionView::Template.new('', 'test', handler, locals: [], format: :html) compiled = handler.call(template, '') - assert_includes compiled, 'ActiveMail::Core.new.release_the_kraken' + assert_includes compiled, 'ActiveMail::Core.new.transpile' end def test_engine_handler_raises_for_unknown_engine @@ -64,7 +64,7 @@ def test_renders_an_inky_template_through_action_view end def test_output_is_html_safe_when_active_support_is_loaded - output = ActiveMail::Core.new.release_the_kraken('') + output = ActiveMail::Core.new.transpile('') assert_predicate output, :html_safe? end diff --git a/test/test_helper.rb b/test/test_helper.rb index e696aa8..825ef72 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -23,7 +23,7 @@ def assert_same_html(expected, actual) end def render(input, **options) - ActiveMail::Core.new(options).release_the_kraken(input) + ActiveMail::Core.new(options).transpile(input) end def assert_renders(input, expected, **)