Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Eliminate unnecessary File.exist? in compute_public_path when correct file extension given

#1879

Currently compute_public_path in asset_tag_helper.rb performs an unnecessary File.exist? check when a source with the correct file extension has been passed in.

e.g. stylesheet_path('theme.css') results in a File.exist? check for theme.css.css

The attached patch eliminates this File.exist? call whenever the extension of the specified source matches the specified extension. There are no additional tests as there is already test coverage for source paths using non-standard extensions and source paths without extensions.

Reported by Andrew White · February 5th, 2009 @ 12:50 AM

State: resolved
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. DHH
    DHH
    • Milestone cleared.

    February 5th, 2009 @ 07:16 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [7aa847fab4da41bfa30fa356fc0d7d79b7081734]) Eliminate unnecessary File.exist? when correct file extension given [#1879 Eliminate unnecessary File.exist? in compute_public_path when correct file ex... state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    February 5th, 2009 @ 09:46 PM