Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

East Bay Rails: January 2012


Published on

Presentation slides for East Bay Rails: January 2012.

Published in: Technology

East Bay Rails: January 2012

  1. 1. Building Ruby Applications With Sinatra January 5, 2012 East Bay Rails Meetup
  2. 2. Outline Sinatra, Bootstrap and RSpec• Sinatra vs. Rails• Random Text Generator• Sinatra Routes• TDD with RSpec• Bootstrap
  3. 3. Sinatra vs. Rails• Lighter, rack-based alternative to Rails.• Pro & Con: Less structure.• Does not enforce MVC.• Supports Rails toolchain: Gemfile, etc.
  4. 4. Random Text Generator• Serving up asdf and Lorem Ipsum text.• No back-end, various options available.• Modular, reusable design.
  5. 5. Sinatra Routes Example route pattern with named parameterget /hello/:name do # matches "GET /hello/foo" and "GET /hello/bar" # params[:name] is foo or bar "Hello #{params[:name]}!"end
  6. 6. TDD with RSpec Setup in spec_helperRSpec.configure do |config| config.include Rack::Test::Methodsend
  7. 7. BootstrapCSS Framework built with Less by Twitter get stylesheets/bootstrap.css do end
  8. 8. References• Sinatra:• Redis: Sinatra-Redis Tutorial:• Bootstrap.js:•