Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Example app for Episode 1 of Classy Web Development with Sinatra

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 public
Octocat-spinner-32 test
Octocat-spinner-32 views
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Capfile
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
Octocat-spinner-32 shortener.rb
README.markdown

shorten

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.

Installation

% 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

Testing

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

Running

% rackup config.ru
% open http://localhost:9292
Something went wrong with that request. Please try again.