orb_template 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23c24b347e9567c5486af79f8e618ce7f73346df80292cfe40df8c7c29bc22dc
4
- data.tar.gz: 8a642e363fcb8346384f4de01aa265bc0edee90525d7ae3a73e49e5b9e3eb9b3
3
+ metadata.gz: dd68f471e3fbd9acaad2e9c35de29d1b7007c012095b477bdedc0ee2e5c97f8e
4
+ data.tar.gz: fc4531a398382faea20b133b34b57b821826bd98390bcf30d1017016b3538114
5
5
  SHA512:
6
- metadata.gz: 7535ad115f4e7a58983d62be79f45d4250e8b872846765b1c14435c16bd0f1e1dc92d9bbeeec01b8cf2e7ae454a920c5868128773335a1c12da5299f2aa3b31a
7
- data.tar.gz: f70d38d3a11826385665c6380d13727185557dd6769b556bb0707f642724fe61190c73c08d8a2ebc21a5987763d20f6f341159936642b9d892906438d8dd4cfb
6
+ metadata.gz: 7643721a1c16badd894605c1e99832ed2ea782ff2f67b5169b0ef26ee6b97b36ecd7f201adfb61976a93cdcbc8925a2dbcc7a7aa0240a660f6521c268b4abc7c
7
+ data.tar.gz: d33b3d3c66f7915d3e03057050e97fad95d2de709e34edd2f12b6522d49dcb1f961d798527490f84d9001218718af48469f523e927be8da52c0bcff09108650b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.4] - 2026-03-22
4
+
5
+ ### Fixed
6
+
7
+ - Fixed `ORB::Temple::Engine: Option :capture_generator is invalid` — replaced separate `CaptureBuffer` class with `ORB::OutputBuffer` that uses `define_options` to register `capture_generator` as a valid option and conditionally returns `nil` from `return_buffer` when acting as a capture generator
8
+
3
9
  ## [0.2.3] - 2026-03-22
4
10
 
5
11
  ### Fixed
@@ -1,21 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ORB
4
- class RailsTemplate
5
- require 'orb/utils/orb'
6
-
7
- class CaptureBuffer < ::Temple::Generators::RailsOutputBuffer
8
- def return_buffer
9
- nil
10
- end
4
+ # Generator that fixes void-context warnings from Temple's AttributeRemover.
5
+ #
6
+ # AttributeRemover wraps dynamic attributes (e.g. class={expr}) in a
7
+ # [:capture, tmp, ...] + [:if, "!tmp.empty?", ...] pair. The default
8
+ # RailsOutputBuffer uses itself as the capture generator, and its
9
+ # return_buffer (inherited from StringBuffer) emits the bare variable
10
+ # name as the last expression. Inside the surrounding :multi this
11
+ # becomes a statement in void context since Ruby -w warns about it.
12
+ #
13
+ # This subclass returns nil from return_buffer when acting as a capture
14
+ # generator (buffer != @output_buffer), suppressing the bare variable.
15
+ class OutputBuffer < ::Temple::Generators::RailsOutputBuffer
16
+ define_options capture_generator: ORB::OutputBuffer
17
+
18
+ def return_buffer
19
+ buffer == '@output_buffer' ? super : nil
11
20
  end
21
+ end
12
22
 
23
+ class RailsTemplate
24
+ require 'orb/utils/orb'
13
25
  # Compatible with: https://github.com/judofyr/temple/blob/v0.7.7/lib/temple/mixins/options.rb#L15-L24
14
26
  class << self
15
27
  def options
16
28
  @options ||= {
17
- generator: ::Temple::Generators::RailsOutputBuffer,
18
- capture_generator: CaptureBuffer,
29
+ generator: ORB::OutputBuffer,
19
30
  use_html_safe: true,
20
31
  streaming: true,
21
32
  buffer_class: 'ActionView::OutputBuffer',
data/lib/orb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ORB
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orb_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - KUY.io Inc.