grails


21
Aug 10

Making Git to Add Empty Directories

Since git is a “content” based SCM, and empty directories by git are not considered to be content [ which is arguable ], the only way to add them is to add “.gitignore” to every empty directory.

That may sound like a weird task after each time you create a Grails / Rails / Spring Roo / … project, since there are going to be many empty directories right from start.

To ease the pain, here is an alias you can add to your “.bashrc” to use before “git add .”:

# add '.gitignore' to all the empty dirs
alias ged='for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done;'

one liner author: justinfrench.com


26
Nov 09

Learn Grails by Its Plugins

Grails PluginsHow do you approach learning new technology? Google it? Buy a book? Go to training? Start using it for your work?

Well, I figured that the answer to that would depend on the technology itself. And although I bought a Grails book, and spend sometime googling and building little Grails POC projects, and actually used it for work, I still felt that something is missing, that there is that gap between me and Grails.

That is when I discovered that the best way to learn Grails, to understand its guts, is to contribute to it.

Normally, in order to get a commiter status to a mature open source project you would have to open lots of JIRAs, provide many patches, donate many ideas, etc… In case of Grails, it is actually extremely easy and fast. Here are three easy steps to see you code posted on “grails.org”:

For more logistics refer to the official grails create plugins guide. But that is really it! That is how easy it is to join Grails developer community, and grow from a Consumer to the Creator.

I got lucky and saw a live presentation by Jeff Brown at Groovy on Grails One Day Seminar in Philly. That is when I got excited, and started to work on my own plugin during the seminar’s hackathon. Two days later I had a 0.1 version of plugin commited to github, three days later released it to grails.org. Just think about it – three days from scratch, and you can become a creator of an official Grails plugin – how cool is that?

Now go and create that plugin!


20
Jul 09

Blue Grails and not so Bluehost

Groovy on GrailsSomething pretty funny happened to me today. I went to the Bluehost website, just because I have one of my Rails applications deployed there, and without doing much of a research (did not spend 4 seconds googling), using their online chat, I decided to ask Bluehost support team about their Java support.

Our dialogue was quite short, and very amusing (“first time sales” is me):

Blue Host Support:                           Welcome to our real-time sales chat. How can I help you today?
 
FIRST TIME SALES QUESTION:        hello
Blue Host Support:                           how can I help you today?
FIRST TIME SALES QUESTION:        hi Bluehost
                                                         can you guys host a Grails app?
 
Blue Host Support:                           what requirements does it have?
FIRST TIME SALES QUESTION:        what do you mean?
                                                         we have a couple of Grails apps and looking for hosting
 
Blue Host Support:                            what is grails?
                                                         a programming language I assume
                                                         what is it based on?
 
FIRST TIME SALES QUESTION:        http://www.grails.org/
                                                         Groovy
 
Blue Host Support:                            looks like it is used with Java
                                                         we don't run Java
                                                         that isn't possible on our servers

It is hard to hold your smile when one of the biggest hosting companies comes up with phrases like “What is Grails?” and “Java? That isn’t possible on our servers“. Still smiling…