February 28, 2014 • 2 min read
When I was learning Ruby, Sinatra was the first framework I used. It’s popular in Ruby tutorials because it’s easy to use and understand. I’m a fan. Sometimes if you’re spinning up a sample app for a Meetup, Rails is not the right choice. Enter Sinatra. I’m sure it’s great for a lot of other things, but that’s how I’ve used it.
I’ve been trying to contribute to open source projects this year, and decided to work on Sinatra. After reading the documentation, I found a few misspellings. I think that typos and otherwise wrong information in a project’s documentation are worth fixing, because good documentation makes a project easier to use and implies that the code is mature and well-maintained.
After reading the contribution guidelines, I forked and cloned the documentation repo.
$ git clone https://github.com/jwworth/sinatra.github.com.git $ cd sinatra.github.com
Next, I made my changes and pushed them to Github.
$ git add . $ git commit -m 'Fix some typos' $ git push origin
On Github, I submitted my first pull request to Sinatra. A few hours later, the commit was merged into the project. Victory!
Not quite. Before long, a helpful Github user posted this comment on my contribution: ‘The files in _includes are generated from other sources. This change (and the change to the sinatra-streaming docs) will be overwritten when the docs are regenerated. It should be made in the sinatra-contrib repo…’
As it turns out, the documents I edited are auto-generated by another project, sinatra-contrib. Which means that the next time they are auto-generated, my contribution would be overwritten. Fail.
In order to make my changes last, I would need to submit them again to another project. Once I found that repo, I forked and cloned it.
$ git clone https://github.com/sinatra/sinatra-contrib.git $ cd sinatra-contrib
I made the changes (again) and pushed them up into a new pull request. This change was also merged in minutes; clearly it’s a quite active project.
I hope to soon get into more complex bug fixes, but I’m finding that many of the projects I love are so sophisticated, you have to hang around for a while before you know enough to add value. It’s a small barrier to entry, easily overcome. I am enjoying adding smaller contributions in the meantime.