A new version of rawr has been released.

To install as a gem: gem i --source=http://gems.neurogami.com rawr

What’s changed is how rawr assembles the packaged application jar. This may break existing apps.

Many versions ago something changed in rawr such that when it grabbed the source files for bundling into an executable jar file it stripped some of the directory paths. For example, if you had files in lib/ruby/ they ended up in the root of the generated jar. Likewise, if you ad code in src/ they ended up in the root of the jar.

Not all paths were stripped; lib/ruby/foo/baz.rb would go into the root of the jar as foo/baz.rb

Surprisingly this did not seem to break things, at least based on the number of bug reports. I suspect the reason is that people assumed (correctly) that src/ and lib/ruby/ where part of $: and would then require files using paths relative to these folders. This worked because the root of the jar is part of $: a well. But that’s mere coincidence.

I noticed this because someone reported an issue about loading unpacked gem files; they managed to solve the problem with essentially no help from me, but it prompted me to do some exploring. When I found that paths were being partially truncated I went looking for jars created with older versions of rawr. This path-chopping seems to have been happening since 2009. Meanwhile, code using rawr worked.

Still, it made no sense to have the jar structure be different from the project source. It’s possible people have been doing assorted load path munging to make things work without giving it too much thought (i.e. “jar paths are weird”).

I found some programs from the early days of rawr, when configuration was done using YAML files, and the jars reflected the source folder structure.

In any event rawr 1.7.0 should now be creating jars with a structure that mirrors the source tree. The source paths defined in build_configuration.rb are also preloaded into $: as jar paths when you call Main.java.

I’ve tried this on assorted sample rawr projects and all seems well. If something breaks for you please file an issue on Github.

James Britt