rack-link_headers 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
# Rack::LinkHeaders
|
2
|
-
[![Build Status](https://travis-ci.org/jgraichen/rack-link_headers.png?branch=master)](https://travis-ci.org/jgraichen/rack-link_headers)
|
1
|
+
# Rack::LinkHeaders [![Build Status](https://travis-ci.org/jgraichen/rack-link_headers.png?branch=master)](https://travis-ci.org/jgraichen/rack-link_headers)
|
3
2
|
|
4
3
|
Easy Link header management for rack responses.
|
5
4
|
|
data/lib/rack-link_headers.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rack/response'
|
|
3
3
|
module Rack
|
4
4
|
module LinkHeaders
|
5
5
|
# Helper for easy adding link headers to rack responses.
|
6
|
-
module
|
6
|
+
module Helper
|
7
7
|
def self.included(base)
|
8
8
|
base.send :include, InstanceMethods
|
9
9
|
end
|
@@ -26,5 +26,8 @@ module Rack
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
Rack::Response.send :include, Rack::LinkHeaders::
|
30
|
-
Rack::Response::Helpers.send :include, Rack::LinkHeaders::
|
29
|
+
Rack::Response.send :include, Rack::LinkHeaders::Helper
|
30
|
+
Rack::Response::Helpers.send :include, Rack::LinkHeaders::Helper
|
31
|
+
|
32
|
+
ActionDispatch::Response.send :include, Rack::LinkHeaders::Helper if defined?(ActionDispatch::Response)
|
33
|
+
ActionController::TestResponse.send :include, Rack::LinkHeaders::Helper if defined?(ActionController::TestResponse)
|
@@ -1,9 +1,17 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
|
3
|
+
if ENV["GEM"].to_s.include?('ad')
|
4
|
+
require 'action_dispatch'
|
5
|
+
end
|
6
|
+
if ENV["GEM"].to_s.include?('ac')
|
7
|
+
require 'action_controller'
|
8
|
+
require 'action_controller/test_case'
|
9
|
+
end
|
10
|
+
|
3
11
|
require 'rack/response'
|
4
12
|
require 'rack-link_headers'
|
5
13
|
|
6
|
-
class
|
14
|
+
class HelperTest < MiniTest::Unit::TestCase
|
7
15
|
def setup
|
8
16
|
@response = Rack::Response.new
|
9
17
|
end
|
@@ -37,4 +45,16 @@ class HeaderHashHelperTest < MiniTest::Unit::TestCase
|
|
37
45
|
|
38
46
|
assert_equal "<http://google.com/path?query=5#frag> rel=\"search\"", @response.headers["Link"]
|
39
47
|
end
|
48
|
+
|
49
|
+
if ENV["GEM"].to_s.include?('ad')
|
50
|
+
def test_dyn_inject_action_dispatch_response
|
51
|
+
assert ActionDispatch::Response.new.respond_to? :link
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
if ENV["GEM"].to_s.include?('ac')
|
56
|
+
def test_dyn_inject_action_controller_test_response
|
57
|
+
assert ActionController::TestResponse.new.respond_to? :link
|
58
|
+
end
|
59
|
+
end
|
40
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-link_headers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -41,10 +41,10 @@ files:
|
|
41
41
|
- README.md
|
42
42
|
- Rakefile
|
43
43
|
- lib/rack-link_headers.rb
|
44
|
-
- lib/rack/link_headers/
|
44
|
+
- lib/rack/link_headers/helper.rb
|
45
45
|
- lib/rack/link_headers/version.rb
|
46
46
|
- rack-link-headers.gemspec
|
47
|
-
- test/
|
47
|
+
- test/helper_test.rb
|
48
48
|
homepage: ''
|
49
49
|
licenses: []
|
50
50
|
post_install_message:
|
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
segments:
|
61
61
|
- 0
|
62
|
-
hash: -
|
62
|
+
hash: -3994897237737635876
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
segments:
|
70
70
|
- 0
|
71
|
-
hash: -
|
71
|
+
hash: -3994897237737635876
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
74
|
rubygems_version: 1.8.24
|
@@ -76,4 +76,4 @@ signing_key:
|
|
76
76
|
specification_version: 3
|
77
77
|
summary: Easy Link header management for rack responses.
|
78
78
|
test_files:
|
79
|
-
- test/
|
79
|
+
- test/helper_test.rb
|