Skip to content

Commit

Permalink
update grape endpoint normalizer for 1.2.0 behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
zvkemp committed Nov 29, 2018
1 parent c922ba9 commit ba40610
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,18 @@ matrix:
# Grape
- rvm: 2.5
env:
- GRAPE_VERSION=0.13.0
- GRAPE_VERSION="~> 0.13.0"
gemfile: gemfiles/Gemfile.grape
- stage: extra
rvm: 2.5
env:
- GRAPE_VERSION="~> 1.1.0"
gemfile: gemfiles/Gemfile.grape
- stage: extra
rvm: 2.5
env:
# there are significant architectural changes between 1.1 and 1.2
- GRAPE_VERSION="~> 1.2.0"
gemfile: gemfiles/Gemfile.grape
- rvm: 2.5
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ def get_endpoint_name(endpoint)
path = "#{namespace}#{path}"
end

"#{endpoint.options[:for]} [#{method}] #{path}"
"#{base_app_name(endpoint)} [#{method}] #{path}".strip
end

def base_app_name(endpoint)
ep = endpoint.options[:for]
return ep.name if ep.name

if ep.respond_to?(:base) && ep.base.respond_to?(:name)
ep.base.name
end
end

end
Expand Down

0 comments on commit ba40610

Please sign in to comment.