thumblemonks / smurf

Rails plugin to automatically minify JavaScript and CSS when their bundles get cached
http://gusg.us/code/ruby/smurf-rails-autominifying-js-css-plugin.html
MIT License
193 stars 12 forks source link

Deprecated constant for rails version 2.2.3 and above #2

Closed Consoci8 closed 14 years ago

Consoci8 commented 14 years ago

uninitialized constant error from these 2 lines at smurf.rb

ActionView::Helpers::AssetTagHelper::JavascriptSources

ActionView::Helpers::AssetTagHelper::StylesheetSources

thumblemonks commented 14 years ago

Thanks Consoci8. I'm going to look at this over the weekend. I'm also going to look at what josecosta did in his fork.

thumblemonks commented 14 years ago

Hello again Consoci8,

I've tried running the tests against 2.3.2 and 2.3.4 and I'm not having this problem. What version of rails are you using?

thumblemonks commented 14 years ago

Consoci8 replied:

I was using Rails 2.2.3. I believe they'd change the API but probably change it back as it was before. I better change my Rails version than. Thanks.

@Consoci8: I installed rails 2.2.3 and did in fact get the same error:

/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.3/lib/active_support/dependencies.rb:442:in `load_missing_constant': uninitialized constant ActionView::Helpers::AssetTagHelper::JavaScriptSources (NameError)
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.3/lib/active_support/dependencies.rb:77:in `const_missing'

Seems like it should be an easy fix.

gus commented 14 years ago

Closed by 2bc983e3d96af8e822b85a76a389d5e94870602d - Only 2.2.1 defines the joined_contents method

thumblemonks commented 14 years ago

Ok then. Turns out ONLY Rails 2.2.1 defined

ActionView::Helpers::AssetTagHelper::JavaScriptSources
ActionView::Helpers::AssetTagHelper::StylesheetSources

Before and after 2.2.1, the code for bundling assets together was the same.

I have modified Smurf to care about 2.2.1 only, but I think I will tag the code that works with 2.2.1, then remove that code from Smurf to simplify it.

Let me know if there are any more issues.