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
@@ -2,3 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 1.8.7
5
+ env:
6
+ - GEM=ac
7
+ - GEM=ap
data/Gemfile CHANGED
@@ -6,4 +6,5 @@ gemspec
6
6
  group :development do
7
7
  gem 'minitest'
8
8
  gem 'rake'
9
+ gem 'actionpack', :require => false
9
10
  end
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
 
@@ -1,4 +1,4 @@
1
- require 'rack/link_headers/header_hash_helper'
1
+ require 'rack/link_headers/helper'
2
2
 
3
3
  module Rack
4
4
  module LinkHeaders
@@ -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 HeaderHashHelper
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::HeaderHashHelper
30
- Rack::Response::Helpers.send :include, Rack::LinkHeaders::HeaderHashHelper
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)
@@ -2,7 +2,7 @@ module Rack
2
2
  module LinkHeaders
3
3
  module VERSION
4
4
  MAJOR = 2
5
- MINOR = 0
5
+ MINOR = 1
6
6
  PATCH = 0
7
7
  STAGE = nil
8
8
 
@@ -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 HeaderHashHelperTest < MiniTest::Unit::TestCase
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.0.0
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-17 00:00:00.000000000 Z
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/header_hash_helper.rb
44
+ - lib/rack/link_headers/helper.rb
45
45
  - lib/rack/link_headers/version.rb
46
46
  - rack-link-headers.gemspec
47
- - test/header_hash_helper_test.rb
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: -121590991522842654
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: -121590991522842654
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/header_hash_helper_test.rb
79
+ - test/helper_test.rb