Permalink
Browse files

bugfix - rewrite relative path was not working if spaces were around …

…the image url

git-svn-id: http://bundle-fu.googlecode.com/svn/trunk@45 1db77ec0-6337-0410-9320-454da9aca44f
  • Loading branch information...
1 parent dec99de commit 561d05eb5609e1acdc2639ec8c72e3bed6b2d161 timcharper committed Oct 30, 2007
Showing with 3 additions and 2 deletions.
  1. +1 −0 lib/bundle_fu.rb
  2. +2 −2 test/fixtures/public/stylesheets/css_3.css
View
1 lib/bundle_fu.rb
@@ -27,6 +27,7 @@ def bundle_js_files(filenames=[], options={})
# rewrites a relative path to an absolute path, removing excess "../" and "./"
# rewrite_relative_path("stylesheets/default/global.css", "../image.gif") => "/stylesheets/image.gif"
def rewrite_relative_path(source_filename, relative_url)
+ relative_url = relative_url.strip
return relative_url if relative_url.first == "/"
elements = File.join("/", File.dirname(source_filename)).gsub(/\/+/, '/').split("/")
View
4 test/fixtures/public/stylesheets/css_3.css
@@ -1,7 +1,7 @@
.relative_image_bg {
- background-image: url(../images/background.gif)
+ background-image: url(../images/background.gif )
}
.relative_image_bg_2 {
- background-image: url(../images/groovy/background_2.gif)
+ background-image: url( ../images/groovy/background_2.gif )
}

0 comments on commit 561d05e

Please sign in to comment.