Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update README

  • Loading branch information...
commit 967503dc0887e00c1160aec25bc7aa0be048bed3 1 parent e83e97e
Martin authored

Showing 3 changed files with 33 additions and 26 deletions. Show diff stats Hide diff stats

  1. +1 1  Manifest
  2. +0 25 README
  3. +32 0 README.md
2  Manifest
... ... @@ -1,7 +1,7 @@
1 1 .gitignore
2 2 LICENSE
3 3 Manifest
4   -README
  4 +README.md
5 5 Rakefile
6 6 examples.rb
7 7 lib/rack/accept_media_types.rb
25 README
... ... @@ -1,25 +0,0 @@
1   -===== Sumarry
2   -
3   -Rack convenience middleware for simplified handling of Accept header
4   -(env['HTTP_ACCEPT']). Allows ordering of its values (accepted media types)
5   -according to their "quality" (preference level).
6   -
7   -This wrapper is typically used to determine the request's prefered media
8   -type (see example below).
9   -
10   -===== Install
11   -
12   - gem install rack-accept-media-types --source http://gemcutter.org
13   -
14   -===== Examples
15   -
16   - env['HTTP_ACCEPT'] #=> 'application/xml;q=0.8,text/html,text/plain;q=0.9'
17   -
18   - req = Rack::Request.new(env)
19   - req.accept_media_types #=> ['text/html', 'text/plain', 'application/xml']
20   - req.accept_media_types.prefered #=> 'text/html'
21   -
22   -===== Links
23   -
24   -source:: http://github.com/mynyml/rack-accept-media-types
25   -rdocs:: http://docs.github.com/mynyml/rack-accept-media-types
32 README.md
Source Rendered
... ... @@ -0,0 +1,32 @@
  1 +Summary
  2 +-------
  3 +
  4 +Rack convenience middleware to simplify handling of Accept header
  5 +`env['HTTP_ACCEPT']`. Allows ordering of its values (accepted media types)
  6 +according to their "quality" (preference level).
  7 +
  8 +This wrapper is typically used to determine the request's prefered media type.
  9 +
  10 +Install
  11 +-------
  12 +
  13 + gem install rack-accept-media-types
  14 +
  15 +Example
  16 +-------
  17 +
  18 + require 'rack/accept_media_types'
  19 +
  20 + env['HTTP_ACCEPT'] #=> 'application/xml;q=0.8,text/html,text/plain;q=0.9'
  21 +
  22 + req = Rack::Request.new(env)
  23 + req.accept_media_types #=> ['text/html', 'text/plain', 'application/xml']
  24 + req.accept_media_types.prefered #=> 'text/html'
  25 +
  26 +Links
  27 +-----
  28 +
  29 +* code: <http://github.com/mynyml/rack-accept-media-types>
  30 +* docs: <http://docs.github.com/mynyml/rack-accept-media-types>
  31 +* wiki: <http://wiki.github.com/mynyml/rack-accept-media-types>
  32 +* bugs: <http://github.com/mynyml/rack-accept-media-types/issues>

0 comments on commit 967503d

Please sign in to comment.
Something went wrong with that request. Please try again.