Skip to content

Commit

Permalink
Revert to the good old days when AssetTag didn't cause anyone problems
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Jan 2, 2009
1 parent 606176a commit 104898f
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 333 deletions.
1 change: 0 additions & 1 deletion actionpack/lib/action_controller/dispatcher.rb
Expand Up @@ -91,7 +91,6 @@ def reload_application
run_callbacks :prepare_dispatch

Routing::Routes.reload
ActionView::Helpers::AssetTagHelper::AssetTag::Cache.clear
end

# Cleanup the application by clearing out loaded classes so they can
Expand Down

6 comments on commit 104898f

@svenfuchs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arg :( why’s that?

@josh
Copy link
Contributor Author

@josh josh commented on 104898f Feb 1, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way to many caching issues, memory leaks, and other complications :(

We can always take another stab at it for 3.0.

@svenfuchs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see.

too bad, the oop’ish style made it much simpler to extend and reuse things.

anyway. thanks for all your great work :)

@josh
Copy link
Contributor Author

@josh josh commented on 104898f Feb 4, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pixeltrix

I think its more for images, so it would check “rails.png” if you were missing the extension.

@pixeltrix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it doesn’t – if you pass ‘rails’ and ‘png’ the File.extname(source).blank? short circuits the File.exist?. Also adding ‘png’ by default was removed from image_path some time ago – so it only affects stylesheets and javascripts.

The only case where it might come in useful is if you have a stylesheet or javascript file with a double extension, e.g: prototype.1.6.0.js. Then you could do javascript_path(‘prototype.1.6.0’) and it would generate the correct path.

However it seems that doing multiple file stats so that you can save typing 3 or 4 characters seems wasteful. Perhaps an extra condition to short circuit the File.exist? if the File.extname == ext. This would eliminate the stats for filename.js.js and filename.css.css.

@josh
Copy link
Contributor Author

@josh josh commented on 104898f Feb 4, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea.

Please ticket me on LH and we can get that in.

Please sign in to comment.