documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Fix template name generation when unsafe regex characters are in base_path #111

Closed mkelly12 closed 13 years ago

mkelly12 commented 13 years ago

Templates in paths like the following

/Users/dave(old)/Sites/app/megan.jst

/Users/dave(old)/Sites/app/fox.jst

are not shortened to the templates megan and fox, but are rather added to the JST object with their full paths.

Regexp.escape(base_path) before doing the gsub fixes this problem.

jashkenas commented 13 years ago

Thanks for the patch. That's a nasty little oversight. Merged to master, will go out with the next release.