Closed agilbert201 closed 11 years ago
Looks like really here
https://github.com/rstacruz/sinatra-assetpack/blob/master/lib/sinatra/assetpack/options.rb#L214
The regexp in css.rb is just stripping quotes best I can tell. But in this case a call to local_file_for
with an argument of '/css' is returning something. It is a local directory / path but not a real asset file.
Recreated with failing test case
test "local file for (in nonexisting files)" do
fn = App.assets.local_file_for '/css'
assert fn.nil?
end
Thanks, just found this out too and made a fix on master.
I updated the local_file_for method to check for File.file?
instead of File.exist?
as it matched folders (css folder in this case). I also rewrote a bit of the css preproc method to be cleaner.
This way, external url should never match unless the very same file exist in your app.
Most awesome. Thank you!
Released in 0.2.8
Was trying to use a google font in css as:
Which was getting rewritten to local host, had to expand this out to the actual
@font-face
entryWhat I don't understand is why the latter didn't suffer the same fate. In general is the rewriting supposed to take into account you could have external asset references as well as local? Seems like it does, so perhaps the query parameter in the first url is throwing off a regexp?