webmention-verification 3.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -1
- data/CONTRIBUTING.md +3 -3
- data/README.md +17 -16
- data/lib/webmention/verification/client.rb +48 -26
- data/lib/webmention/verification/{verifiers/base_verifier.rb → verifier.rb} +4 -7
- data/lib/webmention/verification/verifiers/html_verifier.rb +11 -9
- data/lib/webmention/verification/verifiers/json_verifier.rb +4 -3
- data/lib/webmention/verification/verifiers/plaintext_verifier.rb +4 -2
- data/lib/webmention/verification/version.rb +3 -1
- data/lib/webmention/verification.rb +15 -9
- data/webmention-verification.gemspec +13 -9
- metadata +12 -38
- data/.editorconfig +0 -14
- data/.gitignore +0 -34
- data/.reek.yml +0 -8
- data/.rspec +0 -2
- data/.rubocop +0 -3
- data/.rubocop.yml +0 -31
- data/.ruby-version +0 -1
- data/.simplecov +0 -13
- data/.travis.yml +0 -19
- data/Gemfile +0 -15
- data/Rakefile +0 -17
- data/lib/webmention/verification/exceptions.rb +0 -17
- data/lib/webmention/verification/verifiers.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d920d91622406f373a8b74d0169383d3d847a6e534da19ecaf6a230078c1bcf
|
|
4
|
+
data.tar.gz: dc29ab3a43d77d48e6b6852a3fe884ab7a1af8e7ba0a63d36ac61207168f92a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d0efb2c62c2d8b1e854e1251f7f5552731352e8864599b87694e08b223088c8e8c891be1622e34a87775ba371cd990c4b9601092582b33fc9010cc585ef8820
|
|
7
|
+
data.tar.gz: 2ef8ae0f3bae0825d2cae1fb24ae890095c6855b6ab2fc65ed822fb8ab4c531b82a91f49004aba0e307bdc02ae20c65b6679cfc56705231f020b8de75c4b7850
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 6.0.0 / 2022-05-03
|
|
4
|
+
|
|
5
|
+
- Move/rename BaseVerifier to Verifier class (6965e98)
|
|
6
|
+
- Remove addressable dependency (38a004e)
|
|
7
|
+
- Raise Webmention::Verification::SSLError on SSL errors (be9d922)
|
|
8
|
+
- Update ~~Addressable and~~ Nokogiri dependency constraints (822b7ae)
|
|
9
|
+
- **Breaking change:** Update minimum supported Ruby to 2.6 (07a7c5e)
|
|
10
|
+
- Update development Ruby version to 2.6.10 (d67d583)
|
|
11
|
+
- Remove Reek (b10b648)
|
|
12
|
+
|
|
13
|
+
## 5.0.0 / 2021-06-08
|
|
14
|
+
|
|
15
|
+
- Add `Webmention::Verification::Client#inspect` method (361c437)
|
|
16
|
+
- Update [HTTP](https://github.com/httprb/http) gem constraint to ~> 5.0 (4063764)
|
|
17
|
+
- Simplify exception handling (3f8f12c)
|
|
18
|
+
- Rename base `WebmentionVerificationError` class to `Error` (2b12338)
|
|
19
|
+
- Add support for Ruby 3.0 (05baf08)
|
|
20
|
+
- Update development Ruby version to 2.5.9 (821a488)
|
|
21
|
+
|
|
22
|
+
## 4.0.0 / 2020-08-23
|
|
23
|
+
|
|
24
|
+
- **Breaking Change:** Update minimum supported Ruby version to 2.5 (096012e)
|
|
25
|
+
- Update development Ruby version to 2.5.8 (3b3f38e)
|
|
26
|
+
|
|
27
|
+
## 3.0.0 / 2020-05-14
|
|
4
28
|
|
|
5
29
|
- **Breaking Change:** Remove `Webmention::Verification.client` convenience method (af575d7)
|
|
6
30
|
- **Breaking Change:** Remove `HttpRequest` class (112f9d3)
|
data/CONTRIBUTING.md
CHANGED
|
@@ -8,9 +8,9 @@ There are a couple ways you can help improve webmention-verification-ruby:
|
|
|
8
8
|
|
|
9
9
|
## Getting Started
|
|
10
10
|
|
|
11
|
-
webmention-verification-ruby is developed using Ruby 2.
|
|
11
|
+
webmention-verification-ruby is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/jgarber623/webmention-verification-ruby/actions).
|
|
12
12
|
|
|
13
|
-
Before making changes to webmention-verification-ruby, you'll want to install Ruby 2.
|
|
13
|
+
Before making changes to webmention-verification-ruby, you'll want to install Ruby 2.6.10. 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.10 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,23 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
**A Ruby gem for verifying a received [webmention](https://indieweb.org/Webmention).**
|
|
4
4
|
|
|
5
|
-
[](https://rubygems.org/gems/webmention-verification)
|
|
6
|
-
[](https://rubygems.org/gems/webmention-verification)
|
|
7
|
-
[](https://codeclimate.com/github/jgarber623/webmention-verification-ruby/code)
|
|
5
|
+
[](https://rubygems.org/gems/webmention-verification)
|
|
6
|
+
[](https://rubygems.org/gems/webmention-verification)
|
|
7
|
+
[](https://github.com/jgarber623/webmention-verification-ruby/actions/workflows/ci.yml)
|
|
8
|
+
[](https://codeclimate.com/github/jgarber623/webmention-verification-ruby)
|
|
9
|
+
[](https://codeclimate.com/github/jgarber623/webmention-verification-ruby/code)
|
|
11
10
|
|
|
12
11
|
## Key Features
|
|
13
12
|
|
|
14
13
|
- Compliant with [Section 3.2.2](https://www.w3.org/TR/webmention/#webmention-verification) of [the W3C's Webmention Recommendation](https://www.w3.org/TR/webmention/).
|
|
15
|
-
- Supports Ruby 2.
|
|
14
|
+
- Supports Ruby 2.6 and newer.
|
|
16
15
|
|
|
17
16
|
## Getting Started
|
|
18
17
|
|
|
19
|
-
Before installing and using webmention-verification-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.
|
|
18
|
+
Before installing and using webmention-verification-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).
|
|
20
19
|
|
|
21
|
-
webmention-verification-ruby is developed using Ruby 2.
|
|
20
|
+
webmention-verification-ruby is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/jgarber623/webmention-verification-ruby/actions).
|
|
22
21
|
|
|
23
22
|
## Installation
|
|
24
23
|
|
|
@@ -70,8 +69,8 @@ client = Webmention::Verification::Client.new(source, target)
|
|
|
70
69
|
puts client.source # => 'https://source.example.com/post/100'
|
|
71
70
|
puts client.target # => 'https://target.example.com/post/100'
|
|
72
71
|
|
|
73
|
-
puts client.source_uri # => #<
|
|
74
|
-
puts client.target_uri # => #<
|
|
72
|
+
puts client.source_uri # => #<HTTP::URI>
|
|
73
|
+
puts client.target_uri # => #<HTTP::URI>
|
|
75
74
|
|
|
76
75
|
puts client.response # => #<HTTP::Response>
|
|
77
76
|
|
|
@@ -139,7 +138,7 @@ In the example above, `verifier.results` will return an array of HTML elements t
|
|
|
139
138
|
|
|
140
139
|
### Exception Handling
|
|
141
140
|
|
|
142
|
-
There are several exceptions that may be raised by webmention-verification-ruby's underlying dependencies. These errors are raised as subclasses of `
|
|
141
|
+
There are several exceptions that may be raised by webmention-verification-ruby's underlying dependencies. These errors are raised as subclasses of `Webmention::Verification::Error` (which itself is a subclass of `StandardError`).
|
|
143
142
|
|
|
144
143
|
From [sporkmonger/addressable](https://github.com/sporkmonger/addressable):
|
|
145
144
|
|
|
@@ -147,15 +146,17 @@ From [sporkmonger/addressable](https://github.com/sporkmonger/addressable):
|
|
|
147
146
|
|
|
148
147
|
From [httprb/http](https://github.com/httprb/http):
|
|
149
148
|
|
|
150
|
-
- `Webmention::Verification::
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
- `Webmention::Verification::HttpError`
|
|
150
|
+
|
|
151
|
+
From the Ruby Standard Library's [`OpenSSL::SSL::SSLError`](https://ruby-doc.org/stdlib-2.6.10/libdoc/openssl/rdoc/OpenSSL/SSL/SSLError.html):
|
|
152
|
+
|
|
153
|
+
- `Webmention::Verification::SSLError`
|
|
153
154
|
|
|
154
155
|
webmention-verification-ruby will also raise a `Webmention::Verification::UnsupportedMimeTypeError` when encountering an `HTTP::Response` instance with an unsupported MIME type.
|
|
155
156
|
|
|
156
157
|
## Contributing
|
|
157
158
|
|
|
158
|
-
Interested in helping improve webmention-verification-ruby? Awesome! Your help is greatly appreciated. See [CONTRIBUTING.md](https://github.com/jgarber623/webmention-verification-ruby/blob/
|
|
159
|
+
Interested in helping improve webmention-verification-ruby? Awesome! Your help is greatly appreciated. See [CONTRIBUTING.md](https://github.com/jgarber623/webmention-verification-ruby/blob/main/CONTRIBUTING.md) for details.
|
|
159
160
|
|
|
160
161
|
## Acknowledgments
|
|
161
162
|
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Webmention
|
|
2
4
|
module Verification
|
|
3
5
|
class Client
|
|
4
6
|
HTTP_CLIENT_HEADERS = {
|
|
5
|
-
accept:
|
|
7
|
+
accept: '*/*',
|
|
6
8
|
user_agent: 'Webmention Verification Client (https://rubygems.org/gems/webmention-verification)'
|
|
7
9
|
}.freeze
|
|
8
10
|
|
|
11
|
+
@registered_verifiers = {}
|
|
12
|
+
|
|
13
|
+
class << self
|
|
14
|
+
attr_reader :registered_verifiers
|
|
15
|
+
end
|
|
16
|
+
|
|
9
17
|
attr_reader :source, :target
|
|
10
18
|
|
|
19
|
+
def self.register_verifier(klass)
|
|
20
|
+
klass.mime_types.each { |mime_type| @registered_verifiers[mime_type] = klass }
|
|
21
|
+
end
|
|
22
|
+
|
|
11
23
|
# Create a client used to determine whether or not source URI links to target URI.
|
|
12
24
|
#
|
|
13
25
|
# @example
|
|
@@ -24,55 +36,65 @@ module Webmention
|
|
|
24
36
|
# @param options [Hash]
|
|
25
37
|
# @option options [Boolean] :strict (true)
|
|
26
38
|
def initialize(source, target, **options)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@source = source
|
|
31
|
-
@target = target
|
|
39
|
+
@source = source.to_str
|
|
40
|
+
@target = target.to_str
|
|
32
41
|
@options = options
|
|
33
42
|
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
message = 'must be an absolute URI (e.g. https://example.com/post/100)'
|
|
44
|
+
|
|
45
|
+
raise ArgumentError, "source #{message}" unless absolute?(source_uri)
|
|
46
|
+
raise ArgumentError, "target #{message}" unless absolute?(target_uri)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @return [String]
|
|
50
|
+
def inspect
|
|
51
|
+
"#<#{self.class.name}:#{format('%#0x', object_id)} " \
|
|
52
|
+
"source: #{source.inspect} " \
|
|
53
|
+
"target: #{target.inspect} " \
|
|
54
|
+
"options: #{@options.inspect}>"
|
|
36
55
|
end
|
|
37
56
|
|
|
38
57
|
# @return [HTTP::Response]
|
|
39
|
-
# @raise [Webmention::Verification::
|
|
58
|
+
# @raise [Webmention::Verification::HttpError, Webmention::Verification::SSLError]
|
|
40
59
|
def response
|
|
41
60
|
@response ||= HTTP.follow.headers(HTTP_CLIENT_HEADERS).timeout(connect: 10, read: 10).get(source_uri)
|
|
42
|
-
rescue HTTP::
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
raise
|
|
61
|
+
rescue HTTP::Error => e
|
|
62
|
+
raise HttpError, e
|
|
63
|
+
rescue OpenSSL::SSL::SSLError => e
|
|
64
|
+
raise SSLError, e
|
|
46
65
|
end
|
|
47
66
|
|
|
48
|
-
# @return [
|
|
67
|
+
# @return [HTTP::URI]
|
|
49
68
|
# @raise [Webmention::Verification::InvalidURIError]
|
|
50
69
|
def source_uri
|
|
51
|
-
@source_uri ||=
|
|
52
|
-
rescue Addressable::URI::InvalidURIError =>
|
|
53
|
-
raise InvalidURIError,
|
|
70
|
+
@source_uri ||= HTTP::URI.parse(source)
|
|
71
|
+
rescue Addressable::URI::InvalidURIError => e
|
|
72
|
+
raise InvalidURIError, e
|
|
54
73
|
end
|
|
55
74
|
|
|
56
|
-
# @return [
|
|
75
|
+
# @return [HTTP::URI]
|
|
57
76
|
# @raise [Webmention::Verification::InvalidURIError]
|
|
58
77
|
def target_uri
|
|
59
|
-
@target_uri ||=
|
|
60
|
-
rescue Addressable::URI::InvalidURIError =>
|
|
61
|
-
raise InvalidURIError,
|
|
78
|
+
@target_uri ||= HTTP::URI.parse(target)
|
|
79
|
+
rescue Addressable::URI::InvalidURIError => e
|
|
80
|
+
raise InvalidURIError, e
|
|
62
81
|
end
|
|
63
82
|
|
|
64
83
|
# @return [Boolean]
|
|
65
84
|
# @raise [Webmention::Verification::UnsupportedMimeTypeError]
|
|
66
85
|
def verified?
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
self.class
|
|
87
|
+
.registered_verifiers[response.mime_type]
|
|
88
|
+
.new(response, target, **@options)
|
|
89
|
+
.verified?
|
|
90
|
+
rescue NoMethodError
|
|
91
|
+
raise UnsupportedMimeTypeError, "Unsupported MIME Type: #{response.mime_type}"
|
|
70
92
|
end
|
|
71
93
|
|
|
72
94
|
private
|
|
73
95
|
|
|
74
|
-
def
|
|
75
|
-
|
|
96
|
+
def absolute?(uri)
|
|
97
|
+
uri.http? || uri.https?
|
|
76
98
|
end
|
|
77
99
|
end
|
|
78
100
|
end
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Webmention
|
|
2
4
|
module Verification
|
|
3
|
-
class
|
|
5
|
+
class Verifier
|
|
4
6
|
class << self
|
|
5
7
|
attr_reader :mime_types
|
|
6
8
|
end
|
|
7
9
|
|
|
8
10
|
def initialize(response, target, **options)
|
|
9
|
-
raise ArgumentError, "response must be an HTTP::Response (given #{response.class.name})" unless response.is_a?(HTTP::Response)
|
|
10
|
-
raise ArgumentError, "target must be a String (given #{target.class.name})" unless target.is_a?(String)
|
|
11
|
-
|
|
12
11
|
@response = response
|
|
13
|
-
@target = target
|
|
12
|
+
@target = target.to_str
|
|
14
13
|
@options = options
|
|
15
|
-
|
|
16
|
-
raise UnsupportedMimeTypeError, "Unsupported MIME Type: #{response.mime_type}" unless self.class.mime_types.include?(response.mime_type)
|
|
17
14
|
end
|
|
18
15
|
|
|
19
16
|
def results
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Webmention
|
|
2
4
|
module Verification
|
|
3
5
|
module Verifiers
|
|
4
|
-
class HtmlVerifier <
|
|
6
|
+
class HtmlVerifier < Verifier
|
|
5
7
|
@mime_types = ['text/html']
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Client.register_verifier(self)
|
|
8
10
|
|
|
9
11
|
HTML_ATTRIBUTE_MAP = {
|
|
10
|
-
cite
|
|
11
|
-
data
|
|
12
|
-
href
|
|
13
|
-
poster
|
|
14
|
-
src
|
|
15
|
-
srcset
|
|
12
|
+
'cite' => %w[blockquote del ins q],
|
|
13
|
+
'data' => %w[object],
|
|
14
|
+
'href' => %w[a area],
|
|
15
|
+
'poster' => %w[video],
|
|
16
|
+
'src' => %w[audio embed img source track video],
|
|
17
|
+
'srcset' => %w[img source]
|
|
16
18
|
}.freeze
|
|
17
19
|
|
|
18
20
|
private
|
|
@@ -26,7 +28,7 @@ module Webmention
|
|
|
26
28
|
end
|
|
27
29
|
|
|
28
30
|
def search_doc(attribute, elements)
|
|
29
|
-
regexp = attribute ==
|
|
31
|
+
regexp = attribute == 'srcset' ? srcset_attribute_regexp : target_regexp
|
|
30
32
|
|
|
31
33
|
doc.css(*elements.map { |element| "#{element}[#{attribute}]" }).find_all do |node|
|
|
32
34
|
node[attribute].match?(regexp)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Webmention
|
|
2
4
|
module Verification
|
|
3
5
|
module Verifiers
|
|
4
|
-
class JsonVerifier <
|
|
6
|
+
class JsonVerifier < Verifier
|
|
5
7
|
@mime_types = ['application/json']
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Client.register_verifier(self)
|
|
8
10
|
|
|
9
11
|
private
|
|
10
12
|
|
|
@@ -28,7 +30,6 @@ module Webmention
|
|
|
28
30
|
|
|
29
31
|
private
|
|
30
32
|
|
|
31
|
-
# :reek:TooManyStatements { max_statements: 6 }
|
|
32
33
|
def build_results(comparator, object, matches = [])
|
|
33
34
|
return matches unless object.is_a?(Enumerable)
|
|
34
35
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Webmention
|
|
2
4
|
module Verification
|
|
3
5
|
module Verifiers
|
|
4
|
-
class PlaintextVerifier <
|
|
6
|
+
class PlaintextVerifier < Verifier
|
|
5
7
|
@mime_types = ['text/plain']
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Client.register_verifier(self)
|
|
8
10
|
|
|
9
11
|
private
|
|
10
12
|
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'json'
|
|
2
4
|
|
|
3
|
-
require 'addressable/uri'
|
|
4
5
|
require 'http'
|
|
5
6
|
require 'nokogiri'
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
require 'webmention/verification/exceptions'
|
|
8
|
+
require_relative 'verification/version'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
require 'webmention/verification/verifiers/plaintext_verifier'
|
|
10
|
+
require_relative 'verification/client'
|
|
11
|
+
require_relative 'verification/verifier'
|
|
12
|
+
require_relative 'verification/verifiers/html_verifier'
|
|
13
|
+
require_relative 'verification/verifiers/json_verifier'
|
|
14
|
+
require_relative 'verification/verifiers/plaintext_verifier'
|
|
16
15
|
|
|
17
16
|
module Webmention
|
|
18
17
|
module Verification
|
|
18
|
+
class Error < StandardError; end
|
|
19
|
+
class ArgumentError < Error; end
|
|
20
|
+
class HttpError < Error; end
|
|
21
|
+
class InvalidURIError < Error; end
|
|
22
|
+
class SSLError < Error; end
|
|
23
|
+
class UnsupportedMimeTypeError < Error; end
|
|
24
|
+
|
|
19
25
|
# Determine whether or not source URI links to target URI.
|
|
20
26
|
#
|
|
21
27
|
# @example
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'lib/webmention/verification/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 = 'webmention-verification'
|
|
7
9
|
spec.version = Webmention::Verification::VERSION
|
|
@@ -13,16 +15,18 @@ Gem::Specification.new do |spec|
|
|
|
13
15
|
spec.homepage = 'https://github.com/jgarber623/webmention-verification-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[webmention-verification.gemspec]
|
|
19
21
|
|
|
20
22
|
spec.require_paths = ['lib']
|
|
21
23
|
|
|
22
|
-
spec.metadata
|
|
23
|
-
|
|
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
|
+
}
|
|
24
29
|
|
|
25
|
-
spec.add_runtime_dependency '
|
|
26
|
-
spec.add_runtime_dependency '
|
|
27
|
-
spec.add_runtime_dependency 'nokogiri', '~> 1.10'
|
|
30
|
+
spec.add_runtime_dependency 'http', '~> 5.0'
|
|
31
|
+
spec.add_runtime_dependency 'nokogiri', '~> 1.13'
|
|
28
32
|
end
|
metadata
CHANGED
|
@@ -1,57 +1,43 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: webmention-verification
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 6.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:
|
|
11
|
+
date: 2022-05-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: addressable
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.7'
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '2.7'
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: http
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
30
16
|
requirements:
|
|
31
17
|
- - "~>"
|
|
32
18
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
19
|
+
version: '5.0'
|
|
34
20
|
type: :runtime
|
|
35
21
|
prerelease: false
|
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
23
|
requirements:
|
|
38
24
|
- - "~>"
|
|
39
25
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
26
|
+
version: '5.0'
|
|
41
27
|
- !ruby/object:Gem::Dependency
|
|
42
28
|
name: nokogiri
|
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
|
44
30
|
requirements:
|
|
45
31
|
- - "~>"
|
|
46
32
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1.
|
|
33
|
+
version: '1.13'
|
|
48
34
|
type: :runtime
|
|
49
35
|
prerelease: false
|
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
37
|
requirements:
|
|
52
38
|
- - "~>"
|
|
53
39
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '1.
|
|
40
|
+
version: '1.13'
|
|
55
41
|
description: Verify a received webmention.
|
|
56
42
|
email:
|
|
57
43
|
- jason@sixtwothree.org
|
|
@@ -59,26 +45,13 @@ executables: []
|
|
|
59
45
|
extensions: []
|
|
60
46
|
extra_rdoc_files: []
|
|
61
47
|
files:
|
|
62
|
-
- ".editorconfig"
|
|
63
|
-
- ".gitignore"
|
|
64
|
-
- ".reek.yml"
|
|
65
|
-
- ".rspec"
|
|
66
|
-
- ".rubocop"
|
|
67
|
-
- ".rubocop.yml"
|
|
68
|
-
- ".ruby-version"
|
|
69
|
-
- ".simplecov"
|
|
70
|
-
- ".travis.yml"
|
|
71
48
|
- CHANGELOG.md
|
|
72
49
|
- CONTRIBUTING.md
|
|
73
|
-
- Gemfile
|
|
74
50
|
- LICENSE
|
|
75
51
|
- README.md
|
|
76
|
-
- Rakefile
|
|
77
52
|
- lib/webmention/verification.rb
|
|
78
53
|
- lib/webmention/verification/client.rb
|
|
79
|
-
- lib/webmention/verification/
|
|
80
|
-
- lib/webmention/verification/verifiers.rb
|
|
81
|
-
- lib/webmention/verification/verifiers/base_verifier.rb
|
|
54
|
+
- lib/webmention/verification/verifier.rb
|
|
82
55
|
- lib/webmention/verification/verifiers/html_verifier.rb
|
|
83
56
|
- lib/webmention/verification/verifiers/json_verifier.rb
|
|
84
57
|
- lib/webmention/verification/verifiers/plaintext_verifier.rb
|
|
@@ -89,7 +62,8 @@ licenses:
|
|
|
89
62
|
- MIT
|
|
90
63
|
metadata:
|
|
91
64
|
bug_tracker_uri: https://github.com/jgarber623/webmention-verification-ruby/issues
|
|
92
|
-
changelog_uri: https://github.com/jgarber623/webmention-verification-ruby/blob/
|
|
65
|
+
changelog_uri: https://github.com/jgarber623/webmention-verification-ruby/blob/v6.0.0/CHANGELOG.md
|
|
66
|
+
rubygems_mfa_required: 'true'
|
|
93
67
|
post_install_message:
|
|
94
68
|
rdoc_options: []
|
|
95
69
|
require_paths:
|
|
@@ -98,17 +72,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
98
72
|
requirements:
|
|
99
73
|
- - ">="
|
|
100
74
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: '2.
|
|
75
|
+
version: '2.6'
|
|
102
76
|
- - "<"
|
|
103
77
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: '
|
|
78
|
+
version: '4'
|
|
105
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
80
|
requirements:
|
|
107
81
|
- - ">="
|
|
108
82
|
- !ruby/object:Gem::Version
|
|
109
83
|
version: '0'
|
|
110
84
|
requirements: []
|
|
111
|
-
rubygems_version: 3.
|
|
85
|
+
rubygems_version: 3.3.12
|
|
112
86
|
signing_key:
|
|
113
87
|
specification_version: 4
|
|
114
88
|
summary: Verify a received webmention.
|
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,31 +0,0 @@
|
|
|
1
|
-
require:
|
|
2
|
-
- rubocop-performance
|
|
3
|
-
- rubocop-rspec
|
|
4
|
-
|
|
5
|
-
AllCops:
|
|
6
|
-
NewCops: enable
|
|
7
|
-
|
|
8
|
-
Layout/HashAlignment:
|
|
9
|
-
EnforcedColonStyle: table
|
|
10
|
-
|
|
11
|
-
Layout/LineLength:
|
|
12
|
-
Enabled: false
|
|
13
|
-
|
|
14
|
-
Metrics/BlockLength:
|
|
15
|
-
Exclude:
|
|
16
|
-
- spec/**/*.rb
|
|
17
|
-
|
|
18
|
-
Naming/RescuedExceptionsVariableName:
|
|
19
|
-
PreferredName: exception
|
|
20
|
-
|
|
21
|
-
RSpec/NestedGroups:
|
|
22
|
-
Max: 4
|
|
23
|
-
|
|
24
|
-
Style/Documentation:
|
|
25
|
-
Enabled: false
|
|
26
|
-
|
|
27
|
-
Style/FrozenStringLiteralComment:
|
|
28
|
-
Enabled: false
|
|
29
|
-
|
|
30
|
-
Style/SymbolArray:
|
|
31
|
-
Enabled: false
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.4.10
|
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,19 +0,0 @@
|
|
|
1
|
-
dist: bionic
|
|
2
|
-
language: ruby
|
|
3
|
-
rvm:
|
|
4
|
-
- 2.4
|
|
5
|
-
- 2.5
|
|
6
|
-
- 2.6
|
|
7
|
-
- 2.7
|
|
8
|
-
cache: bundler
|
|
9
|
-
before_script:
|
|
10
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
11
|
-
- chmod +x ./cc-test-reporter
|
|
12
|
-
- ./cc-test-reporter before-build
|
|
13
|
-
after_script:
|
|
14
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
|
15
|
-
notifications:
|
|
16
|
-
email: false
|
|
17
|
-
slack:
|
|
18
|
-
rooms:
|
|
19
|
-
secure: sZ7DfokMwpZOjZ1jHD4RF58PtNGu+knqrv194+WLmfqV+MVPU38L04EGP1c/Kj7rIOtTQnbkDC10TjJNfl+OcRbUKYT19SBN3OqJJbAe5H46nhvNCfISKG54fEpbEMTcOsljSLcKB6FR3o/RiJUorY2BwS3aMCsf8NDhm08Nnxub5abpFvpgiXCfGSRklxt/dfuJmHB0kt3B8EEH3UzuAeaJoFOiV5RYnCUG0z5GXgHeZqZBs5sxmsmQhrDh5o/Yr0FSd9vcHDLD8EgArw//KyV10cF84NSEWtvPpFCcTnMpcfIuzkN/vgLoIbgYbyhczktCXiySHZDOzYBsCngzLN6DjD+5SdQgrrvtUF/Qsi9JUc6ij1EVHhcZjis7x6kGGtPL35nsM3D0KYwTXzlDIfj/RybQpLCaLL78lrkTiL2OnR1CfKXPwS58+sv0raUJOlWJP50WIL6Fe3J4L+3NWNVfpHdU2SV1cP1/UIs+Pwn4LUOwhSUn+rGsG1UKB/ZDezUMLes9PNclOmDVs8GgT7Lkn2N43mIqVQOyeHrUAVvWiI6M8xOTiAbNGP9sjOj4yJzhOwOToP5Id3ts9GvMoayHd8d8cyECQ9dotNh3VlX73p+Yjkz6rEvo/bsXfzx8gmsl0QQ6P7b4afFRwm1GC+nIofm6BNUS6cfg0xPrmMs=
|
data/Gemfile
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
# Specify your gem's dependencies in webmention-verification.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.39'
|
|
13
|
-
gem 'simplecov', '~> 0.18.5'
|
|
14
|
-
gem 'simplecov-console', '~> 0.7.2'
|
|
15
|
-
gem 'webmock', '~> 3.8'
|
data/Rakefile
DELETED
|
@@ -1,17 +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
|
-
end
|
|
10
|
-
|
|
11
|
-
RSpec::Core::RakeTask.new
|
|
12
|
-
|
|
13
|
-
RuboCop::RakeTask.new do |task|
|
|
14
|
-
task.fail_on_error = false
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
task default: [:rubocop, :reek, :spec]
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module Webmention
|
|
2
|
-
module Verification
|
|
3
|
-
class WebmentionVerificationError < StandardError; end
|
|
4
|
-
|
|
5
|
-
class ArgumentError < WebmentionVerificationError; end
|
|
6
|
-
|
|
7
|
-
class ConnectionError < WebmentionVerificationError; end
|
|
8
|
-
|
|
9
|
-
class InvalidURIError < WebmentionVerificationError; end
|
|
10
|
-
|
|
11
|
-
class TimeoutError < WebmentionVerificationError; end
|
|
12
|
-
|
|
13
|
-
class TooManyRedirectsError < WebmentionVerificationError; end
|
|
14
|
-
|
|
15
|
-
class UnsupportedMimeTypeError < WebmentionVerificationError; end
|
|
16
|
-
end
|
|
17
|
-
end
|