-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Enable block
variable in view
#27303
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @senny (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
Instead of excluding the one value here, let's split |
RUBY_RESERVED_KEYWORDS = %w(alias and BEGIN begin break case class def defined? do | ||
else elsif END end ensure false for if in module next nil not or redo rescue retry | ||
return self super then true undef unless until when while yield) | ||
DELEGATION_RESERVED_KEYWORDS = %w(_ arg args block) |
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 extracted only delegation reserved keywords like this:
$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
$ cat extract_keywords.rb
original_keywords = %w(_ arg args alias and BEGIN begin block break case class def defined? do else elsif END end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield)
keywords = []
original_keywords.each do |keyword|
begin
eval("#{keyword} = 1")
rescue SyntaxError => e
keywords << keyword
end
end
p keywords
p original_keywords - keywords
$ ruby extract_keywords.rb
["alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "nil", "not", "or", "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", "until", "when", "while", "yield"]
["_", "arg", "args", "block"]
@@ -6,11 +6,12 @@ class Module | |||
# option is not used. | |||
class DelegationError < NoMethodError; end | |||
|
|||
RUBY_RESERVED_KEYWORDS = %w(alias and BEGIN begin break case class def defined? do |
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.
Not sure the constant naming and defined location are good.
@matthewd What do you think?
Remove `block` keyword from reserved method names
2e5ac83
to
d9ff835
Compare
Enable `block` variable in view
Summary
Enabling
block
variable in view.This fixes #27302