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 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
Thursday, November 11, 2010
Request => Response Thursday, November 11, 2010
Request HTTP CGI Thursday, November 11, 2010
Response Status Header Body Thursday, November 11, 2010
Rack Spec http://chneukirchen.org/talks/euruko-2007/neukirchen07introducingrack.pdf Thursday, November 11, 2010
Demo • HTTP Client and HTTP Server Thursday, November 11, 2010
Rack Distribution • Specification • Handlers • Adapters • Middlewares • Utilities Thursday, November 11, 2010
Rack Specification • Rack::Lint Thursday, November 11, 2010
Rack Handlers • CGI • FastCGI • Mongrel • WEBrick • Thin • Passenger • Unicorn Thursday, November 11, 2010
Thursday, November 11, 2010
Rack Adapters • Camping • Rails • Sinatra • .... Thursday, November 11, 2010
Camping Adapter Thursday, November 11, 2010
Rack Middleware • Rack::Reloader • Rack::ShowExceptions • Rack::CommonLogger • Rack::Static Thursday, November 11, 2010
Rack Utilities • Rack::Request + Rack::Response • Rack::MockRequest + Rack::MockResponse • Rack::Builder + rackup Thursday, November 11, 2010
Debugging Libraries • Rack::Lint and Rack::ShowExceptions • Rack::Bug • Rack::Debug Thursday, November 11, 2010
Advantages • Less Work • No external configuration • Easy to test Thursday, November 11, 2010
Demo • Hello World Rack App Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
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
Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
The rackup file • Configuration DSL for a Rack app • Server independent • Allows stacking of middleware • Provides simple route mapping Thursday, November 11, 2010
Thursday, November 11, 2010
Routing • Rack::Builder • Rack::Mount • Rack::URLMap Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
Middleware Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
Thursday, November 11, 2010
Middleware • Utilities that combine, compose, aggregate or modify Rack application • Ruby Object • Stackable • Pipe for HTTP Processing Thursday, November 11, 2010
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
HTTP \m/ \m/ \m/ APP Thursday, November 11, 2010
http://github.com/rack/rack-contrib Thursday, November 11, 2010
Rails 2.3 http://guides.rubyonrails.org/rails_on_rack.html#internal-middleware-stack Thursday, November 11, 2010
Rails 2.3 Thursday, November 11, 2010
SSO Thursday, November 11, 2010
SSO Thursday, November 11, 2010
SSO Thursday, November 11, 2010
Thursday, November 11, 2010
Recommend
More recommend