Example app for Episode 1 of Classy Web Development with Sinatra. It takes long urls in and shortens them(sometimes) by making them into a SHA1 hash.
% gem sources *** CURRENT SOURCES *** http://gems.rubyforge.org % sudo gem sources -a http://gems.github.com http://gems.github.com added to sources % sudo gem install sinatra brynary-webrat json
There are only acceptance tests here, feel free to run a mutator on it. ;)
% rake (in /Users/atmos/p/shorten) rm -r coverage .. Finished in 0.068215 seconds 2 examples, 0 failures 97.1% 2 file(s) 135 Lines 105 LOC
% rackup config.ru % open http://localhost:9292