Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add documentation #473

Merged
merged 3 commits into from

3 participants

@oscardelben

This adds documentation for

  • Rack::Config (added example)
  • Rack::Head
  • Rack::Lock

I'm open to expanding on the documentation with more examples if needed. There are also more middleware to document, but this is a start.

@oscardelben

I've removed the caveats section. I can squash commits if you'd like.

@cwjenkins

Can you please shed some light as to why the caveat section isn't required? or is 'wrong' ? I'm still trying to find a better solution to issue #463 and it would be great to know if I'm simply doing something wrong.

@raggi
Owner

@oscardelben please squash, I'd rather not have that searchable in the history as it's misleading.

@raggi raggi merged commit d631cb1 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 28, 2012
  1. @oscardelben

    Document Rack::Lock

    oscardelben authored
  2. @oscardelben

    Document Rack::Head

    oscardelben authored
  3. @oscardelben

    Document Rack::Config

    oscardelben authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +5 −0 lib/rack/config.rb
  2. +2 −0  lib/rack/head.rb
  3. +2 −0  lib/rack/lock.rb
View
5 lib/rack/config.rb
@@ -1,6 +1,11 @@
module Rack
# Rack::Config modifies the environment using the block given during
# initialization.
+ #
+ # Example:
+ # use Rack::Config do |env|
+ # env['my-key'] = 'some-value'
+ # end
class Config
def initialize(app, &block)
@app = app
View
2  lib/rack/head.rb
@@ -1,6 +1,8 @@
module Rack
class Head
+ # Rack::Head returns an empty body for all HEAD requests. It leaves
+ # all other requests unchanged.
def initialize(app)
@app = app
end
View
2  lib/rack/lock.rb
@@ -2,6 +2,8 @@
require 'rack/body_proxy'
module Rack
+ # Rack::Lock locks every request inside a mutex, so that every request
+ # will effectively be executed synchronously.
class Lock
FLAG = 'rack.multithread'.freeze
Something went wrong with that request. Please try again.