Posted by Nick Sieger Tue, 06 Apr 2010 17:11:17 GMT
It’s past due time to “carry the 1” over and roll over to a 1.0 version of Warbler. This time around, the changes in the codebase are significant enough that I hope you’ll find many past usability issues resolved.
The biggest change is that Warbler now creates a war file in place, without an intermediate copy-to-assemble step. Warbler does this using the
rubyzip gem, or alternatively using a small Java extension when run under JRuby 1.5 or greater. This should reduce processing and confusion due to the extra copy, which can sometimes get out of sync. The downside is that Warbler cannot be used easily for exploded directory development, though you can always create the war file and unpack it to a staging area.
Warbler also underwent an internal refactoring that should make extending it much easier. Here’s how you add Warbler tasks to your
In versions prior to 1.0, if there were deploy steps that created new files that didn’t exist at the time the
Rakefile was loaded (such as what the
asset:packager:build_all task does in the asset_packager plugin), it was tricky to get Warbler to recognize them. No longer -- now the expected Rake configuration should do the trick.
task :war => "asset:packager:build_all"
Another exciting development in the Ruby development world is Bundler, and Warbler 1.0 supports packaging your bundled gems with it. Warbler even creates a
.bundle/environment.rb file inside the war file that loads the gems from relative paths to where Warbler puts the gems in the war file.
There are a number of new configuration options, so check out the new configuration and see if any are useful to you.
config.gem_homeallows you to control the path inside the war file where Warbler will pack your application’s gems. For use with older versions of Bundler or other custom gem vendoring schemes.
config.webinf_filesis a file list that can contain multiple files, XML or otherwise. If the files named in this list have
.erbextensions, they will be expanded in the same manner as
Rails 3 support
JRuby-Rack, the servlet adapter component bundled by Warbler, also received a version bump, and there are no longer any Java libraries included in the Warbler gem, so the two components can be versioned independently. With the release of both Warbler 1.0 and JRuby-Rack 0.9.7, Rails 3 applications can be warbled and deployed seamlessly, often without any additional configuration.