summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2026-02-16 10:45:47 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2026-02-16 10:45:47 +0100
commit9bbb7bf7e327f086497cb3ad736f15b51f16716a (patch)
treedaa64fb8d0097169efbb206a83d5d10bb1fb6b72
parent21947338ffd078905afa07d7b3fdf9fee45cc08a (diff)
downloadzorglub-9bbb7bf7e327f086497cb3ad736f15b51f16716a.zip
zorglub-9bbb7bf7e327f086497cb3ad736f15b51f16716a.tar.gz
support nil meth
-rw-r--r--lib/zorglub/node.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index 87ed6a8..736291f 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -235,14 +235,14 @@ module Zorglub
meth ||= 'index'
$stdout << "=> #{meth}(#{args.join ','})\n" if app.opt :debug
node = new(env, meth, args)
- return error404 node, meth unless node.respond_to? meth
+ return error404(node, meth) unless node.respond_to?(meth)
node.realize!
end
def partial(meth, *args, **options)
- node = new(options[:env] || {}, meth.to_s, args, partial: true, **options)
- return error404 node, meth unless node.respond_to? meth
+ node = new(options[:env] || {}, meth, args, partial: true, **options)
+ return error404(node, meth) unless meth.nil? || node.respond_to?(meth)
node.feed!(no_hooks: options[:no_hooks] || false)
node.content
@@ -270,12 +270,12 @@ module Zorglub
@engine = self.class.engine
@cache_lifetime = self.class.cache_lifetime
- @meth = meth
+ @meth = meth.to_s
@args = args
@request = @parent ? @parent.request : Rack::Request.new(env)
@response = @parent ? @parent.response : Rack::Response.new
- @view = options[:view] || r(meth)
+ @view = options[:view] || r(@meth)
@partial = options[:partial] || false
@layout = (options[:partial] ? nil : self.class.layout)
@@ -300,7 +300,7 @@ module Zorglub
@state = :pre_cb
self.class.call_before_hooks self unless no_hooks
@state = :meth
- @content = send @meth, *@args
+ @content = send(@meth, *@args) unless @meth.empty?
if (static_path = static)
static_page! static_path
else