How would I go about accessing the Bundle-Fu plugin from this rake task?
I have tried everything out and nothing seems to work.
Note:
assets_javascript&assets_cssare both arrays of files that are pulled from a central location to keep this rake task and the view DRY.
desc "Generate cached css/js files"
task :asset_cache_generate => :environment do
puts 'Caching Javascript & CSS Files'
bundle do
javascript_include_tag assets_javascript
stylesheet_link_tag assets_css
end
end
Thanks in advance for your help!
- Tom
The method
bundleis mixed into ActionView so you can only call it from a templace instance.Unfortunately, you can’t neither mix it into a custom class nor use it in a Rake task because it depends on many Rails template helpers/resources (concat, flash…). It would be too hard to reproduce all of them in order to make the method working.
See http://github.com/timcharper/bundle-fu/blob/8056fd05c7ee4f637eb6137d544e91065400daab/lib/bundle_fu.rb