homura-runtime 0.2.19 → 0.2.20

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: 94e4ec7af2878bc59ebedd0ebe8841d5852b4fb35d736d713a62ce1ef1bb1cfb
4
- data.tar.gz: 6f21d253588daa097a1541ddd017b58a28b10c38ccc703f2a3ee9e6c650f490f
3
+ metadata.gz: c353eae6d02619f499bf359610f28d12c0824415cc584e835dd0440d6807cff6
4
+ data.tar.gz: 998317164a89b71d98f01275a20dd1482d7ccf464c8ebef1095555db669765be
5
5
  SHA512:
6
- metadata.gz: dd0b2cb20babf2fe3cb57167dfdc509fef69ccd5d141cf44c0a370b9e8aca29425267433eb4fdf002b0e081583c8028deb1799d4e8c53e808a2b175f2a611c7e
7
- data.tar.gz: d794586f918cef8b0cabebec3923525078c69a9b68e75e0da96096ffa8afdc02aceb6cd277b07f8b15c0396a3f6f6b6ecf77e2c0c9308cd27624acce320b45ad
6
+ metadata.gz: f6b0a9a1f4d55913deb468056980e70c3913ef7397603f1b9ee156241cf6d55cdd7eb6cb94cf54513c1d293816a9f69d455e36731f013c648a4716bec49f0972
7
+ data.tar.gz: 19e6c31d9e1fee24749b91a8d3caadb6789d9d05652d76ce2addc9642b892d47ac8fa8fffad7ff9862d309c34d994af9cc5da718b20d6b96bb2e38ce7e492d74
data/exe/compile-erb CHANGED
@@ -425,6 +425,15 @@ def emit_sinatra_patch(io, namespace)
425
425
  name == :layout || name.to_s.start_with?('layout_')
426
426
  end
427
427
 
428
+ # Rails-/Sinatra-flavoured partial convention: a template name
429
+ # starting with `_` is treated as a partial (e.g. `_docs_nav`),
430
+ # so the auto-layout pass leaves it alone. Without this, calling
431
+ # `<%= erb :_docs_nav %>` from inside a layout template would
432
+ # rewrap the partial in `:layout`, doubling header/nav output.
433
+ def __homura_partial_template?(template)
434
+ template.to_s.start_with?('_')
435
+ end
436
+
428
437
  # homura patch: dispatch to precompiled templates when we
429
438
  # have one. Unknown symbols raise a clear message instead of
430
439
  # wandering into upstream Tilt, which would blow up on
@@ -442,7 +451,10 @@ def emit_sinatra_patch(io, namespace)
442
451
 
443
452
  layout = options[:layout]
444
453
  layout = false if layout.nil? && options.include?(:layout)
445
- if layout.nil? && !__homura_layout_template?(template) && ::#{namespace}.registered?(:layout)
454
+ if layout.nil? &&
455
+ !__homura_layout_template?(template) &&
456
+ !__homura_partial_template?(template) &&
457
+ ::#{namespace}.registered?(:layout)
446
458
  layout = :layout
447
459
  end
448
460
  if layout
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudflareWorkers
4
- VERSION = '0.2.19'
4
+ VERSION = '0.2.20'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homura-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.19
4
+ version: 0.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuhiro Homma