link-header-parser 2.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/CONTRIBUTING.md +3 -3
- data/README.md +11 -12
- data/lib/link-header-parser.rb +6 -7
- data/lib/link_header_parser/link_header.rb +21 -12
- data/lib/link_header_parser/link_header_parameter.rb +12 -5
- data/lib/link_header_parser/link_headers_collection.rb +18 -9
- data/lib/link_header_parser/version.rb +3 -1
- data/link-header-parser.gemspec +11 -8
- metadata +8 -33
- data/.editorconfig +0 -14
- data/.gitignore +0 -34
- data/.reek.yml +0 -9
- data/.rspec +0 -2
- data/.rubocop +0 -3
- data/.rubocop.yml +0 -26
- data/.ruby-version +0 -1
- data/.simplecov +0 -13
- data/.travis.yml +0 -18
- data/Gemfile +0 -14
- data/Rakefile +0 -18
- data/lib/link_header_parser/exceptions.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 173d1c05e3a5c2fe7d8e99454249d73ce780cfcc3bb120d7be5145e9b376ea54
|
4
|
+
data.tar.gz: a79af8ae39af06d3a4625eab54aa8f51d4574f5789c913d570919c20f877febc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48085ca777ca8b2e6d859e2920165d7336cd2b909efbdfcc63aaff1980859d77e8cb6f0455dc61c8b089d143206d435639b49a9aef9a7f151c21ca683e9af07d
|
7
|
+
data.tar.gz: 8fbd4c92cced717fc2a41d213209067824288810d14053236e6ca3ee1363c421a89c49be4ac6f34f9cc3736c91108ec58779a2638fca1efcbbf314ae5bbf1c84
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.0.0 / 2022-01-06
|
4
|
+
|
5
|
+
- Remove Addressable dependency (daedf22)
|
6
|
+
- **Breaking change:** Update minimum Ruby version to 2.6 (e2343ed)
|
7
|
+
- Migrate to GitHub Actions (509b2c4)
|
8
|
+
- Update project Ruby version to 2.6.9 (c39bc66)
|
9
|
+
|
10
|
+
## 3.0.0 / 2021-05-22
|
11
|
+
|
12
|
+
- Add implicit type conversion methods, alias explicit methods, and update specs (d132535)
|
13
|
+
- Remove exceptions module (249d77c)
|
14
|
+
- Use implicit conversions instead of type checking in methods (628c01b)
|
15
|
+
- Replace Absolutely dependency with Addressable (beb5188)
|
16
|
+
- Update project Ruby version to 2.5.9 (4a3941f)
|
17
|
+
|
18
|
+
## 2.2.0 / 2021-04-02
|
19
|
+
|
20
|
+
- Expand supported Ruby versions to include 3.0 (7187878)
|
21
|
+
|
22
|
+
## 2.1.0 / 2020-10-07
|
23
|
+
|
24
|
+
- Update Absolutely dependency to 5.0 (62988c0)
|
25
|
+
|
3
26
|
## 2.0.0 / 2020-05-21
|
4
27
|
|
5
28
|
- **Breaking changes:** Rewrite gem code (5351010)
|
data/CONTRIBUTING.md
CHANGED
@@ -8,9 +8,9 @@ There are a couple ways you can help improve link-header-parser-ruby:
|
|
8
8
|
|
9
9
|
## Getting Started
|
10
10
|
|
11
|
-
link-header-parser-ruby is developed using Ruby 2.
|
11
|
+
link-header-parser-ruby is developed using Ruby 2.6.9 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/jgarber623/link-header-parser-ruby/actions).
|
12
12
|
|
13
|
-
Before making changes to link-header-parser-ruby, you'll want to install Ruby 2.
|
13
|
+
Before making changes to link-header-parser-ruby, you'll want to install Ruby 2.6.9. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.6.9 using your method of choice, install the project's gems by running:
|
14
14
|
|
15
15
|
```sh
|
16
16
|
bundle install
|
@@ -22,7 +22,7 @@ bundle install
|
|
22
22
|
1. Install development dependencies as outlined above.
|
23
23
|
1. Create a feature branch for the code changes you're looking to make: `git checkout -b my-new-feature`.
|
24
24
|
1. _Write some code!_
|
25
|
-
1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `
|
25
|
+
1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `bin/ci`.
|
26
26
|
1. Commit your changes: `git commit -am 'Add some new feature or fix some issue'`. _(See [this excellent article](https://chris.beams.io/posts/git-commit/) for tips on writing useful Git commit messages.)_
|
27
27
|
1. Push the branch to your fork: `git push -u origin my-new-feature`.
|
28
28
|
1. Create a new [pull request][pulls] and we'll review your changes.
|
data/README.md
CHANGED
@@ -2,18 +2,17 @@
|
|
2
2
|
|
3
3
|
**A Ruby gem for parsing HTTP Link headers.**
|
4
4
|
|
5
|
-
[![Gem](https://img.shields.io/gem/v/link-header-parser.svg?style=for-the-badge)](https://rubygems.org/gems/link-header-parser)
|
6
|
-
[![Downloads](https://img.shields.io/gem/dt/link-header-parser.svg?style=for-the-badge)](https://rubygems.org/gems/link-header-parser)
|
7
|
-
[![Build](https://img.shields.io/
|
8
|
-
[![
|
9
|
-
[![
|
10
|
-
[![Coverage](https://img.shields.io/codeclimate/c/jgarber623/link-header-parser-ruby.svg?style=for-the-badge)](https://codeclimate.com/github/jgarber623/link-header-parser-ruby/code)
|
5
|
+
[![Gem](https://img.shields.io/gem/v/link-header-parser.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/link-header-parser)
|
6
|
+
[![Downloads](https://img.shields.io/gem/dt/link-header-parser.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/link-header-parser)
|
7
|
+
[![Build](https://img.shields.io/github/workflow/status/jgarber623/link-header-parser-ruby/CI?logo=github&style=for-the-badge)](https://github.com/jgarber623/link-header-parser-ruby/actions/workflows/ci.yml)
|
8
|
+
[![Maintainability](https://img.shields.io/codeclimate/maintainability/jgarber623/link-header-parser-ruby.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/jgarber623/link-header-parser-ruby)
|
9
|
+
[![Coverage](https://img.shields.io/codeclimate/c/jgarber623/link-header-parser-ruby.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/jgarber623/link-header-parser-ruby/code)
|
11
10
|
|
12
11
|
## Getting Started
|
13
12
|
|
14
|
-
Before installing and using link-header-parser-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.
|
13
|
+
Before installing and using link-header-parser-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.6 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
|
15
14
|
|
16
|
-
link-header-parser-ruby is developed using Ruby 2.
|
15
|
+
link-header-parser-ruby is developed using Ruby 2.6.9 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/jgarber623/link-header-parser-ruby/actions).
|
17
16
|
|
18
17
|
## Installation
|
19
18
|
|
@@ -43,13 +42,13 @@ response = HTTP.get('https://sixtwothree.org')
|
|
43
42
|
|
44
43
|
link_headers = response.headers.get('link')
|
45
44
|
|
46
|
-
collection = LinkHeaderParser.parse(link_headers, base: response.uri
|
45
|
+
collection = LinkHeaderParser.parse(link_headers, base: response.uri)
|
47
46
|
```
|
48
47
|
|
49
48
|
The `parse` method accepts two arguments:
|
50
49
|
|
51
50
|
1. an `Array` of strings representing HTTP Link headers (e.g. `['</>; rel="home"', '</chapters/1>; anchor="#copyright"; rel="license"']`)
|
52
|
-
1. a `String` representing the absolute URL of the resource providing the HTTP Link headers
|
51
|
+
1. a `String` (or any `String`-like object) representing the absolute URL of the resource providing the HTTP Link headers
|
53
52
|
|
54
53
|
In the example above, `collection` is an instance of `LinkHeadersCollection` which includes Ruby's [`Enumerable`](https://ruby-doc.org/core/Enumerable.html) mixin. This mixin allows for use of common methods like `each`, `first`/`last`, and `map`.
|
55
54
|
|
@@ -138,14 +137,14 @@ link_header.relation_types
|
|
138
137
|
link_header = LinkHeaderParser.parse('</posts.rss>; rel="alternate"; hreflang="en-US"; title="sixtwothree.org: Posts"; type="application/rss+xml"', base: 'https://sixtwothree.org').first
|
139
138
|
|
140
139
|
link_header.link_parameters
|
141
|
-
#=> [#<LinkHeaderParser::LinkHeaderParameter
|
140
|
+
#=> [#<LinkHeaderParser::LinkHeaderParameter name: "rel", value: "alternate">, #<LinkHeaderParser::LinkHeaderParameter name: "hreflang", value: "en-US">, #<LinkHeaderParser::LinkHeaderParameter name: "title", value: "sixtwothree.org: Posts">, #<LinkHeaderParser::LinkHeaderParameter name: "type", value: "application/rss+xml">]
|
142
141
|
```
|
143
142
|
|
144
143
|
Note that the `Array` returned by the `link_parameters` method may include multiple `LinkHeaderParameter`s with the same name depending on the provided Link header. Certain methods on `LinkHeader` will return values from the first occurrence of a parameter name (e.g. `link_header.relations_string`) in accordance with [RFC-8288](https://tools.ietf.org/html/rfc8288).
|
145
144
|
|
146
145
|
## Contributing
|
147
146
|
|
148
|
-
Interested in helping improve link-header-parser-ruby? Awesome! Your help is greatly appreciated. See [CONTRIBUTING.md](https://github.com/jgarber623/link-header-parser-ruby/blob/
|
147
|
+
Interested in helping improve link-header-parser-ruby? Awesome! Your help is greatly appreciated. See [CONTRIBUTING.md](https://github.com/jgarber623/link-header-parser-ruby/blob/main/CONTRIBUTING.md) for details.
|
149
148
|
|
150
149
|
## Acknowledgments
|
151
150
|
|
data/lib/link-header-parser.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'forwardable'
|
4
4
|
|
5
|
-
|
6
|
-
require 'link_header_parser/exceptions'
|
5
|
+
require_relative 'link_header_parser/version'
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
require_relative 'link_header_parser/link_header'
|
8
|
+
require_relative 'link_header_parser/link_header_parameter'
|
9
|
+
require_relative 'link_header_parser/link_headers_collection'
|
11
10
|
|
12
11
|
module LinkHeaderParser
|
13
12
|
# Parse an array of HTTP Link headers
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module LinkHeaderParser
|
2
4
|
class LinkHeader
|
3
5
|
FIELD_VALUE_REGEXP_PATTERN = /^\s*<\s*(?<target_string>[^>]+)\s*>\s*(?<parameters>;\s*.*)$/.freeze
|
@@ -11,11 +13,8 @@ module LinkHeaderParser
|
|
11
13
|
# @param field_value [String]
|
12
14
|
# @param base [String]
|
13
15
|
def initialize(field_value, base:)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
@field_value = field_value
|
18
|
-
@base = base
|
16
|
+
@field_value = field_value.to_str
|
17
|
+
@base = base.to_str
|
19
18
|
end
|
20
19
|
|
21
20
|
# The context URL for this Link header extracted from field_value (or target URL if no context URL is present)
|
@@ -31,11 +30,14 @@ module LinkHeaderParser
|
|
31
30
|
#
|
32
31
|
# @return [String]
|
33
32
|
def context_uri
|
34
|
-
@context_uri ||=
|
33
|
+
@context_uri ||= URI.join(target_uri, context_string).normalize.to_s
|
35
34
|
end
|
36
35
|
|
36
|
+
# @return [String]
|
37
37
|
def inspect
|
38
|
-
|
38
|
+
"#<#{self.class.name}:#{format('%#0x', object_id)} " \
|
39
|
+
"target_uri: #{target_uri.inspect}, " \
|
40
|
+
"relation_types: #{relation_types.inspect}>"
|
39
41
|
end
|
40
42
|
|
41
43
|
# The parsed parameters for this Link header extracted from field_value
|
@@ -43,7 +45,9 @@ module LinkHeaderParser
|
|
43
45
|
#
|
44
46
|
# @return [Array<LinkHeaderParser::LinkHeaderParameter>]
|
45
47
|
def link_parameters
|
46
|
-
@link_parameters ||= field_value_match_data[:parameters].scan(PARAMETERS_REGEXP_PATTERN)
|
48
|
+
@link_parameters ||= field_value_match_data[:parameters].scan(PARAMETERS_REGEXP_PATTERN)
|
49
|
+
.flatten
|
50
|
+
.map { |parameter| LinkHeaderParameter.new(parameter) }
|
47
51
|
end
|
48
52
|
|
49
53
|
# The relations_string value returned as an Array
|
@@ -59,7 +63,7 @@ module LinkHeaderParser
|
|
59
63
|
#
|
60
64
|
# @return [String]
|
61
65
|
def relations_string
|
62
|
-
@relations_string ||= grouped_link_parameters[:rel]&.first
|
66
|
+
@relations_string ||= grouped_link_parameters[:rel]&.first.to_s
|
63
67
|
end
|
64
68
|
|
65
69
|
# The target URL for this Link header extracted from field_value
|
@@ -75,11 +79,11 @@ module LinkHeaderParser
|
|
75
79
|
#
|
76
80
|
# @return [String]
|
77
81
|
def target_uri
|
78
|
-
@target_uri ||=
|
82
|
+
@target_uri ||= URI.join(base, target_string).normalize.to_s
|
79
83
|
end
|
80
84
|
|
81
85
|
# @return [Hash{Symbol => String, Array, Hash{Symbol => Array}}]
|
82
|
-
def
|
86
|
+
def to_hash
|
83
87
|
{
|
84
88
|
target_string: target_string,
|
85
89
|
target_uri: target_uri,
|
@@ -91,6 +95,8 @@ module LinkHeaderParser
|
|
91
95
|
}
|
92
96
|
end
|
93
97
|
|
98
|
+
alias to_h to_hash
|
99
|
+
|
94
100
|
private
|
95
101
|
|
96
102
|
attr_reader :base
|
@@ -100,7 +106,10 @@ module LinkHeaderParser
|
|
100
106
|
end
|
101
107
|
|
102
108
|
def grouped_link_parameters
|
103
|
-
@grouped_link_parameters ||= link_parameters.map(&:to_a)
|
109
|
+
@grouped_link_parameters ||= link_parameters.map(&:to_a)
|
110
|
+
.group_by(&:shift)
|
111
|
+
.transform_keys(&:to_sym)
|
112
|
+
.transform_values(&:flatten)
|
104
113
|
end
|
105
114
|
end
|
106
115
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module LinkHeaderParser
|
2
4
|
class LinkHeaderParameter
|
3
5
|
PARAMETER_REGEXP_PATTERN = /^(?<name>.+?)(?:="?(?<value>.*?)"?)?$/.freeze
|
@@ -6,11 +8,14 @@ module LinkHeaderParser
|
|
6
8
|
|
7
9
|
# @param parameter [String]
|
8
10
|
def initialize(parameter)
|
9
|
-
@parameter = parameter
|
11
|
+
@parameter = parameter.to_str
|
10
12
|
end
|
11
13
|
|
14
|
+
# @return [String]
|
12
15
|
def inspect
|
13
|
-
|
16
|
+
"#<#{self.class.name}:#{format('%#0x', object_id)} " \
|
17
|
+
"name: #{name.inspect}, " \
|
18
|
+
"value: #{value.inspect}>"
|
14
19
|
end
|
15
20
|
|
16
21
|
# @see https://tools.ietf.org/html/rfc8288#appendix-B.3 (Appendix B.3.2.9)
|
@@ -22,16 +27,18 @@ module LinkHeaderParser
|
|
22
27
|
|
23
28
|
# @see https://tools.ietf.org/html/rfc8288#appendix-B.3 (Appendix B.3.2.8)
|
24
29
|
#
|
25
|
-
# @return [String
|
30
|
+
# @return [String]
|
26
31
|
def value
|
27
|
-
@value ||= parameter_match_data[:value]
|
32
|
+
@value ||= parameter_match_data[:value].to_s
|
28
33
|
end
|
29
34
|
|
30
35
|
# @return [Array<String>]
|
31
|
-
def
|
36
|
+
def to_ary
|
32
37
|
[name, value]
|
33
38
|
end
|
34
39
|
|
40
|
+
alias to_a to_ary
|
41
|
+
|
35
42
|
private
|
36
43
|
|
37
44
|
def parameter_match_data
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module LinkHeaderParser
|
2
4
|
class LinkHeadersCollection
|
3
5
|
extend Forwardable
|
@@ -11,21 +13,24 @@ module LinkHeaderParser
|
|
11
13
|
# @param headers [Array<String>]
|
12
14
|
# @param base [String]
|
13
15
|
def initialize(*headers, base:)
|
14
|
-
@headers = headers.flatten
|
15
|
-
@base = base
|
16
|
+
@headers = headers.to_ary.flatten.map(&:to_str)
|
17
|
+
@base = base.to_str
|
16
18
|
|
17
|
-
|
19
|
+
distinct_headers.each { |header| push(LinkHeader.new(header, base: base)) }
|
18
20
|
end
|
19
21
|
|
20
22
|
# @return [Hash{Symbol => Array<LinkHeaderParser::LinkHeader>}]
|
21
23
|
def group_by_relation_type
|
22
|
-
relation_types.
|
23
|
-
[relation_type,
|
24
|
-
end
|
24
|
+
relation_types.to_h do |relation_type|
|
25
|
+
[relation_type.to_sym, select_by_relation_type(relation_type)]
|
26
|
+
end
|
25
27
|
end
|
26
28
|
|
29
|
+
# @return [String]
|
27
30
|
def inspect
|
28
|
-
|
31
|
+
"#<#{self.class.name}:#{format('%#0x', object_id)} " \
|
32
|
+
"headers: #{headers.inspect}, " \
|
33
|
+
"relation_types: #{relation_types.inspect}>"
|
29
34
|
end
|
30
35
|
|
31
36
|
# @return [Array<String>]
|
@@ -37,12 +42,16 @@ module LinkHeaderParser
|
|
37
42
|
|
38
43
|
attr_reader :base
|
39
44
|
|
40
|
-
def
|
41
|
-
@
|
45
|
+
def distinct_headers
|
46
|
+
@distinct_headers ||= headers.flat_map { |header| header.split(/,(?=[\s|<])/) }.map(&:strip)
|
42
47
|
end
|
43
48
|
|
44
49
|
def members
|
45
50
|
@members ||= []
|
46
51
|
end
|
52
|
+
|
53
|
+
def select_by_relation_type(relation_type)
|
54
|
+
select { |member| member.relation_types.include?(relation_type) }
|
55
|
+
end
|
47
56
|
end
|
48
57
|
end
|
data/link-header-parser.gemspec
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/link_header_parser/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |spec|
|
4
|
-
spec.required_ruby_version =
|
6
|
+
spec.required_ruby_version = '>= 2.6', '< 4'
|
5
7
|
|
6
8
|
spec.name = 'link-header-parser'
|
7
9
|
spec.version = LinkHeaderParser::VERSION
|
@@ -13,14 +15,15 @@ Gem::Specification.new do |spec|
|
|
13
15
|
spec.homepage = 'https://github.com/jgarber623/link-header-parser-ruby'
|
14
16
|
spec.license = 'MIT'
|
15
17
|
|
16
|
-
spec.files = Dir.
|
17
|
-
|
18
|
-
|
18
|
+
spec.files = Dir['lib/**/*'].reject { |f| File.directory?(f) }
|
19
|
+
spec.files += %w[LICENSE CHANGELOG.md CONTRIBUTING.md README.md]
|
20
|
+
spec.files += %w[link-header-parser.gemspec]
|
19
21
|
|
20
22
|
spec.require_paths = ['lib']
|
21
23
|
|
22
|
-
spec.metadata
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
spec.metadata = {
|
25
|
+
'bug_tracker_uri' => "#{spec.homepage}/issues",
|
26
|
+
'changelog_uri' => "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md",
|
27
|
+
'rubygems_mfa_required' => 'true'
|
28
|
+
}
|
26
29
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: link-header-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: absolutely
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '4.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '4.0'
|
11
|
+
date: 2022-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: Parse HTTP Link headers.
|
28
14
|
email:
|
29
15
|
- jason@sixtwothree.org
|
@@ -31,23 +17,11 @@ executables: []
|
|
31
17
|
extensions: []
|
32
18
|
extra_rdoc_files: []
|
33
19
|
files:
|
34
|
-
- ".editorconfig"
|
35
|
-
- ".gitignore"
|
36
|
-
- ".reek.yml"
|
37
|
-
- ".rspec"
|
38
|
-
- ".rubocop"
|
39
|
-
- ".rubocop.yml"
|
40
|
-
- ".ruby-version"
|
41
|
-
- ".simplecov"
|
42
|
-
- ".travis.yml"
|
43
20
|
- CHANGELOG.md
|
44
21
|
- CONTRIBUTING.md
|
45
|
-
- Gemfile
|
46
22
|
- LICENSE
|
47
23
|
- README.md
|
48
|
-
- Rakefile
|
49
24
|
- lib/link-header-parser.rb
|
50
|
-
- lib/link_header_parser/exceptions.rb
|
51
25
|
- lib/link_header_parser/link_header.rb
|
52
26
|
- lib/link_header_parser/link_header_parameter.rb
|
53
27
|
- lib/link_header_parser/link_headers_collection.rb
|
@@ -58,7 +32,8 @@ licenses:
|
|
58
32
|
- MIT
|
59
33
|
metadata:
|
60
34
|
bug_tracker_uri: https://github.com/jgarber623/link-header-parser-ruby/issues
|
61
|
-
changelog_uri: https://github.com/jgarber623/link-header-parser-ruby/blob/
|
35
|
+
changelog_uri: https://github.com/jgarber623/link-header-parser-ruby/blob/v4.0.0/CHANGELOG.md
|
36
|
+
rubygems_mfa_required: 'true'
|
62
37
|
post_install_message:
|
63
38
|
rdoc_options: []
|
64
39
|
require_paths:
|
@@ -67,17 +42,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
42
|
requirements:
|
68
43
|
- - ">="
|
69
44
|
- !ruby/object:Gem::Version
|
70
|
-
version: '2.
|
45
|
+
version: '2.6'
|
71
46
|
- - "<"
|
72
47
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
48
|
+
version: '4'
|
74
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
50
|
requirements:
|
76
51
|
- - ">="
|
77
52
|
- !ruby/object:Gem::Version
|
78
53
|
version: '0'
|
79
54
|
requirements: []
|
80
|
-
rubygems_version: 3.
|
55
|
+
rubygems_version: 3.2.33
|
81
56
|
signing_key:
|
82
57
|
specification_version: 4
|
83
58
|
summary: Parse HTTP Link headers.
|
data/.editorconfig
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# EditorConfig is awesome: https://EditorConfig.org
|
2
|
-
root = true
|
3
|
-
|
4
|
-
[*]
|
5
|
-
charset = utf-8
|
6
|
-
end_of_line = lf
|
7
|
-
insert_final_newline = true
|
8
|
-
indent_size = 2
|
9
|
-
indent_style = space
|
10
|
-
trim_trailing_whitespace = true
|
11
|
-
|
12
|
-
[*.md]
|
13
|
-
indent_size = 4
|
14
|
-
indent_style = tab
|
data/.gitignore
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/spec/examples.txt
|
9
|
-
/test/tmp/
|
10
|
-
/test/version_tmp/
|
11
|
-
/tmp/
|
12
|
-
|
13
|
-
# Used by dotenv library to load environment variables.
|
14
|
-
# .env
|
15
|
-
|
16
|
-
# Documentation cache and generated files:
|
17
|
-
/.yardoc/
|
18
|
-
/_yardoc/
|
19
|
-
/doc/
|
20
|
-
/rdoc/
|
21
|
-
|
22
|
-
# Environment normalization:
|
23
|
-
/.bundle/
|
24
|
-
/vendor/bundle
|
25
|
-
/lib/bundler/man/
|
26
|
-
|
27
|
-
# for a library or gem, you might want to ignore these files since the code is
|
28
|
-
# intended to run in multiple environments; otherwise, check them in:
|
29
|
-
Gemfile.lock
|
30
|
-
# .ruby-version
|
31
|
-
# .ruby-gemset
|
32
|
-
|
33
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
-
.rvmrc
|
data/.reek.yml
DELETED
data/.rspec
DELETED
data/.rubocop
DELETED
data/.rubocop.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-performance
|
3
|
-
- rubocop-rspec
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
NewCops: enable
|
7
|
-
|
8
|
-
Layout/LineLength:
|
9
|
-
Enabled: false
|
10
|
-
|
11
|
-
Metrics/ModuleLength:
|
12
|
-
Exclude:
|
13
|
-
- spec/support/**/*.rb
|
14
|
-
|
15
|
-
Naming/FileName:
|
16
|
-
Exclude:
|
17
|
-
- lib/link-header-parser.rb
|
18
|
-
|
19
|
-
Style/Documentation:
|
20
|
-
Enabled: false
|
21
|
-
|
22
|
-
Style/FrozenStringLiteralComment:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Style/SymbolArray:
|
26
|
-
Enabled: false
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.5.8
|
data/.simplecov
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'simplecov-console'
|
2
|
-
|
3
|
-
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
4
|
-
|
5
|
-
# rubocop:disable Style/IfUnlessModifier
|
6
|
-
if RSpec.configuration.files_to_run.length > 1
|
7
|
-
formatters << SimpleCov::Formatter::Console
|
8
|
-
end
|
9
|
-
# rubocop:enable Style/IfUnlessModifier
|
10
|
-
|
11
|
-
SimpleCov.start do
|
12
|
-
formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
|
13
|
-
end
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
dist: bionic
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.5
|
5
|
-
- 2.6
|
6
|
-
- 2.7
|
7
|
-
cache: bundler
|
8
|
-
before_script:
|
9
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
10
|
-
- chmod +x ./cc-test-reporter
|
11
|
-
- ./cc-test-reporter before-build
|
12
|
-
after_script:
|
13
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
14
|
-
notifications:
|
15
|
-
email: false
|
16
|
-
slack:
|
17
|
-
rooms:
|
18
|
-
secure: ZV5G4LIK9OXRXkXt3iC53QD1uVWmThzETj8CallRoZgGfUKfzzMjx2V7NqJLwkmFkaK9y/flt/bRVMVqkH60GY0Gq6YeS9zuKEWJYesC6+aWQa6scKaxgewLdfYth3ijMS91XbPKECbFj0LOs1WPTfqYDsdPpOnH2RBWUO6lx8ID4DZtvi7kMhcY2+K21Q3/3gW9y919KHSCppM24EsyIbkAlFce5RjXn5WmfyTOTyTrxbHyByFr3SSTGdyO3KK0Fa4hhKNC2pa5WmlLHvZ/c5P7MYf1Eo+Rji5I0QY3pcGOIvbK0xBBnXnGI6Zfp088evElGpw8qgUdkR03QbxjTYANdN6mlk9DvnHqPWjI6OalF3SA7PP9mYjKVb2THDPqWOAvqYdMrrLylduWfdCzpxk4Z13DwF6rYSRgz3juKeKx80rhcAFmptLAC3uzQxgSgKoj9xZbbcYqhh/JQL9lNBZYJyLO5M0fOzrEDbLyNrWFYzUgKYgxRAOLWhJ8V2FlN3oR2cXXcf6vmlpPYfoCA0a8Ig82Htapan0JEhNEU6sS1ctdS7NegccEB9P0V5hUDy3AooaqCy8gFYE3TENYI1vwrevo5vqtNffR1PXTsliGe/gIIeFET6H2IJ+HYG9DefMHwYIR97enMFe50PauNGqdHS9kCoUV59r1PDOBJuU=
|
data/Gemfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in link-header-parser.gemspec
|
4
|
-
gemspec
|
5
|
-
|
6
|
-
gem 'pry-byebug', '~> 3.9'
|
7
|
-
gem 'rake', '~> 13.0'
|
8
|
-
gem 'reek', '~> 6.0'
|
9
|
-
gem 'rspec', '~> 3.9'
|
10
|
-
gem 'rubocop', '~> 0.83.0'
|
11
|
-
gem 'rubocop-performance', '~> 1.5'
|
12
|
-
gem 'rubocop-rspec', '~> 1.38'
|
13
|
-
gem 'simplecov', '~> 0.18.5'
|
14
|
-
gem 'simplecov-console', '~> 0.7.2'
|
data/Rakefile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
|
3
|
-
require 'reek/rake/task'
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
require 'rubocop/rake_task'
|
6
|
-
|
7
|
-
Reek::Rake::Task.new do |task|
|
8
|
-
task.fail_on_error = false
|
9
|
-
task.source_files = FileList['**/*.rb'].exclude('vendor/**/*.rb')
|
10
|
-
end
|
11
|
-
|
12
|
-
RSpec::Core::RakeTask.new
|
13
|
-
|
14
|
-
RuboCop::RakeTask.new do |task|
|
15
|
-
task.fail_on_error = false
|
16
|
-
end
|
17
|
-
|
18
|
-
task default: [:rubocop, :reek, :spec]
|