Skip to content

Conversation

bricker
Copy link
Contributor

@bricker bricker commented Apr 29, 2013

The regular expression would not match templates with numbers in the filename. For example:

<%= render 'shared/layout_1' %>

Would result in (in the log):

Couldn't find template for digesting: shared/layout_.html

... and no digest would be generated.

@steveklabnik
Copy link
Member

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
Copy link

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_?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

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

@rafaelfranca
Copy link
Member

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
@bricker
Copy link
Contributor Author

bricker commented May 7, 2013

@rafaelfranca 👍 Done. Any possibility of this making it into the next RC (or final release) of Rails 4.0? Thanks.

@rafaelfranca
Copy link
Member

@bricker no idea. Have to ask @dhh.

rafaelfranca added a commit that referenced this pull request May 7, 2013
…mber

Allow numbers in partial name for digesting
@rafaelfranca rafaelfranca merged commit 925728c into rails:master May 7, 2013
rafaelfranca added a commit that referenced this pull request May 7, 2013
…mber

Allow numbers in partial name for digesting
Conflicts:
	actionpack/CHANGELOG.md
rafaelfranca added a commit that referenced this pull request May 13, 2013
…mber

Allow numbers in partial name for digesting
Conflicts:
	actionpack/CHANGELOG.md
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.

5 participants