Sha256: 143a95ced55181280b3f4c87d713840bb232e0ccd2417d07fe487fb7c614a995

Contents?: true

Size: 1.5 KB

Versions: 44

Compression:

Stored size: 1.5 KB

Contents

= New Features

* A type_routing plugin has been added.  This plugin allows routing
  based on the requested type, which can be submitted either via a
  file extension or Accept header:

    plugin :type_routing

    route do |r|
      r.get 'a' do
        r.html{ "<h1>This is the HTML response</h1>" }
        r.json{ '{"json": "ok"}' }
        r.xml{ "<root>This is the XML response</root>" }
      end
    end

    # /a or /a.html => HTML response
    # /a.json => JSON response
    # /a.xml => XML response

  The response content type is set appropriately when the r.html,
  r.json, or r.xml block is yielded to.  Using plugin options, you can
  add support for custom types, and choose whether to use only file
  extensions or only Accept headers for type matching.

* A request_headers plugin has been added. This allows easier access
  to request headers.  For example, to access a header called
  X-My-Header, by default you would need to use the CGI mangled name:
    
    r.env['HTTP_X_MY_HEADER']

  The request_headers plugin allows the easier to use:

    r.headers['X-My-Header']

* An unescape_path plugin has been added.  By default, Roda does not
  unescape a URL-encoded PATH_INFO before routing.  This plugin allows
  URL-encoded PATH_INFO to work, supporting %2f as well as / as path
  separators, and having captures return unescaped values:

    plugin :unescape_path
  
    route do |r|
      # Assume /b/a URL encoded at %2f%62%2f%61
      r.on :x, /(.)/ do |*x|
        # x => ['b', 'a']
      end
    end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
roda-3.28.0 doc/release_notes/2.16.0.txt
roda-3.27.0 doc/release_notes/2.16.0.txt
roda-3.26.0 doc/release_notes/2.16.0.txt
roda-3.25.0 doc/release_notes/2.16.0.txt
roda-3.24.0 doc/release_notes/2.16.0.txt
roda-3.23.0 doc/release_notes/2.16.0.txt
roda-3.22.0 doc/release_notes/2.16.0.txt
roda-3.21.0 doc/release_notes/2.16.0.txt
roda-3.20.0 doc/release_notes/2.16.0.txt
roda-3.19.0 doc/release_notes/2.16.0.txt
roda-3.18.0 doc/release_notes/2.16.0.txt
roda-3.17.0 doc/release_notes/2.16.0.txt
roda-3.16.0 doc/release_notes/2.16.0.txt
roda-3.15.0 doc/release_notes/2.16.0.txt
roda-3.14.1 doc/release_notes/2.16.0.txt
roda-3.14.0 doc/release_notes/2.16.0.txt
roda-3.13.0 doc/release_notes/2.16.0.txt
roda-3.12.0 doc/release_notes/2.16.0.txt
roda-3.11.0 doc/release_notes/2.16.0.txt
roda-3.10.0 doc/release_notes/2.16.0.txt