Warbler 1.0

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.

Assemble in-place

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.

Simpler extension

Warbler also underwent an internal refactoring that should make extending it much easier. Here’s how you add Warbler tasks to your Rakefile:

require 'warbler'
Warbler::Task.new

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.

require 'warbler'
Warbler::Task.new
task :war => "asset:packager:build_all"

Bundler support

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.

More configuration

There are a number of new configuration options, so check out the new configuration and see if any are useful to you.

  • config.gem_home allows 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_files is a file list that can contain multiple files, XML or otherwise. If the files named in this list have .erb extensions, they will be expanded in the same manner as web.xml.

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.

Please continue to send feedback to the JRuby mailing list or the Warbler bug tracker. Enjoy!

Tags ,  | 2 comments

Comments

  1. Avatar Mike said about 9 hours later:

    Could you do a tutorial on deploying a jruby application with tools like capistrano or vlad? I think a lot of people would be more interested in jruby, however I don’t see a lot of information on how to build the server and deploy to it.

  2. Avatar Steven Hansen said 1 day later:

    Dude, you rock.

    Thanks so much for your work on warbler, much appreciated!