-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for directly mounted Grape::API::Instance #22
Conversation
gem 'grape', '1.2.3' | ||
gem 'rails-controller-testing' | ||
gem 'sqlite3', '~> 1.4' | ||
when '2.5.3', '2.6.3' then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am only seeing this gem used in ops_app
and property
, which both use ruby 2.6.3, so support for ruby 2.5.3 can probably be dropped as well at this point. (Unless it is used somewhere else that I am missing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, the .ruby-version
file still lists ruby-2.3.3
so that can probably be updated to ruby-2.6.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized that this is a public gem, so I guess it should support more versions than one's used at Appfolio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should support more than just what we use internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as a public repo we need to support more versions. I can update the .ruby-version
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check this prerelease already with grape 1.2 and 1.3 in property? I see we officially removed Ruby 2.3.3 from the appraisals. It would have been nice to keep but would require not trying too new of a Rails with it.
[ | ||
options[:for], | ||
options[:for].base | ||
].detect { |api| api.respond_to?(:decl_auth_context) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL detect
exists and is basically find
.
# Grape >= 1.2.0 endpoint | ||
# Authorization::Controller::Grape can be included into either Grape::API | ||
# or Grape::API::Instance, so we need to check both. | ||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the order significant? It seems we used to check options[:for].base
first when it used to be in ControllerPermission
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its only ever going to be one or the other.
This CI run tests the changes against Grape 1.2: |
This PR adds support for Grape APIs that are mounted directly as
Grape::API::Instance
instead ofGrape::API
.Appraisals are also added for Grape 1.3.0.