Jeff Kreeftmeijer

.gitignore your *.gemspec

2010-04-02

I read @pengwynn’s tweet asking people to stop touching his gemspec and I totally agreed, it’s pretty annoying that people keep sending patches for your gems with updated gemspecs, right? Updating the gemspec is the gem owners job. Stop it.

It didn’t occur to me until I read @qrush’s response.

In the past, we had to push gemspecs to our repos to make github build gems. Newsflash; Github stopped doing that.

Right now you’re probably using Jeweler to quickly generate a gemspec and release your gem.

So, why are you pushing your gemspec to your repo? The only time you ever need one is when installing your gem locally or releasing it. You always generate a new gemspec when you do that, right? That’s my point.

Still, lots of people — even the cool kids — can’t kill their old habits. Lets get overly dramatic about this and try to stop this madness. Add this to your .gitignore file;

*.gemspec

Then, rm [yourgem].gemspec from your repo and tell all your friends to read this post and do the same. Let’s do this. Who’s with me?

This post has a follow-up. Be sure to read “Don’t put your *.gemspec in your Rakefile” too.