tina4ruby 3.9.2 → 3.10.0

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: 101a34de44fea572c9c21c8fea286f7adfb4c34fa5227be1c82b7def86ec8d71
4
- data.tar.gz: d86ffef03c13ef707952678dde2961f9b430f81a81d7d618dd2a3c4811295611
3
+ metadata.gz: b43c80adf7c00f71f0c14d64b4660f612b0124008b6a4821f431bae1d25c88d8
4
+ data.tar.gz: ca4230e2b17265849c05e5118c095f7359a7728036e299dc2813a56c53f85c47
5
5
  SHA512:
6
- metadata.gz: 4446bf6ba80cdfb3d2ab17dabd523641f26a9eb09dbbff3cb9b6397e501206afa18bf85c1fe7b147d2aa0910ad2ca225322d7329cc6e3022ad493daee2f0e5a6
7
- data.tar.gz: d4a7c8481f75d1fce92031da88b72ac88eda029aef5ebd417010c5545429b68c8f4fffd7a9048565df0e4512bfe6a23d3a578b4b952211ef2147978c18ca31ab
6
+ metadata.gz: 8200644fd078c8c4cb635610bef5392daddda3f86d1d7366973d16ffbd9457eb9e710db6cba8430384ff6b052b55dbbff0129c3ca31f878e067aab608e053ed0
7
+ data.tar.gz: 900b1b9f2fa791c1ebfcd5f0e492d73ade490c7c48126d3b2b1ff71f5d6a41ae8991552d69ae2ae3b4bdbff884a6aebfd3f37d01b6fa2bb163d2779dea53a19d
@@ -142,6 +142,14 @@ module Tina4
142
142
  @parent_template = nil
143
143
  end
144
144
 
145
+ # Reset context and blocks for reuse (avoids creating new instances in loops)
146
+ def reset_context(context)
147
+ @context = context
148
+ @blocks = {}
149
+ @parent_template = nil
150
+ self
151
+ end
152
+
145
153
  def render(content)
146
154
  content = process_extends(content)
147
155
  content = process_blocks(content)
@@ -226,6 +234,7 @@ module Tina4
226
234
  when Integer then (0...collection).to_a
227
235
  else []
228
236
  end
237
+ sub_engine = TwigEngine.new({}, @base_dir)
229
238
  items.each_with_index do |item, index|
230
239
  loop_context = @context.dup
231
240
  loop_context["loop"] = {
@@ -241,7 +250,7 @@ module Tina4
241
250
  else
242
251
  loop_context[key_or_val] = item
243
252
  end
244
- sub_engine = TwigEngine.new(loop_context, @base_dir)
253
+ sub_engine.reset_context(loop_context)
245
254
  output << sub_engine.render(body)
246
255
  end
247
256
  output
data/lib/tina4/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tina4
4
- VERSION = "3.9.2"
4
+ VERSION = "3.10.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tina4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.2
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tina4 Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-27 00:00:00.000000000 Z
11
+ date: 2026-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack