mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
allow %w in Handler macros (#385)
This commit is contained in:
parent
fc4c97aafd
commit
5a83522866
2 changed files with 29 additions and 2 deletions
|
@ -9,14 +9,14 @@ module Kemal
|
|||
|
||||
macro only(paths, method = "GET")
|
||||
class_name = {{@type.name}}
|
||||
{{paths}}.each do |path|
|
||||
({{paths}}).each do |path|
|
||||
@@only_routes_tree.add "#{class_name}/#{{{method}}.downcase}#{path}", "/#{{{method}}.downcase}#{path}"
|
||||
end
|
||||
end
|
||||
|
||||
macro exclude(paths, method = "GET")
|
||||
class_name = {{@type.name}}
|
||||
{{paths}}.each do |path|
|
||||
({{paths}}).each do |path|
|
||||
@@exclude_routes_tree.add "#{class_name}/#{{{method}}.downcase}#{path}", "/#{{{method}}.downcase}#{path}"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue