Holy Grails

I started toying with Grails today. I haven’t done much with it since 0.3.1 and now I’ve been hearing all this stuff about plugins, OpenLaszlo integration and AJAX so I gotta get in on the fun. After installing (downloading, extracting the archive, and setting some environment variables) I ran the grails command to see 0.4.1 echoed back in my terminal. I then tried grails help and my CPU shot through the roof. I get a message saying, “This happens when scripts change or the first time you use Grails.” followed by a list of “Overriding previous definition of reference to groovyJarSet” messages. No problem, so I let it run figuring it’s just some one time initialization stuff. It runs for several minutes before my CPU calms down. (I realize this because my fan stops spinning as fast so my machine gets quiet.) I then notice a message indicating some service is listening on port 7000. I also see log output from my GSpec project above that message. “Now that’s strange!”, I exclaim mentally. “Grails now bundles GSpec scripts in it’s help mechanism. I’m still not understanding why it’s waiting for me to connect to port 7000 to get the help I requested.” After some digging through source code I see that grails wants to provide help for all of it’s scripts. I see that it looks in a scripts folder in its install home. It also scans a scripts folder under what Ant considers the “$basedir”. Anybody who knows Ant will know that “$basedir” is the current VM working folder and since I was in my home folder it decided to pick up my personal scripts folder there. My personal scripts folder is a folder upon which I bequeathed the name “scripts”. The name seemed to fit at the time because it was a place where I was shoving miscellaneous scripts of all sorts. Any beanshell prototyping, SQL ad-hoc stuff, Groovy experimenting went on in that folder. It collected a fair number of “scripts” over time (about 30-40) and became my point of reference for great ideas. Apparently Grails wanted to share my great ideas with me this morning so it went digging through “scripts” to show me how brilliant I’ve been over time. Going back to the console logs I see all of my egg headed work echoed back between the “grails help” command and the final “I’m chilling on port 7000 waitin’ for you to call me” message. What a blessing to be reminded of how smart I am first thing in the morning.

Please don’t take this as a stab at Grails. It’s a great framework and we’re all lucky to live in an age that includes it. It’s more about how great I am at locating my random code smatterings in a commonly named folder like “scripts”. Eventually somebody was going to go rooting around in there and I should have known better. So I now ask, has anything like that ever happened to you? Have you ever been surprised by your work in the past sneaking through your interpreter at a time when you thought the world was safe from invasion? Break me off somethin’

2 thoughts on “Holy Grails

  1. LOL! I always knew that feature was a bad idea. We’re probably going to remove it for 0.5 and have grails help just print the available scripts and then have it take an argument like:

    grails help run-app

    For more info about a particular scripts. That sure was funny though 😉


  2. I wouldn’t call it a bad idea. Instead I think it’s one that should come with a big red label attached, “WARNING! Grails reserves the right to search any and all directories for scripts. It will use these scripts to ascertain your coding style while it spins another thread to find a potential developer of the opposite gender with compatible coding habits on match.com. Please do not touch your mouse or keyboard while this process runs as disturbance will skew the accuracy of the match-finder which will lead to unpredictable results in your dating experience.”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s