Skip to content
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

Fix wrong argument exception when &:block passed to the expose method #288

Merged
merged 1 commit into from
Jan 11, 2018
Merged

Fix wrong argument exception when &:block passed to the expose method #288

merged 1 commit into from
Jan 11, 2018

Conversation

DmitryTsepelev
Copy link
Contributor

I've faced this problem when Rubocop suggested to fix Style/SymbolProc problem in the following code:

expose :something do |object|
  object.any_method
end

After the fix the following code started to throw wrong argument number exception, because options are always passed to the block:

expose :something, &:any_method

I'm aware of the as: option which solves the case above, but probably this enhancement will help avoid confusion with Rubocop users.

@coveralls
Copy link

coveralls commented Dec 28, 2017

Coverage Status

Coverage increased (+0.02%) to 92.76% when pulling 993b623 on DmitryTsepelev:block-shorthand-crash into 064ecfb on ruby-grape:master.

@DmitryTsepelev
Copy link
Contributor Author

@LeFnord could you please review when you have a second? thanks :)

@ruby-grape ruby-grape deleted a comment from coveralls Jan 11, 2018
@ruby-grape ruby-grape deleted a comment from coveralls Jan 11, 2018
@ruby-grape ruby-grape deleted a comment from coveralls Jan 11, 2018
@LeFnord
Copy link
Member

LeFnord commented Jan 11, 2018

the rubocop warnings will be fixed in #287

@LeFnord LeFnord merged commit be144f7 into ruby-grape:master Jan 11, 2018
@DmitryTsepelev
Copy link
Contributor Author

@LeFnord Got it, thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants