Skip to content

Ruby CLI: Show compiled source when compile produces invalid Ruby#1365

Merged
marcoroth merged 1 commit intomainfrom
herb-compile-cli
Mar 11, 2026
Merged

Ruby CLI: Show compiled source when compile produces invalid Ruby#1365
marcoroth merged 1 commit intomainfrom
herb-compile-cli

Conversation

@marcoroth
Copy link
Owner

This pull request updates the Ruby CLI to show the compiled source when the compile subcommand produced invalid Ruby

Before

❯ bin/herb compile test.html.erb
Compiled template produced invalid Ruby:
  - unexpected end-of-input, assuming it is closing the parent top level context (line 4)
  - expected a matching `)` (line 5)
  - unexpected end-of-input; expected a `)` to close the arguments (line 4)

After

❯ bin/herb compile test.html.erb
__herb = ::Herb::Engine; _buf = ::String.new; _buf << __herb.h((render Foo.new do; _buf << 'hello'.freeze; end # comment))
 _buf << '
'.freeze;
_buf.to_s

Compiled template produced invalid Ruby:
  - unexpected end-of-input, assuming it is closing the parent top level context (line 4)
  - expected a matching `)` (line 5)
  - unexpected end-of-input; expected a `)` to close the arguments (line 4)

Inspired while working on #1363

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 11, 2026

npx https://pkg.pr.new/@herb-tools/formatter@1365
npx https://pkg.pr.new/@herb-tools/language-server@1365
npx https://pkg.pr.new/@herb-tools/linter@1365

commit: e744a6c

@github-actions
Copy link

github-actions bot commented Mar 11, 2026

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit e744a6c


✅ Preview deployment has been cleaned up.

@github-actions github-actions bot added the rbs label Mar 11, 2026
@marcoroth marcoroth merged commit 61b5a68 into main Mar 11, 2026
32 checks passed
@marcoroth marcoroth deleted the herb-compile-cli branch March 11, 2026 21:54
@marcoroth marcoroth modified the milestone: v1.0.0 Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant