Asset Packager - Rails 3 / Ruby 1.9 Compatible 3

Posted by sbecker Sun, 21 Mar 2010 19:56:00 GMT

Hello! Here is a long overdue update to Asset Packager, which now makes the main branch Rails 3 and Ruby 1.9 compatible. Thanks to all those on Github who sent me patches with these fixes.

Updates
  • Fix thread safety issue.
  • JSMin compatibility fix for Ruby 1.9.1 – Fixnum#ord
  • Rails >= 2.3 test compatibility
  • Rails 3 deprecations – change RAILS_ROOT to Rails.root, change RAILS_ENV to Rails.env, move tasks to lib dir
Comments

Leave a response

  1. Avatar
    Fredrik Bränström Mon, 22 Mar 2010 16:16:17 GMT

    Awesome. Been waiting to try this out in Rails 3, and also I should take some time to compare it with other solutions, need to read up on Sprockets for example. The built-in stuff has gotten a bit more sophisticated also, hasn’t it?

    A long while ago I wrote plugins to assist asset_packager with packaging only the necessary components (those actually used + dependencies) of MooTools (http://mootools.net; a fantastically lucid, modular Javascript framework) and also to allow automatic per-controller/-layout/-action resource packages…

  2. Avatar
    Fredrik Bränström Mon, 22 Mar 2010 16:28:43 GMT

    ...which I badly need to recover from my crashed HD and then release.

  3. Avatar
    Scott Becker Mon, 22 Mar 2010 21:25:00 GMT

    Fredrick – I’d be interested in seeing what you’ve come up with. I’ve started working on a re-write of AssetPackager, mostly simplifying the internals. I’ll hopefully merge that back in soon, as patches to the current version. I’m also interested in adding a few new features. One of my ideas is adding some support for Sprockets-style dependency management (perhaps just interfacing with Sprockets). Another is adding support for easily swapping out the compressor and allow a user to choose – either JSmin, YUI, Google Closure, etc.