puts Blog.new(”nonsense”)

Archive for February, 2008

Groovy Recipes: Greasing the Wheels of Java

Posted by Jason Rudolph on 27th February 2008

The first print copies of Scott Davis’s new book, Groovy Recipes: Greasing the Wheels of Java, debuted last week at 2GX.

2008-02-27 Groovy Recipes Cover

I had the pleasure of reviewing the book prior to its release, and I’m happy to say that Scott has clearly assembled the go-to guide for turning Groovy into every Java developer’s perfect utility knife. Whether you need to quickly parse an Atom feed, serve up an Excel spreadsheet from your Grails app, or create a tarball on the fly, this book will show you how. In true Groovy style, Scott does away with all unnecessary ceremony and gets right down to business. In almost every section, the very first thing you see is code - the recipe for solving to the problem at hand - and if you want to stick around for the clear and informative explanation, well, that’s strictly optional.

Tags: , , | No Comments »

Getting Started with Grails: The Acegi “Expansion Pack”

Posted by Jason Rudolph on 26th February 2008

InfoQ recently published a step-by-step tutorial for quickly installing and configuring the Grails Acegi plugin into the Racetrack application (originally developed in Getting Started with Grails). Kudos to Fadi Shami for assembling this handy guide.

20080226 Grails + Acegi

You can find out more about the Grails Acegi plugin and the rest of the fast-growing plugin ecosystem at the official Grails plugin site.

Tags: , | No Comments »

Refactotum: 2GX Edition

Posted by Jason Rudolph on 24th February 2008

The inaugural Groovy/Grails Experience (2GX) is in the bag, and as much as I was looking forward to it, it honestly exceeded my expectations rather significantly. The sheer enthusiasm for Groovy (and Grails) in the Java community is almost palpable.

2GX T-Shirt

The event capped off with a new installment of Relevance’s Refactotum series. Jay Zimmerman (Director of 2GX and the popular NFJS Symposium Series) was kind enough to dedicate the final afternoon of the conference to this unique session demonstrating the ease of contributing to open source, followed immediately by a workshop for putting those techniques into practice. Coming out of the Refactotum, we had a widely diverse set of contributions, all of which make meaningful improvements to Grails. The resulting set of patches involve increasing test coverage, refactoring for readability, boarding up broken windows, reducing complexity, and a handful of other improvements as well. And perhaps the most rewarding part (for me, at least) of the three-day conference was talking to the several people that stopped by afterward, each to express that while they had never before understood just how easy it is to get involved in open source, now they know, and each seemed downright eager to contribute!

Special thanks to Scott Davis, Jeff Brown, Dierk König, Alex Tkachman, Alexandru Popescu, Ken Kousen, and Daniel Hinojosa for their excellent and insightful contributions to the discussion!

Resources

Slides

Helpful Links and Tools Discussed

Resulting Patches (Keep ‘em Coming!)

§The controversy of testing private methods isn’t unique to Groovy…but seems common to Refactotums. ;-)

Tags: , , , | 1 Comment »

test/spec/rails => You Bettuh Recognize

Posted by Jason Rudolph on 8th February 2008

Believe it or not, there are still at least a few of us crazy hold-outs that still haven’t imbibed the increasingly ubiquitous RSpec Kool-Aid. And for the folks in this crowd that still want BDD-style testing, it’s test-spec and test/spec/rails all the way. So when I recently needed a means for validating that a nontrivial route landed in the right controller/action, I naturally went looking for the test/spec/rails equivalent of #assert_recognizes. When I saw that it was nowhere to be found, I knew I’d found another task for Open Source Fridays (er, the first half hour of an Open Source Friday). And thanks to Matthew Bass’s uncanny responsiveness in applying the patch that Rob Sanheim and I submitted, test/spec/rails now offers some handy new specs for testing your routes.

assert_generates => should.route_to

Where you’d use #assert_generates in traditional Rails + test/unit, test/spec/rails now supports #route_to as a more spec-flavored alternative. For example, to verify that a given set of URL options routes to the expected path…

  1. assert_generates "/users/1", :controller => "users", :action => "show", :id  => "1"


becomes

  1. {:controller => "users", :action => "show", :id  => "1"}.should.route_to "/users/1"

assert_recognizes => should.route_from

And where our ancestors once used #assert_recognizes, test/spec/rails now offers #you_bettuh_recognize #route_from. “An example would be nice”, you say? Well, to perform essentially the inverse of the above test…

  1. assert_recognizes({:controller => "users", :action => "show", :id => "1"}, {:path => "/users/1", :method => :get})
 
becomes

  1. {:path => "/users/1", :method => :get}.should.route_from :controller => "users", :action => "show", :id =>"1"


- - -

The rdoc offers additional examples, and check out the test/spec/rails README for more mappings from old-school test/unit assertions to test/spec/rails equivalents.

Tags: , , | No Comments »

Grails Goes 1.0

Posted by Jason Rudolph on 5th February 2008

Grails 1.0 is in the wild!

Grails Logo

Check out the release notes, download the new hotness, and for Pete’s sake (er, Neal’s sake?), take that old web framework out behind the barn already.

Tags: , | 1 Comment »

Podcast Interview with aboutGroovy.com: The Sequel

Posted by Jason Rudolph on 4th February 2008

It’s been almost a year since I first sat down with Scott Davis for an aboutGroovy.com interview, and the upcoming Groovy/Grails Experience seemed as good a reason as any for us to catch up.

2008-02-04 aboutGroovy.com

In addition to discussing the various conference sessions in the works, we also spend a few moments exploring some relative merits of Rails and Grails. While we won’t tell you which framework is right for you, I do suggest some key features that each framework could stand to adopt from the other, and we even discuss how some of that cross-pollination is already coming to fruition.

Many thanks to Scott for having me on the podcast.

Download the MP3 directly

or

Subscribe to aboutGroovy.com podcasts via RSS

Tags: , , , , , | No Comments »