Skip to content

Commit

Permalink
Merge pull request #63 from coralpink-d2e1ac26/fix-pipeline-scope-pro…
Browse files Browse the repository at this point in the history
…pagation

fix pipeline scope propagation
  • Loading branch information
grkek authored Nov 22, 2023
2 parents bf52b76 + ed69734 commit 8e7124f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/grip/macros/dsl.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ module Grip
end

macro scope(path)
size = @valves.size
%size = @valves.size

if {{path}} != "/"
@scopes.push({{path}})
end

{{yield}}

@valves.pop() if @valves.size != 0 && @valves.size != size
@valves.pop(@valves.size - %size)

if {{path}} != "/"
@scopes.pop()
end

@valves.pop() if @scopes.size == 0 && @valves.size != 0
end

{% for http_method in HTTP_METHODS %}
Expand Down

0 comments on commit 8e7124f

Please sign in to comment.