Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 561d05eb5609e1acdc2639ec8c72e3bed6b2d161 1 parent dec99de
authored October 30, 2007
1  lib/bundle_fu.rb
@@ -27,6 +27,7 @@ def bundle_js_files(filenames=[], options={})
27 27
     # rewrites a relative path to an absolute path, removing excess "../" and "./"
28 28
     # rewrite_relative_path("stylesheets/default/global.css", "../image.gif") => "/stylesheets/image.gif"
29 29
     def rewrite_relative_path(source_filename, relative_url)
  30
+      relative_url = relative_url.strip
30 31
       return relative_url if relative_url.first == "/"
31 32
       
32 33
       elements = File.join("/", File.dirname(source_filename)).gsub(/\/+/, '/').split("/")
4  test/fixtures/public/stylesheets/css_3.css
... ...
@@ -1,7 +1,7 @@
1 1
 .relative_image_bg {
2  
-  background-image: url(../images/background.gif)
  2
+  background-image: url(../images/background.gif )
3 3
 }
4 4
 
5 5
 .relative_image_bg_2 {
6  
-  background-image: url(../images/groovy/background_2.gif)
  6
+  background-image: url( ../images/groovy/background_2.gif )
7 7
 }

0 notes on commit 561d05e

Please sign in to comment.
Something went wrong with that request. Please try again.