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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 387888cbf5a1a801aad4b0d227ca65a1409368bbfeb531f49fd81419af4bfa90
4
- data.tar.gz: 2fc1836b5b4384de39d3a69d16d9ad2cc36b4d7aa77a93b14b644dbab59ae751
3
+ metadata.gz: 68b2e3b667fedde2265819a6c01a0b547b3a8503389a5209e2b9ce600b50945a
4
+ data.tar.gz: 622770cbe635b33de6125be189bf43a9cd23bbfff223f8897198862a463e6007
5
5
  SHA512:
6
- metadata.gz: 3ddb3194c1745c61a60820c06146ef0e0eb9fa87ab8c7d1a8eaba4d70d360f553915629534d93ab8785b1e33fab5ed2b526219c3dba1f8f953b72c9fb4ececc2
7
- data.tar.gz: b32cd9acc63647cc1b8548a4d23a029858f8897f8e34747be18451e040f938943090596903006716d564f1b6e74ac791cf788e36a4696244a70190a83634ddd4
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 [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._
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 2.7.6 and is additionally tested against Ruby 3.0 and 3.1 using [GitHub Actions](https://github.com/indieweb/webmention-client-ruby/actions).
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
- Before making changes to webmention-client-ruby, you'll want to install Ruby 2.7.6. 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.7.6 using your method of choice, install the project's gems by running:
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
- 1. Install development dependencies as outlined above.
23
- 1. Create a feature branch for the code changes you're looking to make: `git checkout -b my-new-feature`.
24
- 1. _Write some code!_
25
- 1. If your changes would benefit from testing, add the necessary tests and verify everything passes by running `bundle exec rspec`.
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
- 1. Push the branch to your fork: `git push -u origin my-new-feature`.
28
- 1. Create a new [pull request][pulls] and we'll review your changes.
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](http://editorconfig.org) syntax. There are [plugins for a variety of editors](http://editorconfig.org/#download) that utilize the settings in the `.editorconfig` file. We recommended you install the EditorConfig plugin for your editor of choice.
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
  [![Gem](https://img.shields.io/gem/v/webmention.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/webmention)
6
6
  [![Downloads](https://img.shields.io/gem/dt/webmention.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/webmention)
7
- [![Build](https://img.shields.io/github/workflow/status/indieweb/webmention-client-ruby/CI?logo=github&style=for-the-badge)](https://github.com/indieweb/webmention-client-ruby/actions/workflows/ci.yml)
8
- [![Maintainability](https://img.shields.io/codeclimate/maintainability/indieweb/webmention-client-ruby.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/indieweb/webmention-client-ruby)
9
- [![Coverage](https://img.shields.io/codeclimate/c/indieweb/webmention-client-ruby.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/indieweb/webmention-client-ruby/code)
7
+ [![Build](https://img.shields.io/github/actions/workflow/status/indieweb/webmention-client-ruby/ci.yml?branch=main&logo=github&style=for-the-badge)](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. 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).
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 2.7.6 and is additionally tested against Ruby 3.0 and 3.1 using [GitHub Actions](https://github.com/indieweb/webmention-client-ruby/actions).
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
- If you're using [Bundler](https://bundler.io) to manage gem dependencies, add webmention-client-ruby to your project's `Gemfile`:
25
+ Add webmention-client-ruby to your project's `Gemfile` and run `bundle install`:
27
26
 
28
27
  ```ruby
29
- gem 'webmention'
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
- ```sh
37
- gem install webmention
30
+ gem "webmention"
38
31
  ```
39
32
 
40
33
  ## Usage
41
34
 
42
- See [USAGE.md](https://github.com/indieweb/webmention-client-ruby/blob/main/USAGE.md) for documentation of webmention-client-ruby's features.
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
- Interested in helping improve webmention-client-ruby? Awesome! Your help is greatly appreciated. See [CONTRIBUTING.md](https://github.com/indieweb/webmention-client-ruby/blob/main/CONTRIBUTING.md) for details.
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
- Before using webmention-client-ruby, please read the [Getting Started](https://github.com/indieweb/webmention-client-ruby/blob/main/README.md#getting-started) and [Installation](https://github.com/indieweb/webmention-client-ruby/blob/main/README.md#installation) sections of the project's [README.md](https://github.com/indieweb/webmention-client-ruby/blob/main/README.md).
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 'webmention'
11
+ require "webmention"
11
12
 
12
- source = 'https://jgarber.example/post/100' # A post on your website
13
- target = 'https://aaronpk.example/post/100' # A post on someone else's website
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
- 💡 **Note:** `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`).
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 = 'https://jgarber.example/post/100'
65
- targets = ['https://aaronpk.example/notes/1', 'https://adactio.example/notes/1']
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: 'https://tantek.example/notes/1')
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: 'https://tantek.example/notes/1')
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('https://jgarber.example/post/100')
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
- 💡 **Note:** 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.
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: 'https://tantek.example/notes/1')
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
- 💡 **Note:** `Webmention.verify_webmention` parses HTML documents using the same rules outlined in [Discovering mentioned URLs](#discovering-mentioned-urls).
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.
@@ -9,10 +9,10 @@ module Webmention
9
9
  attr_reader :registered_parsers
10
10
  end
11
11
 
12
- # @return [Webmention::Url]
12
+ # @return [Url]
13
13
  attr_reader :source_url
14
14
 
15
- # @return [Webmention::Url]
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 Webmention::Client.
23
+ # Create a new {Client}.
24
24
  #
25
25
  # @example
26
- # Webmention::Client.new('https://jgarber.example/posts/100')
26
+ # Webmention::Client.new("https://jgarber.example/posts/100")
27
27
  #
28
28
  # @example
29
- # Webmention::Client.new('https://jgarber.example/posts/100', vouch: 'https://tantek.example/notes/1')
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('%#0x', object_id)} " \
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('https://jgarber.example/posts/100')
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 a Webmention::ErrorResponse or response is of an
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
- self.class
67
- .registered_parsers[response.mime_type]
68
- .new(response.body, response.uri)
69
- .results
70
- .uniq
71
- .reject { |url| url.match(/^#{response.uri}(?:#.*)?$/) }
72
- .sort
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('https://jgarber.example/posts/100')
79
- # client.send_webmention('https://aaronpk.example/notes/1')
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 [Webmention::Response, Webmention::ErrorResponse]
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('https://jgarber.example/posts/100')
104
- # targets = ['https://aaronpk.example/notes/1', 'https://adactio.example/notes/1']
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<Webmention::Response, Webmention::ErrorResponse>]
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 Webmention::Client#mentioned_urls)
121
+ # @raise (see Client#mentioned_urls)
121
122
  #
122
- # @return [Webmention::Verification]
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
- .delete_if { |_, value| value.empty? }
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 [Webmention::Request]
8
+ # @return [Request]
9
9
  attr_reader :request
10
10
 
11
- # Create a new Webmention::ErrorResponse.
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 <code>#message</code>
16
- # instance method.
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 [Webmention::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('%#0x', object_id)} " \
28
+ "#<#{self.class}:#{format("%#0x", object_id)} " \
31
29
  "message: #{message}>"
32
30
  end
33
31
  # :nocov:
@@ -3,7 +3,7 @@
3
3
  module Webmention
4
4
  # @api private
5
5
  class Parser
6
- URI_REGEXP = URI::DEFAULT_PARSER.make_regexp(%w[http https]).freeze
6
+ URI_REGEXP = URI::DEFAULT_PARSER.make_regexp(["http", "https"]).freeze
7
7
 
8
8
  public_constant :URI_REGEXP
9
9
 
@@ -4,24 +4,23 @@ module Webmention
4
4
  module Parsers
5
5
  # @api private
6
6
  class HtmlParser < Parser
7
- @mime_types = ['text/html']
7
+ @mime_types = ["text/html"]
8
8
 
9
9
  Client.register_parser(self)
10
10
 
11
11
  HTML_ATTRIBUTES_MAP = {
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]
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.flat_map do |attribute, names|
21
- names.map { |name| "#{name}[#{attribute}]" }
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 = ['.h-entry .e-content', '.h-entry', 'body'].freeze
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).map { |url| response_uri.join(url).to_s }
34
- .grep(Parser::URI_REGEXP)
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 == 'srcset'
50
- attribute.value.split(',').map { |value| value.strip.match(/^\S+/).to_s }
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).find_all { |attribute| HTML_ATTRIBUTES_MAP.key?(attribute.name) }
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,7 +4,7 @@ module Webmention
4
4
  module Parsers
5
5
  # @api private
6
6
  class JsonParser < Parser
7
- @mime_types = ['application/json']
7
+ @mime_types = ["application/json"]
8
8
 
9
9
  Client.register_parser(self)
10
10
 
@@ -4,13 +4,13 @@ module Webmention
4
4
  module Parsers
5
5
  # @api private
6
6
  class PlaintextParser < Parser
7
- @mime_types = ['text/plain']
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, %w[http https])
13
+ @results ||= URI::DEFAULT_PARSER.extract(response_body, ["http", "https"])
14
14
  end
15
15
  end
16
16
  end
@@ -2,20 +2,22 @@
2
2
 
3
3
  module Webmention
4
4
  class Request
5
- # Defaults derived from Webmention specification examples.
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: 'Webmention Client (https://rubygems.org/gems/webmention)'
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('https://jgarber.example/posts/100')
37
+ # Webmention::Request.get("https://jgarber.example/posts/100")
36
38
  #
37
39
  # @param url [String]
38
40
  #
39
- # @return [Webmention::Response, Webmention::ErrorResponse]
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
- # 'https://aaronpk.example/webmention',
49
- # source: 'https://jgarber.examples/posts/100',
50
- # target: 'https://aaronpk.example/notes/1',
51
- # vouch: 'https://tantek.example/notes/1'
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 [Webmention::Response, Webmention::ErrorResponse]
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 Webmention::Request.
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('%#0x', object_id)} " \
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 Webmention::Request.
91
+ # Submit the {Request}.
92
92
  #
93
- # @return [Webmention::Response, Webmention::ErrorResponse]
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
@@ -4,7 +4,7 @@ module Webmention
4
4
  class Response
5
5
  extend Forwardable
6
6
 
7
- # @return [Webmention::Request]
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 Webmention::Response.
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 <code>#code</code> and
38
- # <code>#reason</code>) instance methods.
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 [Webmention::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('%#0x', object_id)} " \
50
+ "#<#{self.class}:#{format("%#0x", object_id)} " \
53
51
  "code: #{code.inspect}, " \
54
52
  "reason: #{reason}, " \
55
53
  "url: #{request.uri}>"
@@ -11,11 +11,9 @@ module Webmention
11
11
  # @return [String]
12
12
  def_delegator :uri, :to_s
13
13
 
14
- # Create a new Webmention::Url.
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('%#0x', object_id)} " \
24
+ "#<#{self.class}:#{format("%#0x", object_id)} " \
27
25
  "uri: #{uri}>"
28
26
  end
29
27
  # :nocov:
30
28
 
31
- # @return [Webmention::Response, Webmention::ErrorResponse]
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).results[:webmention] if response.ok?
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
- # @param source_url [Webmention::Url]
6
- # @param target_url [Webmention::Url]
7
- # @param vouch_url [Webmention::Url]
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('%#0x', object_id)} " \
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 [Webmention::Url]
55
+ # @return [Url]
50
56
  attr_reader :source_url
51
57
 
52
- # @return [Webmention::Url]
58
+ # @return [Url]
53
59
  attr_reader :target_url
54
60
 
55
- # @return [Webmention::Url]
61
+ # @return [Url]
56
62
  attr_reader :vouch_url
57
63
 
58
- # @param response [Webmention::Response]
64
+ # @param response [Response]
59
65
  #
60
- # @raise (see Webmention::Client#mentioned_urls)
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 }.uniq
70
+ Set.new(mentioned_urls(response).map { |url| HTTP::URI.parse(url).host }).to_a
65
71
  end
66
72
 
67
- # @param response [Webmention::Response]
73
+ # @param response [Response]
68
74
  #
69
- # @raise (see Webmention::Client#mentioned_urls)
75
+ # @raise (see Client#mentioned_urls)
70
76
  #
71
77
  # @return [Array<String>]
72
78
  def mentioned_urls(response)
73
- Client.registered_parsers[response.mime_type]
74
- .new(response.body, response.uri)
75
- .results
76
- .uniq
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 'json'
3
+ require "json"
4
4
 
5
- require 'http'
6
- require 'indieweb/endpoints'
7
- require 'nokogiri'
5
+ require "http"
6
+ require "indieweb/endpoints"
7
+ require "nokogiri"
8
8
 
9
- require_relative 'webmention/version'
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 'webmention/client'
12
- require_relative 'webmention/url'
13
- require_relative 'webmention/request'
14
- require_relative 'webmention/response'
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('https://jgarber.example/posts/100')
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 a Webmention::ErrorResponse or response is of an
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 = 'https://jgarber.example/posts/100'
44
- # target = 'https://aaronpk.example/notes/1'
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 = 'https://jgarber.example/posts/100'
49
- # target = 'https://aaronpk.example/notes/1'
50
- # Webmention.send_webmention(source, target, vouch: 'https://tantek.example/notes/1')
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 [Webmention::Response, Webmention::ErrorResponse]
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 = 'https://jgarber.example/posts/100'
69
- # targets = ['https://aaronpk.example/notes/1', 'https://adactio.example/notes/1']
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 = 'https://jgarber.example/posts/100'
74
- # targets = ['https://aaronpk.example/notes/1', 'https://adactio.example/notes/1']
75
- # Webmention.send_webmentions(source, targets, vouch: 'https://tantek.example/notes/1')
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<Webmention::Response, Webmention::ErrorResponse>]
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 Webmention::Client#mentioned_urls)
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 = '>= 2.7', '< 4'
4
+ spec.required_ruby_version = ">= 2.7"
7
5
 
8
- spec.name = 'webmention'
9
- spec.version = Webmention::VERSION
10
- spec.authors = ['Jason Garber']
11
- spec.email = ['jason@sixtwothree.org']
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 = 'Webmention notification client'
14
- spec.description = 'A Ruby gem for sending and verifying Webmention notifications.'
15
- spec.homepage = 'https://github.com/indieweb/webmention-client-ruby'
16
- spec.license = 'Apache-2.0'
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 = Dir['lib/**/*'].reject { |f| File.directory?(f) }
19
- spec.files += %w[LICENSE CHANGELOG.md CONTRIBUTING.md README.md USAGE.md]
20
- spec.files += %w[webmention.gemspec]
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 = ['lib']
20
+ spec.require_paths = ["lib"]
23
21
 
24
22
  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'
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.add_runtime_dependency 'http', '~> 5.0'
31
- spec.add_runtime_dependency 'indieweb-endpoints', '~> 8.0'
32
- spec.add_runtime_dependency 'nokogiri', '>= 1.13'
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: 7.0.0
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: 2022-11-10 00:00:00.000000000 Z
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.0'
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.0'
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: '8.0'
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: '8.0'
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.13'
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.13'
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/blob/v7.0.0/CHANGELOG.md
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
- post_install_message:
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.3.16
106
- signing_key:
102
+ rubygems_version: 3.6.9
107
103
  specification_version: 4
108
- summary: Webmention notification client
104
+ summary: A Ruby gem for sending and verifying Webmention notifications.
109
105
  test_files: []
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Webmention
4
- VERSION = '7.0.0'
5
- end