Category: Groovy
-
(dc..bos): Train Stations as a Groovy Range
I’ve been working on a presentation about interesting features in Groovy, and I came up with an example that I like but is probably too long to do in the available time, so I thought I’d show it here. The idea is to illustrate how any class can be made into a Groovy range by…
-
Password authentication using Groovy
This week I was at a client site that was about as locked down as any I’ve seen. Personally I find that incredibly short-sighted on the part of the company, but it’s always easier to say no, I suppose. While it was annoying enough to set up a browser to surf the web, that’s not…
-
From now on, I’m calling it GroovyString
I’ve been doing a lot of introductory Groovy presentations lately, and an issue keeps coming up that I feel I have to address. I’ve had to think hard about how to do this, though, because I don’t want to be misunderstood. I’m probably going to fumble it a bit, so please forgive me if I…
-
Elvis carried away by spaceships
I love teaching Groovy to existing Java developers, because they have such a hard time holding back Tears Of Joy when they see how much easier life can be. Today, though, I did a quick demo that resulted in a line of Groovy that was so amusing I had to post it here. Consider a…
-
Groovy StubFor magic
I finished revising the testing chapter in Making Java Groovy (the MEAP should be updated this week), but before I leave it entirely, I want to mention a Groovy capability that is both cool and easy to use. Cool isn’t the right word, actually. I have to say that even after years of working with…
-
log.rofl(‘Fun with Groovy metaprogramming’)
Recently I saw a post by someone (I think it was @jbarnette, but it was retweeted to me) suggesting that there should be some alternate log levels, like fyi, omg, or even wtf. I thought that was pretty funny, but then it occurred to me I could probably implement them using Groovy metaprogramming. As a…
-
GroovyShellTestCase for testing Groovy scripts
I try to keep up with developments in the Groovy and Grails worlds. I really do. I follow most of the core team members on Twitter. I listen to the Grails Podcast when I can. I go to many conferences and attend other talks when I’m not speaking. I try to follow the email lists,…
-
Up and Running Groovy: An O’Reilly screencast for my Manning book (wait, what?)
Way back in the Spring of 2009, I was contacted by an editor at O’Reilly about doing a couple of “targeted video/screencasts”. This person (who is no longer there — I’d give you his name but I haven’t asked his permission yet) had the idea of getting people together in an informal setting and talking…
-
Converting Groovy maps to query strings
Yesterday I was teaching a class on Groovy when I suddenly realized there was a simpler way to do something I’d been doing for years. I like showing developers how easy it is to access RESTful web services with just a couple of lines of Groovy. The process is particularly simple if all you need…