I don’t follow Yehuda Katz’ blog (though I should) but he posted an article on basic gem configuration and build steps. It irks me to no end when I clone a git repo and run through the following process:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
When it could simply be:
1 2 3 4 |
|
The first scenario happens when someone uses a tool like jeweler to build their gemspec and forgets to commit the latest generated (or what should have been generated) gemspec. Jewler likes to list every single file packaged with the gem, so the gemspec must be refreshed whenever a file is added or removed. When writing a gemspec by hand one, can simply say “all the files in the lib directory are part of this gem.” You can use a handy tool like a .gitignore to prevent unwanted files from appearing in your gem.
Why is this such a big issue? Because, as Yehuda wrote, writing your own gemspec isn’t that hard. In fact, it’s kind of enjoyable, being that it’s a Ruby DSL. Ruby was designed to cause the lowest amount of pain for developers. Our Ruby code should reflect that ethos.