This project is archived and is in readonly mode.

#1047 ✓duplicate
Daniel Sheppard

test/template/asset_tag_helper_test fails on win32

Reported by Daniel Sheppard | September 15th, 2008 @ 06:24 AM | in 2.x

compute_public_path is appending a period (.) even when ext is nil.


source += ".#{ext}" if ext && File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))

Should be


source += ".#{ext}" if ext && (File.extname(source).blank? || File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}")))

On windows, appending periods (.) to the end of a filename still refers to the same file. So if File.exist?("rails.png") returns true, so will File.exist?("rails.png.") and File.exist?("rails.png.....").

So File.exist?(File.join(ASSETS_DIR, dir, "#{source}.#{ext}"))) will always be true for a file that exists. Nothing should be appended if ext isn't specified.

Comments and changes to this ticket

  • Pratik

    Pratik December 19th, 2008 @ 02:35 PM

    • State changed from “new” to “duplicate”
    • Title changed from “[PATCH] test/template/asset_tag_helper_test fails on win32” to “test/template/asset_tag_helper_test fails on win32”

    Please reopen if this is still an issue in Edge.

    Also check http://rails.lighthouseapp.com/p... for submitting patches :)

    Thanks.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages