-
Notifications
You must be signed in to change notification settings - Fork 22k
Allow numbers in partial name for digesting #10377
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
Allow numbers in partial name for digesting #10377
Conversation
This seems legit to me. I'm not sure why numbers aren't in there, is there a reason? |
@@ -39,7 +39,7 @@ class ERBTracker | |||
render\s* # render, followed by optional whitespace | |||
\(? # start an optional parenthesis for the render call | |||
(partial:|:partial\s+=>)?\s* # naming the partial, used with collection -- 1st capture | |||
([@a-z"'][@a-z_\/\."']+) # the template name itself -- 2nd capture | |||
([@a-z"'][@a-z0-9_\/\."']+) # the template name itself -- 2nd capture |
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.
Could you use \w
here instead of a-z0-9_
?
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.
👍
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.
@vanstee Good idea, I've made this improvement. 8627278
Could you add a CHANGELOG entry and squash your commits? Thanks |
Add failing test for template with number at the end Use \w for RENDER_DEPENDENCY regex Spacing Add CHANGELOG entry
@rafaelfranca 👍 Done. Any possibility of this making it into the next RC (or final release) of Rails 4.0? Thanks. |
…mber Allow numbers in partial name for digesting
…mber Allow numbers in partial name for digesting Conflicts: actionpack/CHANGELOG.md
…mber Allow numbers in partial name for digesting Conflicts: actionpack/CHANGELOG.md
The regular expression would not match templates with numbers in the filename. For example:
Would result in (in the log):
Couldn't find template for digesting: shared/layout_.html
... and no digest would be generated.