webmention 7.0.0 → 9.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 +3 -0
- data/CONTRIBUTING.md +16 -13
- data/README.md +11 -28
- data/USAGE.md +19 -20
- data/lib/webmention/client.rb +31 -28
- data/lib/webmention/error_response.rb +6 -8
- data/lib/webmention/parser.rb +1 -1
- data/lib/webmention/parsers/html_parser.rb +16 -16
- data/lib/webmention/parsers/json_parser.rb +1 -1
- data/lib/webmention/parsers/plaintext_parser.rb +2 -2
- data/lib/webmention/request.rb +22 -22
- data/lib/webmention/response.rb +6 -8
- data/lib/webmention/url.rb +4 -6
- data/lib/webmention/verification.rb +23 -16
- data/lib/webmention.rb +29 -31
- data/webmention.gemspec +22 -21
- metadata +14 -18
- data/lib/webmention/version.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: 68b2e3b667fedde2265819a6c01a0b547b3a8503389a5209e2b9ce600b50945a
|
4
|
+
data.tar.gz: 622770cbe635b33de6125be189bf43a9cd23bbfff223f8897198862a463e6007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8be2cd5b737f7ea3c6321373ac41cc53f73830b5f01163591485ec0d1f2138bb133cb9eee39f57d82bb1c5e9871b435f8acbc0a7cf190f2bc55c84b7cfd56006
|
7
|
+
data.tar.gz: 2415239ef05fdd79ce8e417c4071f21bab937487ad499f2ac53c681f0605b986f4922a3b3c1204bfae10cade9916d3e6394ebd5661b03a438a096911ac3ace5d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
> [!NOTE]
|
4
|
+
> From v8.0.0, changes are documented using [GitHub Releases](https://github.com/indieweb/webmention-client-ruby/releases). For a given release, metadata on RubyGems.org will link to that version's Release page.
|
5
|
+
|
3
6
|
## 7.0.0 / 2022-11-09
|
4
7
|
|
5
8
|
- Refactor HTML and JSON parser classes (ec58206 and 6818c05)
|
data/CONTRIBUTING.md
CHANGED
@@ -2,15 +2,18 @@
|
|
2
2
|
|
3
3
|
There are a couple ways you can help improve webmention-client-ruby:
|
4
4
|
|
5
|
-
1. Fix an existing [
|
6
|
-
1. Review open [
|
7
|
-
1. Report a new [
|
5
|
+
1. Fix an existing [Issue][issues] and submit a [Pull Request][pulls].
|
6
|
+
1. Review open [Pull Requests][pulls].
|
7
|
+
1. Report a new [Issue][issues]. _Only do this after you've made sure the behavior or problem you're observing isn't already documented in an open issue._
|
8
8
|
|
9
9
|
## Getting Started
|
10
10
|
|
11
|
-
webmention-client-ruby is developed using Ruby
|
11
|
+
webmention-client-ruby is developed using Ruby 3.4 and is tested against additional Ruby versions using [GitHub Actions](https://github.com/indieweb/webmention-client-ruby/actions).
|
12
12
|
|
13
|
-
|
13
|
+
> [!TIP]
|
14
|
+
> This project is configured with a [Dev Container](https://containers.dev) which includes everything you'd need to contribute to webmention-client-ruby. If you use a supported code editor or IDE, you're encouraged to use the existing Dev Container setup.
|
15
|
+
|
16
|
+
Before making changes to webmention-client-ruby, you'll want to install Ruby 3.4. Using 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) is recommended. Once you've installed Ruby 3.4 using your method of choice, install the project's gems by running:
|
14
17
|
|
15
18
|
```sh
|
16
19
|
bundle install
|
@@ -19,17 +22,17 @@ bundle install
|
|
19
22
|
## Making Changes
|
20
23
|
|
21
24
|
1. Fork and clone the project's repo.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
2. Install development dependencies as outlined above.
|
26
|
+
3. Create a feature branch for the code changes you're looking to make: `git checkout -b my-new-feature`.
|
27
|
+
4. _Write some code!_
|
28
|
+
5. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `bin/rspec`.
|
29
|
+
6. Commit your changes: `git commit -am 'Add some new feature or fix some issue'`. _(See [this excellent article](https://cbea.ms/git-commit/) for tips on writing useful Git commit messages.)_
|
30
|
+
7. Push the branch to your fork: `git push -u origin my-new-feature`.
|
31
|
+
8. Create a new [Pull Request][pulls] and we'll review your changes.
|
29
32
|
|
30
33
|
## Code Style
|
31
34
|
|
32
|
-
Code formatting conventions are defined in the `.editorconfig` file which uses the [EditorConfig](
|
35
|
+
Code formatting conventions are defined in the `.editorconfig` file which uses the [EditorConfig](https://editorconfig.org) syntax. There are [plugins for a variety of editors](https://editorconfig.org/#download) that utilize the settings in the `.editorconfig` file. We recommended installing the EditorConfig plugin for your editor of choice.
|
33
36
|
|
34
37
|
Your bug fix or feature addition won't be rejected if it runs afoul of any (or all) of these guidelines, but following the guidelines will definitely make everyone's lives a little easier.
|
35
38
|
|
data/README.md
CHANGED
@@ -4,9 +4,7 @@
|
|
4
4
|
|
5
5
|
[](https://rubygems.org/gems/webmention)
|
6
6
|
[](https://rubygems.org/gems/webmention)
|
7
|
-
[](https://codeclimate.com/github/indieweb/webmention-client-ruby)
|
9
|
-
[](https://codeclimate.com/github/indieweb/webmention-client-ruby/code)
|
7
|
+
[](https://github.com/indieweb/webmention-client-ruby/actions/workflows/ci.yml)
|
10
8
|
|
11
9
|
## Key Features
|
12
10
|
|
@@ -14,48 +12,33 @@
|
|
14
12
|
- Perform [endpoint discovery](https://www.w3.org/TR/webmention/#sender-discovers-receiver-webmention-endpoint) on mentioned URLs.
|
15
13
|
- Send webmentions to one or more mentioned URLs (and optionally include a [vouch](https://indieweb.org/Vouch) URL).
|
16
14
|
- Verify that a received webmention's source URL links to a target URL (and optionally verify that a vouch URL mentions the source URL's domain).
|
15
|
+
- Supports Ruby 2.7 and newer.
|
17
16
|
|
18
17
|
## Getting Started
|
19
18
|
|
20
|
-
Before installing and using webmention-client-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed.
|
19
|
+
Before installing and using webmention-client-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed. Using 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) is recommended.
|
21
20
|
|
22
|
-
webmention-client-ruby is developed using Ruby
|
21
|
+
webmention-client-ruby is developed using Ruby 3.4 and is tested against additional Ruby versions using [GitHub Actions](https://github.com/indieweb/webmention-client-ruby/actions).
|
23
22
|
|
24
23
|
## Installation
|
25
24
|
|
26
|
-
|
25
|
+
Add webmention-client-ruby to your project's `Gemfile` and run `bundle install`:
|
27
26
|
|
28
27
|
```ruby
|
29
|
-
|
30
|
-
```
|
31
|
-
|
32
|
-
…and run `bundle install` in your shell.
|
33
|
-
|
34
|
-
To install the gem manually, run the following in your shell:
|
28
|
+
source "https://rubygems.org"
|
35
29
|
|
36
|
-
|
37
|
-
gem install webmention
|
30
|
+
gem "webmention"
|
38
31
|
```
|
39
32
|
|
40
33
|
## Usage
|
41
34
|
|
42
|
-
See [USAGE.md](
|
43
|
-
|
44
|
-
## Migrating to version 6
|
45
|
-
|
46
|
-
webmention-client-ruby was completely rewritten for version 6 to better support new features and future development. Some notes on migrating to the new version:
|
47
|
-
|
48
|
-
♻️ **Renamed:** for clarity and consistency, the `Webmention.send_mention` method has been renamed `Webmention.send_webmention`. Both methods use the same interface.
|
49
|
-
|
50
|
-
❌ **Removed:** the `Webmention.client` method has been removed in favor of the additional module methods [noted above](#usage). While the underlying `Webmention::Client` class still exists, its interface has changed and its direct usage is generally unnecessary.
|
51
|
-
|
52
|
-
❌ **Removed:** `Webmention::Client#send_all_mentions` has been removed in favor of `Webmention.send_webmentions`. Combine `Webmention.mentioned_urls` and `Webmention.send_webmentions` to achieve similar results.
|
53
|
-
|
54
|
-
🛠 **Refactored:** Exception handling has been greatly improved [as noted above](#exception-handling).
|
35
|
+
See [USAGE.md](USAGE.md) for documentation of webmention-client-ruby's features.
|
55
36
|
|
56
37
|
## Contributing
|
57
38
|
|
58
|
-
|
39
|
+
See [CONTRIBUTING.md](https://github.com/indieweb/webmention-client-ruby/blob/main/CONTRIBUTING.md) for more on how to contribute to webmention-client-ruby. Your help is greatly appreciated!
|
40
|
+
|
41
|
+
By contributing to and participating in the development of webmention-client-ruby, you acknowledge that you have read and agree to the [IndieWeb Code of Conduct](https://indieweb.org/code-of-conduct).
|
59
42
|
|
60
43
|
## Acknowledgments
|
61
44
|
|
data/USAGE.md
CHANGED
@@ -1,23 +1,22 @@
|
|
1
1
|
# Using webmention-client-ruby
|
2
2
|
|
3
|
-
|
3
|
+
> [!NOTE]
|
4
|
+
> Before using webmention-client-ruby, please read the [Getting Started](README.md#getting-started) and [Installation](README.md#installation) sections of the project's [README.md](README.md).
|
4
5
|
|
5
6
|
## Sending a webmention
|
6
7
|
|
7
8
|
With webmention-client-ruby installed, you may send a webmention from a source URL to a target URL:
|
8
9
|
|
9
10
|
```ruby
|
10
|
-
require
|
11
|
+
require "webmention"
|
11
12
|
|
12
|
-
source =
|
13
|
-
target =
|
13
|
+
source = "https://jgarber.example/post/100" # A post on your website
|
14
|
+
target = "https://aaronpk.example/post/100" # A post on someone else's website
|
14
15
|
|
15
16
|
response = Webmention.send_webmention(source, target)
|
16
17
|
```
|
17
18
|
|
18
|
-
`Webmention.send_webmention` will return either a `Webmention::Response` or a `Webmention::ErrorResponse`. Instances of both classes respond to `ok?`. Building on the examples above:
|
19
|
-
|
20
|
-
A `Webmention::ErrorResponse` may be returned when:
|
19
|
+
`Webmention.send_webmention` will return either a `Webmention::Response` or a `Webmention::ErrorResponse`. Instances of both classes respond to `ok?`. Building on the examples above, a `Webmention::ErrorResponse` may be returned when:
|
21
20
|
|
22
21
|
1. The target URL does not advertise a Webmention endpoint.
|
23
22
|
2. The request to the target URL raises an `HTTP::Error` or an `OpenSSL::SSL::SSLError`.
|
@@ -54,15 +53,16 @@ response.mime_type #=> String
|
|
54
53
|
response.uri #=> HTTP::URI
|
55
54
|
```
|
56
55
|
|
57
|
-
|
56
|
+
> [!NOTE]
|
57
|
+
> `Webmention::Response` objects may return a variety of status codes that will vary depending on the endpoint's capabilities and the success or failure of the request. See [the Webmention spec](https://www.w3.org/TR/webmention/) for more on status codes on their implications. A `Webmention::Response` responding affirmatively to `ok?` _may_ also have a non-successful HTTP status code (e.g. `404 Not Found`).
|
58
58
|
|
59
59
|
## Sending multiple webmentions
|
60
60
|
|
61
61
|
To send webmentions to multiple target URLs mentioned by a source URL:
|
62
62
|
|
63
63
|
```ruby
|
64
|
-
source =
|
65
|
-
targets = [
|
64
|
+
source = "https://jgarber.example/post/100"
|
65
|
+
targets = ["https://aaronpk.example/notes/1", "https://adactio.example/notes/1"]
|
66
66
|
|
67
67
|
responses = Webmention.send_webmentions(source, targets)
|
68
68
|
```
|
@@ -75,10 +75,10 @@ webmention-client-ruby supports submitting a [vouch](https://indieweb.org/Vouch)
|
|
75
75
|
|
76
76
|
```ruby
|
77
77
|
# Send a webmention with a vouch URL to a target URL
|
78
|
-
Webmention.send_webmention(source, target, vouch:
|
78
|
+
Webmention.send_webmention(source, target, vouch: "https://tantek.example/notes/1")
|
79
79
|
|
80
80
|
# Send webmentions with a vouch URL to multiple target URLs
|
81
|
-
Webmention.send_webmentions(source, targets, vouch:
|
81
|
+
Webmention.send_webmentions(source, targets, vouch: "https://tantek.example/notes/1")
|
82
82
|
```
|
83
83
|
|
84
84
|
## Discovering mentioned URLs
|
@@ -86,14 +86,15 @@ Webmention.send_webmentions(source, targets, vouch: 'https://tantek.example/note
|
|
86
86
|
To retrieve unique URLs mentioned by a URL:
|
87
87
|
|
88
88
|
```ruby
|
89
|
-
urls = Webmention.mentioned_urls(
|
89
|
+
urls = Webmention.mentioned_urls("https://jgarber.example/post/100")
|
90
90
|
```
|
91
91
|
|
92
92
|
`Webmention.mentioned_urls` will crawl the provided URL, parse the response body, and return a sorted list of unique URLs. Response bodies are parsed using MIME type-specific rules as noted in the [Verifying a webmention](#verifying-a-webmention) section below.
|
93
93
|
|
94
94
|
When parsing HTML documents, webmention-client-ruby will find the first [h-entry](https://microformats.org/wiki/h-entry) and search its markup for URLs. If no h-entry is found, the parser will search the document's `<body>`.
|
95
95
|
|
96
|
-
|
96
|
+
> [!NOTE]
|
97
|
+
> Links pointing to the supplied URL (or those with internal fragment identifiers) will be rejected. You may wish to additionally filter the results returned by `Webmention.mentioned_urls` before sending webmentions.
|
97
98
|
|
98
99
|
## Verifying a webmention
|
99
100
|
|
@@ -129,7 +130,7 @@ verification = Webmention.verify_webmention(source, target)
|
|
129
130
|
|
130
131
|
# Verify that a source URL links to a target URL and that the vouch URL mentions
|
131
132
|
# the source URL's domain
|
132
|
-
verification = Webmention.verify_webmention(source, target, vouch:
|
133
|
+
verification = Webmention.verify_webmention(source, target, vouch: "https://tantek.example/notes/1")
|
133
134
|
```
|
134
135
|
|
135
136
|
`Webmention.verify_webmention` returns an instance of `Webmention::Verification` which includes the following methods (each returns either `true` or `false`):
|
@@ -141,13 +142,11 @@ verification.verify_vouch?
|
|
141
142
|
verification.vouch_mentions_source?
|
142
143
|
```
|
143
144
|
|
144
|
-
|
145
|
+
> [!NOTE]
|
146
|
+
> `Webmention.verify_webmention` parses HTML documents using the same rules outlined in [Discovering mentioned URLs](#discovering-mentioned-urls).
|
145
147
|
|
146
148
|
## Exception Handling
|
147
149
|
|
148
150
|
webmention-client-ruby avoids raising exceptions when making HTTP requests. As noted above, a `Webmention::ErrorResponse` should be returned in cases where an HTTP request triggers an exception.
|
149
151
|
|
150
|
-
When crawling the supplied URL, `Webmention.mentioned_urls` _may_ raise a `NoMethodError` if
|
151
|
-
|
152
|
-
- a `Webmention::ErrorResponse` is returned, or
|
153
|
-
- the response is of an unsupported MIME type.
|
152
|
+
When crawling the supplied URL, `Webmention.mentioned_urls` _may_ raise a `NoMethodError` if a `Webmention::ErrorResponse` is returned, or the response is of an unsupported MIME type.
|
data/lib/webmention/client.rb
CHANGED
@@ -9,10 +9,10 @@ module Webmention
|
|
9
9
|
attr_reader :registered_parsers
|
10
10
|
end
|
11
11
|
|
12
|
-
# @return [
|
12
|
+
# @return [Url]
|
13
13
|
attr_reader :source_url
|
14
14
|
|
15
|
-
# @return [
|
15
|
+
# @return [Url]
|
16
16
|
attr_reader :vouch_url
|
17
17
|
|
18
18
|
# @api private
|
@@ -20,21 +20,19 @@ module Webmention
|
|
20
20
|
klass.mime_types.each { |mime_type| @registered_parsers[mime_type] = klass }
|
21
21
|
end
|
22
22
|
|
23
|
-
# Create a new
|
23
|
+
# Create a new {Client}.
|
24
24
|
#
|
25
25
|
# @example
|
26
|
-
# Webmention::Client.new(
|
26
|
+
# Webmention::Client.new("https://jgarber.example/posts/100")
|
27
27
|
#
|
28
28
|
# @example
|
29
|
-
# Webmention::Client.new(
|
29
|
+
# Webmention::Client.new("https://jgarber.example/posts/100", vouch: "https://tantek.example/notes/1")
|
30
30
|
#
|
31
31
|
# @param source [String, HTTP::URI, #to_s]
|
32
32
|
# An absolute URL representing a source document.
|
33
33
|
# @param vouch [String, HTTP::URI, #to_s]
|
34
34
|
# An absolute URL representing a document vouching for the source document.
|
35
35
|
# See https://indieweb.org/Vouch for additional details.
|
36
|
-
#
|
37
|
-
# @return [Webmention::Client]
|
38
36
|
def initialize(source, vouch: nil)
|
39
37
|
@source_url = Url.new(source)
|
40
38
|
@vouch_url = Url.new(vouch)
|
@@ -43,7 +41,7 @@ module Webmention
|
|
43
41
|
# :nocov:
|
44
42
|
# @return [String]
|
45
43
|
def inspect
|
46
|
-
"#<#{self.class}:#{format(
|
44
|
+
"#<#{self.class}:#{format("%#0x", object_id)} " \
|
47
45
|
"source_url: #{source_url} " \
|
48
46
|
"vouch_url: #{vouch_url}>"
|
49
47
|
end
|
@@ -52,36 +50,39 @@ module Webmention
|
|
52
50
|
# Retrieve unique URLs mentioned by this client's source URL.
|
53
51
|
#
|
54
52
|
# @example
|
55
|
-
# client = Webmention::Client.new(
|
53
|
+
# client = Webmention::Client.new("https://jgarber.example/posts/100")
|
56
54
|
# client.mentioned_urls
|
57
55
|
#
|
58
56
|
# @raise [NoMethodError]
|
59
|
-
# Raised when response is
|
57
|
+
# Raised when response is an {ErrorResponse} or response is of an
|
60
58
|
# unsupported MIME type.
|
61
59
|
#
|
62
60
|
# @return [Array<String>]
|
63
61
|
def mentioned_urls
|
64
62
|
response = source_url.response
|
65
63
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
64
|
+
urls = Set.new(
|
65
|
+
self.class
|
66
|
+
.registered_parsers[response.mime_type]
|
67
|
+
.new(response.body, response.uri)
|
68
|
+
.results
|
69
|
+
)
|
70
|
+
|
71
|
+
urls.reject! { |url| url.match(/^#{response.uri}(?:#.*)?$/) }
|
72
|
+
|
73
|
+
urls.to_a.sort
|
73
74
|
end
|
74
75
|
|
75
76
|
# Send a webmention from this client's source URL to a target URL.
|
76
77
|
#
|
77
78
|
# @example
|
78
|
-
# client = Webmention::Client.new(
|
79
|
-
# client.send_webmention(
|
79
|
+
# client = Webmention::Client.new("https://jgarber.example/posts/100")
|
80
|
+
# client.send_webmention("https://aaronpk.example/notes/1")
|
80
81
|
#
|
81
82
|
# @param target [String, HTTP::URI, #to_s]
|
82
83
|
# An absolute URL representing a target document.
|
83
84
|
#
|
84
|
-
# @return [
|
85
|
+
# @return [Response, ErrorResponse]
|
85
86
|
def send_webmention(target)
|
86
87
|
target_url = Url.new(target)
|
87
88
|
|
@@ -100,14 +101,14 @@ module Webmention
|
|
100
101
|
# Send webmentions from this client's source URL to multiple target URLs.
|
101
102
|
#
|
102
103
|
# @example
|
103
|
-
# client = Webmention::Client.new(
|
104
|
-
# targets = [
|
104
|
+
# client = Webmention::Client.new("https://jgarber.example/posts/100")
|
105
|
+
# targets = ["https://aaronpk.example/notes/1", "https://adactio.example/notes/1"]
|
105
106
|
# client.send_webmentions(targets)
|
106
107
|
#
|
107
108
|
# @param targets [Array<String, HTTP::URI, #to_s>]
|
108
109
|
# An array of absolute URLs representing multiple target documents.
|
109
110
|
#
|
110
|
-
# @return [Array<
|
111
|
+
# @return [Array<Response, ErrorResponse>]
|
111
112
|
def send_webmentions(*targets)
|
112
113
|
targets.map { |target| send_webmention(target) }
|
113
114
|
end
|
@@ -117,9 +118,9 @@ module Webmention
|
|
117
118
|
# @param target [String, HTTP::URI, #to_s]
|
118
119
|
# An absolute URL representing a target document.
|
119
120
|
#
|
120
|
-
# @raise (see
|
121
|
+
# @raise (see Client#mentioned_urls)
|
121
122
|
#
|
122
|
-
# @return [
|
123
|
+
# @return [Verification]
|
123
124
|
def verify_webmention(target)
|
124
125
|
Verification.new(source_url, Url.new(target), vouch_url: vouch_url)
|
125
126
|
end
|
@@ -133,11 +134,13 @@ module Webmention
|
|
133
134
|
opts = {
|
134
135
|
source: source_url,
|
135
136
|
target: target,
|
136
|
-
vouch: vouch_url
|
137
|
+
vouch: vouch_url,
|
137
138
|
}
|
138
139
|
|
139
|
-
opts.transform_values { |value| value.to_s.strip }
|
140
|
-
|
140
|
+
opts.transform_values! { |value| value.to_s.strip }
|
141
|
+
opts.reject! { |_, value| value.empty? }
|
142
|
+
|
143
|
+
opts
|
141
144
|
end
|
142
145
|
end
|
143
146
|
end
|
@@ -5,20 +5,18 @@ module Webmention
|
|
5
5
|
# @return [String]
|
6
6
|
attr_reader :message
|
7
7
|
|
8
|
-
# @return [
|
8
|
+
# @return [Request]
|
9
9
|
attr_reader :request
|
10
10
|
|
11
|
-
# Create a new
|
11
|
+
# Create a new {ErrorResponse}.
|
12
12
|
#
|
13
13
|
# Instances of this class represent HTTP requests that generated errors
|
14
14
|
# (e.g. connection error, SSL error) or that could not locate a Webmention
|
15
|
-
# endpoint. The nature of the error is captured in the
|
16
|
-
#
|
15
|
+
# endpoint. The nature of the error is captured in the {#message} instance
|
16
|
+
# method.
|
17
17
|
#
|
18
18
|
# @param message [String]
|
19
|
-
# @param request [
|
20
|
-
#
|
21
|
-
# @return [Webmention::ErrorResponse]
|
19
|
+
# @param request [Request]
|
22
20
|
def initialize(message, request)
|
23
21
|
@message = message
|
24
22
|
@request = request
|
@@ -27,7 +25,7 @@ module Webmention
|
|
27
25
|
# :nocov:
|
28
26
|
# @return [String]
|
29
27
|
def inspect
|
30
|
-
"#<#{self.class}:#{format(
|
28
|
+
"#<#{self.class}:#{format("%#0x", object_id)} " \
|
31
29
|
"message: #{message}>"
|
32
30
|
end
|
33
31
|
# :nocov:
|
data/lib/webmention/parser.rb
CHANGED
@@ -4,24 +4,23 @@ module Webmention
|
|
4
4
|
module Parsers
|
5
5
|
# @api private
|
6
6
|
class HtmlParser < Parser
|
7
|
-
@mime_types = [
|
7
|
+
@mime_types = ["text/html"]
|
8
8
|
|
9
9
|
Client.register_parser(self)
|
10
10
|
|
11
11
|
HTML_ATTRIBUTES_MAP = {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
"cite" => ["blockquote", "del", "ins", "q"],
|
13
|
+
"data" => ["object"],
|
14
|
+
"href" => ["a", "area"],
|
15
|
+
"poster" => ["video"],
|
16
|
+
"src" => ["audio", "embed", "img", "source", "track", "video"],
|
17
|
+
"srcset" => ["img", "source"],
|
18
18
|
}.freeze
|
19
19
|
|
20
|
-
CSS_SELECTORS_ARRAY = HTML_ATTRIBUTES_MAP
|
21
|
-
|
22
|
-
end.freeze
|
20
|
+
CSS_SELECTORS_ARRAY = HTML_ATTRIBUTES_MAP
|
21
|
+
.flat_map { |attribute, names| names.map { |name| "#{name}[#{attribute}]" } }.freeze
|
23
22
|
|
24
|
-
ROOT_NODE_SELECTORS_ARRAY = [
|
23
|
+
ROOT_NODE_SELECTORS_ARRAY = [".h-entry .e-content", ".h-entry", "body"].freeze
|
25
24
|
|
26
25
|
private_constant :HTML_ATTRIBUTES_MAP
|
27
26
|
private_constant :CSS_SELECTORS_ARRAY
|
@@ -30,8 +29,9 @@ module Webmention
|
|
30
29
|
# @return [Array<String>] An array of absolute URLs.
|
31
30
|
def results
|
32
31
|
@results ||=
|
33
|
-
extract_urls_from(*url_attributes)
|
34
|
-
|
32
|
+
extract_urls_from(*url_attributes)
|
33
|
+
.map { |url| response_uri.join(url).to_s }
|
34
|
+
.grep(Parser::URI_REGEXP)
|
35
35
|
end
|
36
36
|
|
37
37
|
private
|
@@ -46,8 +46,8 @@ module Webmention
|
|
46
46
|
# @return [Array<String>]
|
47
47
|
def extract_urls_from(*attributes)
|
48
48
|
attributes.flat_map do |attribute|
|
49
|
-
if attribute.name ==
|
50
|
-
attribute.value.split(
|
49
|
+
if attribute.name == "srcset"
|
50
|
+
attribute.value.split(",").map { |value| value.strip.match(/^\S+/).to_s }
|
51
51
|
else
|
52
52
|
attribute.value
|
53
53
|
end
|
@@ -61,7 +61,7 @@ module Webmention
|
|
61
61
|
|
62
62
|
# @return [Array<Nokogiri::XML::Attr>]
|
63
63
|
def url_attributes
|
64
|
-
url_nodes.flat_map(&:attribute_nodes).
|
64
|
+
url_nodes.flat_map(&:attribute_nodes).select { |attribute| HTML_ATTRIBUTES_MAP.key?(attribute.name) }
|
65
65
|
end
|
66
66
|
|
67
67
|
# @return [Nokogiri::XML::NodeSet]
|
@@ -4,13 +4,13 @@ module Webmention
|
|
4
4
|
module Parsers
|
5
5
|
# @api private
|
6
6
|
class PlaintextParser < Parser
|
7
|
-
@mime_types = [
|
7
|
+
@mime_types = ["text/plain"]
|
8
8
|
|
9
9
|
Client.register_parser(self)
|
10
10
|
|
11
11
|
# @return [Array<String>] An array of absolute URLs.
|
12
12
|
def results
|
13
|
-
@results ||= URI::DEFAULT_PARSER.extract(response_body,
|
13
|
+
@results ||= URI::DEFAULT_PARSER.extract(response_body, ["http", "https"])
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/webmention/request.rb
CHANGED
@@ -2,20 +2,22 @@
|
|
2
2
|
|
3
3
|
module Webmention
|
4
4
|
class Request
|
5
|
-
#
|
5
|
+
# Set defaults derived from Webmention specification examples.
|
6
|
+
#
|
6
7
|
# @see https://www.w3.org/TR/webmention/#limits-on-get-requests
|
8
|
+
# W3C Webmention Recommendation § 4.2 Limits on GET requests
|
7
9
|
HTTP_CLIENT_OPTS = {
|
8
10
|
follow: {
|
9
|
-
max_hops: 20
|
11
|
+
max_hops: 20,
|
10
12
|
},
|
11
13
|
headers: {
|
12
|
-
accept:
|
13
|
-
user_agent:
|
14
|
+
accept: "*/*",
|
15
|
+
user_agent: "Webmention Client (https://rubygems.org/gems/webmention)",
|
14
16
|
},
|
15
17
|
timeout_options: {
|
16
18
|
connect_timeout: 5,
|
17
|
-
read_timeout: 5
|
18
|
-
}
|
19
|
+
read_timeout: 5,
|
20
|
+
},
|
19
21
|
}.freeze
|
20
22
|
|
21
23
|
private_constant :HTTP_CLIENT_OPTS
|
@@ -32,11 +34,11 @@ module Webmention
|
|
32
34
|
# Send an HTTP GET request to the supplied URL.
|
33
35
|
#
|
34
36
|
# @example
|
35
|
-
# Request.get(
|
37
|
+
# Webmention::Request.get("https://jgarber.example/posts/100")
|
36
38
|
#
|
37
39
|
# @param url [String]
|
38
40
|
#
|
39
|
-
# @return [
|
41
|
+
# @return [Response, ErrorResponse]
|
40
42
|
def self.get(url)
|
41
43
|
new(:get, url).perform
|
42
44
|
end
|
@@ -44,11 +46,11 @@ module Webmention
|
|
44
46
|
# Send an HTTP POST request with form-encoded data to the supplied URL.
|
45
47
|
#
|
46
48
|
# @example
|
47
|
-
# Request.post(
|
48
|
-
#
|
49
|
-
# source:
|
50
|
-
# target:
|
51
|
-
# vouch:
|
49
|
+
# Webmention::Request.post(
|
50
|
+
# "https://aaronpk.example/webmention",
|
51
|
+
# source: "https://jgarber.examples/posts/100",
|
52
|
+
# target: "https://aaronpk.example/notes/1",
|
53
|
+
# vouch: "https://tantek.example/notes/1"
|
52
54
|
# )
|
53
55
|
#
|
54
56
|
# @param url [String]
|
@@ -61,18 +63,16 @@ module Webmention
|
|
61
63
|
# An absolute URL representing a document vouching for the source document.
|
62
64
|
# See https://indieweb.org/Vouch for additional details.
|
63
65
|
#
|
64
|
-
# @return [
|
66
|
+
# @return [Response, ErrorResponse]
|
65
67
|
def self.post(url, **options)
|
66
68
|
new(:post, url, form: options.slice(:source, :target, :vouch)).perform
|
67
69
|
end
|
68
70
|
|
69
|
-
# Create a new
|
71
|
+
# Create a new {Request}.
|
70
72
|
#
|
71
73
|
# @param method [Symbol]
|
72
74
|
# @param url [String]
|
73
75
|
# @param options [Hash{Symbol => String}]
|
74
|
-
#
|
75
|
-
# @return [Webmention::Request]
|
76
76
|
def initialize(method, url, **options)
|
77
77
|
@method = method.to_sym
|
78
78
|
@uri = HTTP::URI.parse(url.to_s)
|
@@ -82,24 +82,24 @@ module Webmention
|
|
82
82
|
# :nocov:
|
83
83
|
# @return [String]
|
84
84
|
def inspect
|
85
|
-
"#<#{self.class}:#{format(
|
85
|
+
"#<#{self.class}:#{format("%#0x", object_id)} " \
|
86
86
|
"method: #{method.upcase}, " \
|
87
87
|
"url: #{uri}>"
|
88
88
|
end
|
89
89
|
# :nocov:
|
90
90
|
|
91
|
-
# Submit the
|
91
|
+
# Submit the {Request}.
|
92
92
|
#
|
93
|
-
# @return [
|
93
|
+
# @return [Response, ErrorResponse]
|
94
94
|
def perform
|
95
95
|
Response.new(client.request(method, uri, options), self)
|
96
|
-
rescue HTTP::Error,
|
97
|
-
OpenSSL::SSL::SSLError => e
|
96
|
+
rescue HTTP::Error, OpenSSL::SSL::SSLError => e
|
98
97
|
ErrorResponse.new(e.message, self)
|
99
98
|
end
|
100
99
|
|
101
100
|
private
|
102
101
|
|
102
|
+
# @return [HTTP::Client]
|
103
103
|
def client
|
104
104
|
@client ||= HTTP::Client.new(HTTP_CLIENT_OPTS)
|
105
105
|
end
|
data/lib/webmention/response.rb
CHANGED
@@ -4,7 +4,7 @@ module Webmention
|
|
4
4
|
class Response
|
5
5
|
extend Forwardable
|
6
6
|
|
7
|
-
# @return [
|
7
|
+
# @return [Request]
|
8
8
|
attr_reader :request
|
9
9
|
|
10
10
|
# @!method
|
@@ -31,16 +31,14 @@ module Webmention
|
|
31
31
|
# @return [HTTP::URI]
|
32
32
|
def_delegator :@response, :uri
|
33
33
|
|
34
|
-
# Create a new
|
34
|
+
# Create a new {Response}.
|
35
35
|
#
|
36
36
|
# Instances of this class represent completed HTTP requests, the details
|
37
|
-
# of which may be accessed using the delegated
|
38
|
-
#
|
37
|
+
# of which may be accessed using the delegated {#code} and {#reason}
|
38
|
+
# instance methods.
|
39
39
|
#
|
40
40
|
# @param response [HTTP::Response]
|
41
|
-
# @param request [
|
42
|
-
#
|
43
|
-
# @return [Webmention::Response]
|
41
|
+
# @param request [Request]
|
44
42
|
def initialize(response, request)
|
45
43
|
@response = response
|
46
44
|
@request = request
|
@@ -49,7 +47,7 @@ module Webmention
|
|
49
47
|
# :nocov:
|
50
48
|
# @return [String]
|
51
49
|
def inspect
|
52
|
-
"#<#{self.class}:#{format(
|
50
|
+
"#<#{self.class}:#{format("%#0x", object_id)} " \
|
53
51
|
"code: #{code.inspect}, " \
|
54
52
|
"reason: #{reason}, " \
|
55
53
|
"url: #{request.uri}>"
|
data/lib/webmention/url.rb
CHANGED
@@ -11,11 +11,9 @@ module Webmention
|
|
11
11
|
# @return [String]
|
12
12
|
def_delegator :uri, :to_s
|
13
13
|
|
14
|
-
# Create a new
|
14
|
+
# Create a new {Url}.
|
15
15
|
#
|
16
16
|
# @param url [String, HTTP::URI, #to_s] An absolute URL.
|
17
|
-
#
|
18
|
-
# @return [Webmention::Url]
|
19
17
|
def initialize(url)
|
20
18
|
@uri = HTTP::URI.parse(url.to_s)
|
21
19
|
end
|
@@ -23,19 +21,19 @@ module Webmention
|
|
23
21
|
# :nocov:
|
24
22
|
# @return [String]
|
25
23
|
def inspect
|
26
|
-
"#<#{self.class}:#{format(
|
24
|
+
"#<#{self.class}:#{format("%#0x", object_id)} " \
|
27
25
|
"uri: #{uri}>"
|
28
26
|
end
|
29
27
|
# :nocov:
|
30
28
|
|
31
|
-
# @return [
|
29
|
+
# @return [Response, ErrorResponse]
|
32
30
|
def response
|
33
31
|
@response ||= Request.get(uri)
|
34
32
|
end
|
35
33
|
|
36
34
|
# @return [String, nil]
|
37
35
|
def webmention_endpoint
|
38
|
-
@webmention_endpoint ||= IndieWeb::Endpoints::Parser.new(response).
|
36
|
+
@webmention_endpoint ||= IndieWeb::Endpoints::Parser.new(response).to_h[:webmention] if response.ok?
|
39
37
|
end
|
40
38
|
|
41
39
|
# @return [Boolean]
|
@@ -2,9 +2,15 @@
|
|
2
2
|
|
3
3
|
module Webmention
|
4
4
|
class Verification
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# @param
|
5
|
+
# Create a new {Verification}.
|
6
|
+
#
|
7
|
+
# @param source_url [Url]
|
8
|
+
# An {URL} representing a source document.
|
9
|
+
# @param target_url [Url]
|
10
|
+
# An {URL} representing a target document.
|
11
|
+
# @param vouch_url [Url]
|
12
|
+
# An {URL} representing a document vouching for the source document.
|
13
|
+
# See https://indieweb.org/Vouch for additional details.
|
8
14
|
def initialize(source_url, target_url, vouch_url: nil)
|
9
15
|
@source_url = source_url
|
10
16
|
@target_url = target_url
|
@@ -14,7 +20,7 @@ module Webmention
|
|
14
20
|
# :nocov:
|
15
21
|
# @return [String]
|
16
22
|
def inspect
|
17
|
-
"#<#{self.class}:#{format(
|
23
|
+
"#<#{self.class}:#{format("%#0x", object_id)} " \
|
18
24
|
"source_url: #{source_url} " \
|
19
25
|
"target_url: #{target_url} " \
|
20
26
|
"vouch_url: #{vouch_url}>"
|
@@ -46,34 +52,35 @@ module Webmention
|
|
46
52
|
|
47
53
|
private
|
48
54
|
|
49
|
-
# @return [
|
55
|
+
# @return [Url]
|
50
56
|
attr_reader :source_url
|
51
57
|
|
52
|
-
# @return [
|
58
|
+
# @return [Url]
|
53
59
|
attr_reader :target_url
|
54
60
|
|
55
|
-
# @return [
|
61
|
+
# @return [Url]
|
56
62
|
attr_reader :vouch_url
|
57
63
|
|
58
|
-
# @param response [
|
64
|
+
# @param response [Response]
|
59
65
|
#
|
60
|
-
# @raise (see
|
66
|
+
# @raise (see Client#mentioned_urls)
|
61
67
|
#
|
62
68
|
# @return [Array<String>]
|
63
69
|
def mentioned_domains(response)
|
64
|
-
mentioned_urls(response).map { |url| HTTP::URI.parse(url).host }.
|
70
|
+
Set.new(mentioned_urls(response).map { |url| HTTP::URI.parse(url).host }).to_a
|
65
71
|
end
|
66
72
|
|
67
|
-
# @param response [
|
73
|
+
# @param response [Response]
|
68
74
|
#
|
69
|
-
# @raise (see
|
75
|
+
# @raise (see Client#mentioned_urls)
|
70
76
|
#
|
71
77
|
# @return [Array<String>]
|
72
78
|
def mentioned_urls(response)
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
79
|
+
Set.new(
|
80
|
+
Client.registered_parsers[response.mime_type]
|
81
|
+
.new(response.body, response.uri)
|
82
|
+
.results
|
83
|
+
).to_a
|
77
84
|
end
|
78
85
|
end
|
79
86
|
end
|
data/lib/webmention.rb
CHANGED
@@ -1,35 +1,33 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "json"
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
5
|
+
require "http"
|
6
|
+
require "indieweb/endpoints"
|
7
|
+
require "nokogiri"
|
8
8
|
|
9
|
-
require_relative
|
9
|
+
require_relative "webmention/client"
|
10
|
+
require_relative "webmention/url"
|
11
|
+
require_relative "webmention/request"
|
12
|
+
require_relative "webmention/response"
|
13
|
+
require_relative "webmention/error_response"
|
14
|
+
require_relative "webmention/verification"
|
10
15
|
|
11
|
-
require_relative
|
12
|
-
require_relative
|
13
|
-
require_relative
|
14
|
-
require_relative
|
15
|
-
require_relative 'webmention/error_response'
|
16
|
-
require_relative 'webmention/verification'
|
17
|
-
|
18
|
-
require_relative 'webmention/parser'
|
19
|
-
require_relative 'webmention/parsers/html_parser'
|
20
|
-
require_relative 'webmention/parsers/json_parser'
|
21
|
-
require_relative 'webmention/parsers/plaintext_parser'
|
16
|
+
require_relative "webmention/parser"
|
17
|
+
require_relative "webmention/parsers/html_parser"
|
18
|
+
require_relative "webmention/parsers/json_parser"
|
19
|
+
require_relative "webmention/parsers/plaintext_parser"
|
22
20
|
|
23
21
|
module Webmention
|
24
22
|
# Retrieve unique URLs mentioned by the provided URL.
|
25
23
|
#
|
26
24
|
# @example
|
27
|
-
# Webmention.mentioned_urls(
|
25
|
+
# Webmention.mentioned_urls("https://jgarber.example/posts/100")
|
28
26
|
#
|
29
27
|
# @param url [String, HTTP::URI, #to_s] An absolute URL.
|
30
28
|
#
|
31
29
|
# @raise [NoMethodError]
|
32
|
-
# Raised when response is
|
30
|
+
# Raised when response is an {ErrorResponse} or response is of an
|
33
31
|
# unsupported MIME type.
|
34
32
|
#
|
35
33
|
# @return [Array<String>]
|
@@ -40,14 +38,14 @@ module Webmention
|
|
40
38
|
# Send a webmention from a source URL to a target URL.
|
41
39
|
#
|
42
40
|
# @example Send a webmention
|
43
|
-
# source =
|
44
|
-
# target =
|
41
|
+
# source = "https://jgarber.example/posts/100"
|
42
|
+
# target = "https://aaronpk.example/notes/1"
|
45
43
|
# Webmention.send_webmention(source, target)
|
46
44
|
#
|
47
45
|
# @example Send a webmention with a vouch URL
|
48
|
-
# source =
|
49
|
-
# target =
|
50
|
-
# Webmention.send_webmention(source, target, vouch:
|
46
|
+
# source = "https://jgarber.example/posts/100"
|
47
|
+
# target = "https://aaronpk.example/notes/1"
|
48
|
+
# Webmention.send_webmention(source, target, vouch: "https://tantek.example/notes/1")
|
51
49
|
#
|
52
50
|
# @param source [String, HTTP::URI, #to_s]
|
53
51
|
# An absolute URL representing a source document.
|
@@ -57,7 +55,7 @@ module Webmention
|
|
57
55
|
# An absolute URL representing a document vouching for the source document.
|
58
56
|
# See https://indieweb.org/Vouch for additional details.
|
59
57
|
#
|
60
|
-
# @return [
|
58
|
+
# @return [Response, ErrorResponse]
|
61
59
|
def self.send_webmention(source, target, vouch: nil)
|
62
60
|
Client.new(source, vouch: vouch).send_webmention(target)
|
63
61
|
end
|
@@ -65,14 +63,14 @@ module Webmention
|
|
65
63
|
# Send webmentions from a source URL to multiple target URLs.
|
66
64
|
#
|
67
65
|
# @example Send multiple webmentions
|
68
|
-
# source =
|
69
|
-
# targets = [
|
66
|
+
# source = "https://jgarber.example/posts/100"
|
67
|
+
# targets = ["https://aaronpk.example/notes/1", "https://adactio.example/notes/1"]
|
70
68
|
# Webmention.send_webmentions(source, targets)
|
71
69
|
#
|
72
70
|
# @example Send multiple webmentions with a vouch URL
|
73
|
-
# source =
|
74
|
-
# targets = [
|
75
|
-
# Webmention.send_webmentions(source, targets, vouch:
|
71
|
+
# source = "https://jgarber.example/posts/100"
|
72
|
+
# targets = ["https://aaronpk.example/notes/1", "https://adactio.example/notes/1"]
|
73
|
+
# Webmention.send_webmentions(source, targets, vouch: "https://tantek.example/notes/1")
|
76
74
|
#
|
77
75
|
# @param source [String, HTTP::URI, #to_s]
|
78
76
|
# An absolute URL representing a source document.
|
@@ -82,7 +80,7 @@ module Webmention
|
|
82
80
|
# An absolute URL representing a document vouching for the source document.
|
83
81
|
# See https://indieweb.org/Vouch for additional details.
|
84
82
|
#
|
85
|
-
# @return [Array<
|
83
|
+
# @return [Array<Response, ErrorResponse>]
|
86
84
|
def self.send_webmentions(source, *targets, vouch: nil)
|
87
85
|
Client.new(source, vouch: vouch).send_webmentions(*targets)
|
88
86
|
end
|
@@ -91,7 +89,7 @@ module Webmention
|
|
91
89
|
#
|
92
90
|
# @param (see Webmention.send_webmention)
|
93
91
|
#
|
94
|
-
# @raise (see
|
92
|
+
# @raise (see Client#mentioned_urls)
|
95
93
|
#
|
96
94
|
# @return [Boolean]
|
97
95
|
def self.verify_webmention(source, target, vouch: nil)
|
data/webmention.gemspec
CHANGED
@@ -1,33 +1,34 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative 'lib/webmention/version'
|
4
|
-
|
5
3
|
Gem::Specification.new do |spec|
|
6
|
-
spec.required_ruby_version =
|
4
|
+
spec.required_ruby_version = ">= 2.7"
|
7
5
|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
6
|
+
spec.name = "webmention"
|
7
|
+
spec.version = "9.0.0"
|
8
|
+
spec.authors = ["Jason Garber"]
|
9
|
+
spec.email = ["jason@sixtwothree.org"]
|
12
10
|
|
13
|
-
spec.summary
|
14
|
-
spec.description
|
15
|
-
spec.homepage
|
16
|
-
spec.license
|
11
|
+
spec.summary = "A Ruby gem for sending and verifying Webmention notifications."
|
12
|
+
spec.description = spec.summary
|
13
|
+
spec.homepage = "https://github.com/indieweb/webmention-client-ruby"
|
14
|
+
spec.license = "Apache-2.0"
|
17
15
|
|
18
|
-
spec.files
|
19
|
-
spec.files
|
20
|
-
spec.files
|
16
|
+
spec.files = Dir["lib/**/*"].reject { |f| File.directory?(f) }
|
17
|
+
spec.files += ["LICENSE", "CHANGELOG.md", "CONTRIBUTING.md", "README.md", "USAGE.md"]
|
18
|
+
spec.files += ["webmention.gemspec"]
|
21
19
|
|
22
|
-
spec.require_paths = [
|
20
|
+
spec.require_paths = ["lib"]
|
23
21
|
|
24
22
|
spec.metadata = {
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
"bug_tracker_uri" => "#{spec.homepage}/issues",
|
24
|
+
"changelog_uri" => "#{spec.homepage}/releases/tag/v#{spec.version}",
|
25
|
+
"documentation_uri" => "https://rubydoc.info/gems/#{spec.name}/#{spec.version}",
|
26
|
+
"homepage_uri" => spec.homepage,
|
27
|
+
"rubygems_mfa_required" => "true",
|
28
|
+
"source_code_uri" => "#{spec.homepage}/tree/v#{spec.version}",
|
28
29
|
}
|
29
30
|
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
spec.
|
31
|
+
spec.add_dependency "http", "~> 5.3"
|
32
|
+
spec.add_dependency "indieweb-endpoints", "~> 10.0"
|
33
|
+
spec.add_dependency "nokogiri", ">= 1.14"
|
33
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmention
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 9.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: http
|
@@ -16,42 +15,42 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '5.
|
18
|
+
version: '5.3'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '5.
|
25
|
+
version: '5.3'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: indieweb-endpoints
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
32
|
+
version: '10.0'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
39
|
+
version: '10.0'
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: nokogiri
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
46
|
+
version: '1.14'
|
48
47
|
type: :runtime
|
49
48
|
prerelease: false
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
51
50
|
requirements:
|
52
51
|
- - ">="
|
53
52
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
53
|
+
version: '1.14'
|
55
54
|
description: A Ruby gem for sending and verifying Webmention notifications.
|
56
55
|
email:
|
57
56
|
- jason@sixtwothree.org
|
@@ -75,16 +74,17 @@ files:
|
|
75
74
|
- lib/webmention/response.rb
|
76
75
|
- lib/webmention/url.rb
|
77
76
|
- lib/webmention/verification.rb
|
78
|
-
- lib/webmention/version.rb
|
79
77
|
- webmention.gemspec
|
80
78
|
homepage: https://github.com/indieweb/webmention-client-ruby
|
81
79
|
licenses:
|
82
80
|
- Apache-2.0
|
83
81
|
metadata:
|
84
82
|
bug_tracker_uri: https://github.com/indieweb/webmention-client-ruby/issues
|
85
|
-
changelog_uri: https://github.com/indieweb/webmention-client-ruby/
|
83
|
+
changelog_uri: https://github.com/indieweb/webmention-client-ruby/releases/tag/v9.0.0
|
84
|
+
documentation_uri: https://rubydoc.info/gems/webmention/9.0.0
|
85
|
+
homepage_uri: https://github.com/indieweb/webmention-client-ruby
|
86
86
|
rubygems_mfa_required: 'true'
|
87
|
-
|
87
|
+
source_code_uri: https://github.com/indieweb/webmention-client-ruby/tree/v9.0.0
|
88
88
|
rdoc_options: []
|
89
89
|
require_paths:
|
90
90
|
- lib
|
@@ -93,17 +93,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '2.7'
|
96
|
-
- - "<"
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: '4'
|
99
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
97
|
requirements:
|
101
98
|
- - ">="
|
102
99
|
- !ruby/object:Gem::Version
|
103
100
|
version: '0'
|
104
101
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
106
|
-
signing_key:
|
102
|
+
rubygems_version: 3.6.9
|
107
103
|
specification_version: 4
|
108
|
-
summary: Webmention
|
104
|
+
summary: A Ruby gem for sending and verifying Webmention notifications.
|
109
105
|
test_files: []
|