Sha256: 3d43cbd47e443c114172dc0856ed09558f22fe3a989c02b045262179c8d97afb

Contents?: true

Size: 1.46 KB

Versions: 3

Compression:

Stored size: 1.46 KB

Contents

# Rack::LinkHeaders [![Build Status](https://travis-ci.org/jgraichen/rack-link_headers.png?branch=master)](https://travis-ci.org/jgraichen/rack-link_headers)

Easy Link header management for rack responses.

## Installation

Add this line to your application's Gemfile:

    gem 'rack-link_headers'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rack-link_headers

## Usage

```ruby
response.link "http://abc.de/", :rel => :search
response.link "http://test.host/feed.xml", :rel => :rss, :type => "application/rss+xml"
```
```
response.headers["Link"]
# => <http://abc.de/>; rel="rel", <http://test.host/feed.xml>; rel="rss"; type="application/rss+xml"
```

Manual set Link header will be overridden. All links can be
accessed via `links`:

```ruby
response.link "http://abc.de/", :rel => :search
response.link "http://test.host/feed.xml", :rel => :rss, :type => "application/rss+xml"

response.links
# => [{:url=>"http://abc.de/", :params=>{:ref=>:search}}, {:url=>"http://test.host/feed.xml", :params=>{:rel=>:rss, :type=>"application/rss+xml"}}]
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Add tests for your features.
4. Add your features.
5. Commit your changes (`git commit -am 'Add some feature'`)
6. Push to the branch (`git push origin my-new-feature`)
7. Create new Pull Request

## License

[MIT License](http://www.opensource.org/licenses/mit-license.php)

Copyright (c) 2013, Jan Graichen

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-link_headers-2.2.2 README.md
rack-link_headers-2.2.1 README.md
rack-link_headers-2.2.0 README.md