http rack github com
play

http://rack.github.com Thursday, November 11, 2010 Rack provides a - PowerPoint PPT Presentation

http://rack.github.com Thursday, November 11, 2010 Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills


  1. http://rack.github.com Thursday, November 11, 2010

  2. Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call. http://rack.rubyforge.org/doc/ Thursday, November 11, 2010

  3. Thursday, November 11, 2010

  4. Request => Response Thursday, November 11, 2010

  5. Request HTTP CGI Thursday, November 11, 2010

  6. Response Status Header Body Thursday, November 11, 2010

  7. Rack Spec http://chneukirchen.org/talks/euruko-2007/neukirchen07introducingrack.pdf Thursday, November 11, 2010

  8. Demo • HTTP Client and HTTP Server Thursday, November 11, 2010

  9. Rack Distribution • Specification • Handlers • Adapters • Middlewares • Utilities Thursday, November 11, 2010

  10. Rack Specification • Rack::Lint Thursday, November 11, 2010

  11. Rack Handlers • CGI • FastCGI • Mongrel • WEBrick • Thin • Passenger • Unicorn Thursday, November 11, 2010

  12. Thursday, November 11, 2010

  13. Rack Adapters • Camping • Rails • Sinatra • .... Thursday, November 11, 2010

  14. Camping Adapter Thursday, November 11, 2010

  15. Rack Middleware • Rack::Reloader • Rack::ShowExceptions • Rack::CommonLogger • Rack::Static Thursday, November 11, 2010

  16. Rack Utilities • Rack::Request + Rack::Response • Rack::MockRequest + Rack::MockResponse • Rack::Builder + rackup Thursday, November 11, 2010

  17. Debugging Libraries • Rack::Lint and Rack::ShowExceptions • Rack::Bug • Rack::Debug Thursday, November 11, 2010

  18. Advantages • Less Work • No external configuration • Easy to test Thursday, November 11, 2010

  19. Demo • Hello World Rack App Thursday, November 11, 2010

  20. Thursday, November 11, 2010

  21. Thursday, November 11, 2010

  22. Thursday, November 11, 2010

  23. Rack::Builder Rack::Builder implements a small DSL to iteratively construct Rack applications. http://rack.rubyforge.org/doc/classes/Rack/Builder.html Thursday, November 11, 2010

  24. Thursday, November 11, 2010

  25. Thursday, November 11, 2010

  26. Thursday, November 11, 2010

  27. The rackup file • Configuration DSL for a Rack app • Server independent • Allows stacking of middleware • Provides simple route mapping Thursday, November 11, 2010

  28. Thursday, November 11, 2010

  29. Routing • Rack::Builder • Rack::Mount • Rack::URLMap Thursday, November 11, 2010

  30. Thursday, November 11, 2010

  31. Thursday, November 11, 2010

  32. Thursday, November 11, 2010

  33. Thursday, November 11, 2010

  34. Thursday, November 11, 2010

  35. Middleware Thursday, November 11, 2010

  36. Thursday, November 11, 2010

  37. Thursday, November 11, 2010

  38. Thursday, November 11, 2010

  39. Middleware • Utilities that combine, compose, aggregate or modify Rack application • Ruby Object • Stackable • Pipe for HTTP Processing Thursday, November 11, 2010

  40. Middleware • Just a Rack application • Constructor takes next app down • Can modify request or response • Can call layer below or just return • Configured with ‘use’ in rackup file Thursday, November 11, 2010

  41. HTTP \m/ \m/ \m/ APP Thursday, November 11, 2010

  42. http://github.com/rack/rack-contrib Thursday, November 11, 2010

  43. Rails 2.3 http://guides.rubyonrails.org/rails_on_rack.html#internal-middleware-stack Thursday, November 11, 2010

  44. Rails 2.3 Thursday, November 11, 2010

  45. SSO Thursday, November 11, 2010

  46. SSO Thursday, November 11, 2010

  47. SSO Thursday, November 11, 2010

  48. Thursday, November 11, 2010

Recommend


More recommend