test-driven development (TDD) in sinatra

In the last post, I built a simple web service for looking up some basic geolocation information for a given zip code. To make sure the database was returning the expected output, Iย used irb to run specific commands. I decided to try out MiniTestย and follow basic TDD principles to programmatically test out the zip code web service. MiniTest makes this really easy and, as a programming language, it's quite readable. Check out the simple test cases I used to make sure that the web service was returning accurate information (at least for 1…Read more …

building geocode2 from source

So I've officially given up on figuring out how to get the right libraries installed for GTG so that I can test out its geolocalization features. But, if you've seen my previous posts, you know it's been a painful process since I just can't seem to get the right libraries installed to get things working. But I'm going to go out on a limb and guess that this might not be entirely my fault because, from what I can tell, it seems like this particular feature is a rather old project? So maybe…Read more …

bootstrap v3 accordion

Was banging my head on the wall for hours trying to figure out a bug in Bootstrap's accordion component. I followed the example code in the Bootstrap doc, but for some reason, the accordion would only toggle once. So if it was initially open, then I could collapse it, but clicking on it again, wouldn't open it. If the accordion was initially closed, I could open it (once), but then clicking on it again wouldn't close it. Turns out this was the issue: http://stackoverflow.com/questions/17202285/bootstrap-collapse-only-toggles-once The solution suggests that there's a conflict with an…Read more …

starting from a clean slate

I'm getting back into Fedora stuff again (working on front-end dev & design for Hyperkitty). I originally submitted something for consideration back in October, but since it's been awhile, I thought I'd try to see how easy it would be to integrate my submission into the main repo via a pull request. Turns out it wasn't as easy as I had hoped. It was recommended that I do a rebase, but that ended up leading to lots of conflicts. Most likely because there had been other front-end commits before mine, which meant that…Read more …

getting started with sinatra and postgres web service

I'm in the process of resurrecting some of my past projects. One of themย is a web service that provided details for a given zip code. For example, you could lookup the zip code '15213' and the web service would spit out the geographical center for the zip code (i.e., the latitude and longitude coordinates), as well as the city and state for that zip. I originally programmed the web service using Ruby on Rails, but using RoR for a relatively simple API is a bit overkill. So I decided to use this project…Read more …