Platform: Windows Vista 32bit.
Ruby 1.8.6 & JRuby, Rails 2.1.0
Server: WEBbrick
image_tag incorrectly appends "." to the end of an image path, prior to the version timestamp
Ex:
image_tag("confident.gif")
Generates an image tag with src:
http://server/images/fb_calendar...
Expected:
http://server/images/fb_calendar...
The reason for this lies within the behavior of File.exists? on Windows and the following line in the asset_tag_helper:
source += ".#{ext}" if ext && File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))
On Windows, appending a "." to the end of a file path will still return the original file. Similarly, File.exist? will return "true" for file paths like "C:/Users/user/application/public/images/emoticons/confident.gif." when the actual path is "C:/Users/user/application/public/images/emoticons/confident.gif". As a result, the above code erroneously appends a "." to the end of image paths when ext nil.
Rails/WEBBrick seem to still return the image correctly for http requests, but JRuby/Rails fails to return the image entirely.