Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby on Rack Small Talk

Ruby on Rack Small Talk

Rack is the minimal, modular, and adaptable interface that Ruby frameworks like Rails and Sinatra are built on. In this small talk we'll explore what makes Rack an adaptable interface for building Ruby applications and middleware, and then walk through a Rack application utilizing custom Rack middleware.

Meagan Waller

April 25, 2014
Tweet

More Decks by Meagan Waller

Other Decks in Technology

Transcript

  1. “rack aims to provide a minimal api to develop web

    applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” - Christian Neukirchen, author of rack
  2. “rack aims to provide a minimal api to develop web

    applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” - Christian Neukirchen, author of rack A Minimal api
  3. “rack aims to provide a minimal api to develop web

    applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” - Christian Neukirchen, author of rack A Minimal api
  4. - Christian Neukirchen, author of rack “rack aims to provide

    a minimal api to develop web applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” connecting web servers
  5. web server interface Provides standard way for ruby apps to

    talk to web servers use with webrick, mongrel, thin, puma, etc.
  6. - Christian Neukirchen, author of rack “rack aims to provide

    a minimal api to develop web applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” connecting web servers
  7. - Christian Neukirchen, author of rack “rack aims to provide

    a minimal api to develop web applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” ruby web frameworks
  8. ruby web frameworks the simple protocol makes it easy to

    compose powerful applications by stacking rack apps and middleware on top of each other.
  9. ruby web frameworks the simple protocol makes it easy to

    compose powerful applications by stacking rack apps and middleware on top of each other. Rack apps and middleware
  10. rack apps & middleware it comes between calling the client

    and the server process the request before sending it to the server
  11. rack apps & middleware it comes between calling the client

    and the server Process response before returning to the client
  12. let’s build a rack application rack middleware Mounted Rack apps

    Static assets oauth with github user sessions routing template rendering features:
  13. “rack aims to provide a minimal api to develop web

    applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” - Christian Neukirchen, author of rack A Minimal api
  14. - Christian Neukirchen, author of rack “rack aims to provide

    a minimal api to develop web applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” connecting web servers
  15. - Christian Neukirchen, author of rack “rack aims to provide

    a minimal api to develop web applications in Ruby, for connecting web servers supporting Ruby (like webrick, mongrel, etc) and ruby web frameworks (like rails, sinatra, etc).” ruby web frameworks
  16. sources & links chris neukirchen, blog post “introducing rack”: http://chneukirchen.org/blog/archive/2007/02/introducing-rack.html

    ruby on rack demo application repository: https://github.com/meaganewaller/ruby-on-rack-example Rails on Rack in the Ruby Guides http://guides.rubyonrails.org/v3.2.13/rails_on_rack.html http://rubylearning.com/blog/a-quick-introduction-to-rack/ A quick introduction to rack sinatra repository https://github.com/sinatra/sinatra/ forked rack with puts statements https://github.com/meaganewaller/rack