rack-link_headers 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -6
- data/lib/rack/link_headers/version.rb +2 -2
- data/rack-link-headers.gemspec +5 -2
- data/test/helper_test.rb +7 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 671eeb60f4abb81feaee2bbe86a0ab04bf2608d47b27aa6c0bc2560d8171c327
|
4
|
+
data.tar.gz: ad43357571a86ed6732079cad2785f62b18c6f9f970f72c5b73332c8f9114d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 336743659f0eb6c603d2ab6da5f9d27f9057eb1f82ce2180549954b5339ada7836630bbfe349178a5fcf92aa65cbc90f00798f25bcc7383b86069b56b9e75cfd
|
7
|
+
data.tar.gz: edb4cea104f72b958f73dad53405cf3049572a0eb518e7d070f1fe78f5f49326ac77a0a22c5c9a4b41ba3999472fcd1f617fab86d86862b447349d57a376f7e6
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Rack::LinkHeaders
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/rack-link_headers?logo=ruby)](https://rubygems.org/gems/rack-link_headers)
|
4
|
+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jgraichen/rack-link_headers/test.yml?logo=github)](https://github.com/jgraichen/rack-link_headers/actions/workflows/test.yml)
|
4
5
|
|
5
6
|
Easy Link header management for rack responses.
|
6
7
|
|
@@ -8,15 +9,21 @@ Easy Link header management for rack responses.
|
|
8
9
|
|
9
10
|
Add this line to your application's Gemfile:
|
10
11
|
|
11
|
-
|
12
|
+
```ruby
|
13
|
+
gem 'rack-link_headers', '~> 2.4'
|
14
|
+
```
|
12
15
|
|
13
16
|
And then execute:
|
14
17
|
|
15
|
-
|
18
|
+
```console
|
19
|
+
bundle
|
20
|
+
```
|
16
21
|
|
17
22
|
Or install it yourself as:
|
18
23
|
|
19
|
-
|
24
|
+
```console
|
25
|
+
gem install rack-link_headers
|
26
|
+
```
|
20
27
|
|
21
28
|
## Usage
|
22
29
|
|
@@ -24,7 +31,8 @@ Or install it yourself as:
|
|
24
31
|
response.link "http://abc.de/", rel: :search
|
25
32
|
response.link "http://test.host/feed.xml", rel: :rss, type: "application/rss+xml"
|
26
33
|
```
|
27
|
-
|
34
|
+
|
35
|
+
```ruby
|
28
36
|
response.headers["Link"]
|
29
37
|
# => <http://abc.de/>; rel="rel", <http://test.host/feed.xml>; rel="rss"; type="application/rss+xml"
|
30
38
|
```
|
@@ -59,4 +67,4 @@ response.links
|
|
59
67
|
|
60
68
|
[MIT License](http://www.opensource.org/licenses/mit-license.php)
|
61
69
|
|
62
|
-
Copyright
|
70
|
+
Copyright © 2023, Jan Graichen
|
@@ -4,12 +4,12 @@ module Rack
|
|
4
4
|
module LinkHeaders
|
5
5
|
module VERSION
|
6
6
|
MAJOR = 2
|
7
|
-
MINOR =
|
7
|
+
MINOR = 4
|
8
8
|
PATCH = 0
|
9
9
|
STAGE = nil
|
10
10
|
|
11
11
|
def self.to_s
|
12
|
-
[MAJOR, MINOR, PATCH, STAGE].
|
12
|
+
[MAJOR, MINOR, PATCH, STAGE].compact.join '.'
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/rack-link-headers.gemspec
CHANGED
@@ -14,12 +14,15 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = ''
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
|
-
spec.
|
17
|
+
spec.required_ruby_version = '>= 2.7.0'
|
18
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
19
|
+
|
20
|
+
spec.files = Dir['**/*'].grep(%r{^(
|
18
21
|
(bin|lib|test|spec|features)/|
|
19
22
|
(.*\.gemspec|.*LICENSE.*|.*README.*|.*CHANGELOG.*)
|
20
23
|
)}x)
|
24
|
+
|
21
25
|
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
|
22
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
26
|
spec.require_paths = ['lib']
|
24
27
|
|
25
28
|
spec.add_runtime_dependency 'rack'
|
data/test/helper_test.rb
CHANGED
@@ -11,7 +11,7 @@ end
|
|
11
11
|
|
12
12
|
require 'rack-link_headers'
|
13
13
|
|
14
|
-
class HelperTest <
|
14
|
+
class HelperTest < Minitest::Test
|
15
15
|
def setup
|
16
16
|
@response = Rack::Response.new
|
17
17
|
end
|
@@ -26,15 +26,18 @@ class HelperTest < MiniTest::Unit::TestCase
|
|
26
26
|
@response.link 'http://google.com/path?query=5#frag', rel: :search
|
27
27
|
@response.link 'http://test.host/feed.rss', rel: :rss, type: 'application/rss+xml'
|
28
28
|
|
29
|
-
assert_equal '<http://google.com/path?query=5#frag>; rel="search", <http://test.host/feed.rss>; rel="rss"; type="application/rss+xml"',
|
29
|
+
assert_equal '<http://google.com/path?query=5#frag>; rel="search", <http://test.host/feed.rss>; rel="rss"; type="application/rss+xml"',
|
30
|
+
@response.headers['Link']
|
30
31
|
end
|
31
32
|
|
32
33
|
def test_links
|
33
34
|
@response.link 'http://google.com/path?query=5#frag', rel: :search
|
34
35
|
@response.link 'http://test.host/feed.rss', rel: :rss, type: 'application/rss+xml'
|
35
36
|
|
36
|
-
assert_equal @response.links, [
|
37
|
-
|
37
|
+
assert_equal @response.links, [
|
38
|
+
{url: 'http://google.com/path?query=5#frag', params: {rel: :search}},
|
39
|
+
{url: 'http://test.host/feed.rss', params: {rel: :rss, type: 'application/rss+xml'}},
|
40
|
+
]
|
38
41
|
end
|
39
42
|
|
40
43
|
def test_overrides_manual_headers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -41,7 +41,8 @@ files:
|
|
41
41
|
homepage: ''
|
42
42
|
licenses:
|
43
43
|
- MIT
|
44
|
-
metadata:
|
44
|
+
metadata:
|
45
|
+
rubygems_mfa_required: 'true'
|
45
46
|
post_install_message:
|
46
47
|
rdoc_options: []
|
47
48
|
require_paths:
|
@@ -50,16 +51,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
51
|
requirements:
|
51
52
|
- - ">="
|
52
53
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
54
|
+
version: 2.7.0
|
54
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
56
|
requirements:
|
56
57
|
- - ">="
|
57
58
|
- !ruby/object:Gem::Version
|
58
59
|
version: '0'
|
59
60
|
requirements: []
|
60
|
-
rubygems_version: 3.
|
61
|
+
rubygems_version: 3.4.10
|
61
62
|
signing_key:
|
62
63
|
specification_version: 4
|
63
64
|
summary: Easy Link header management for rack responses.
|
64
|
-
test_files:
|
65
|
-
- test/helper_test.rb
|
65
|
+
test_files: []
|