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’