indieweb-endpoints 10.1.0 → 10.3.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/.yardopts +5 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +10 -10
- data/indieweb-endpoints.gemspec +3 -3
- data/lib/indieweb/endpoints/client.rb +26 -40
- data/lib/indieweb/endpoints/exceptions.rb +4 -0
- data/lib/indieweb/endpoints/http.rb +75 -0
- data/lib/indieweb/endpoints/parser.rb +20 -23
- data/lib/indieweb/endpoints.rb +12 -4
- metadata +12 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea9b5e5a041478750b3af2f317436b40df1e360994107298737874aa914ad669
|
|
4
|
+
data.tar.gz: 3b2efbfeef50178c5a1583160483fa8a920d49f7a5d5bd82d81cfdcde8b995b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b01d5fe05e209cebc5859d70b954a3d3833e6e3859b3276d8914c8bc4d8e79ce75950c7866725c8f4082a4fbd6f5d5265e8b361a87c8493ba68a116a33cfe655
|
|
7
|
+
data.tar.gz: 1efbe90ec8d70b802b474904e58042f8284c11eaac41f717ce07d083146cb2af86ea863f06fdd9329a99965ad83474f73dab703826be09faf83d693c720e42c5
|
data/.yardopts
ADDED
data/CONTRIBUTING.md
CHANGED
|
@@ -8,12 +8,12 @@ There are a couple ways you can help improve indieweb-endpoints-ruby:
|
|
|
8
8
|
|
|
9
9
|
## Getting Started
|
|
10
10
|
|
|
11
|
-
indieweb-endpoints-ruby is developed using Ruby
|
|
11
|
+
indieweb-endpoints-ruby is developed using Ruby 4.0 and is tested against additional Ruby versions using [GitHub Actions](https://github.com/indieweb/indieweb-endpoints-ruby/actions).
|
|
12
12
|
|
|
13
13
|
> [!TIP]
|
|
14
14
|
> This project is configured with a [Dev Container](https://containers.dev) which includes everything you'd need to contribute to indieweb-endpoints-ruby. If you use a supported code editor or IDE, you're encouraged to use the existing Dev Container setup.
|
|
15
15
|
|
|
16
|
-
Before making changes to indieweb-endpoints-ruby, you'll want to install Ruby
|
|
16
|
+
Before making changes to indieweb-endpoints-ruby, you'll want to install Ruby 4.0. Using a Ruby version managment tool like [rv](https://github.com/spinel-coop/rv) or [rbenv](https://github.com/rbenv/rbenv) is recommended. Once you've installed Ruby 4.0 using your method of choice, install the project's gems by running:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
19
|
bundle install
|
data/README.md
CHANGED
|
@@ -14,9 +14,9 @@ A Ruby gem for discovering a URL's [IndieAuth](https://indieweb.org/IndieAuth),
|
|
|
14
14
|
|
|
15
15
|
## Getting Started
|
|
16
16
|
|
|
17
|
-
Before installing and using indieweb-endpoints-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed. Using a Ruby version managment tool like [
|
|
17
|
+
Before installing and using indieweb-endpoints-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed. Using a Ruby version managment tool like [rv](https://github.com/spinel-coop/rv) or [rbenv](https://github.com/rbenv/rbenv) is recommended.
|
|
18
18
|
|
|
19
|
-
indieweb-endpoints-ruby is developed using Ruby
|
|
19
|
+
indieweb-endpoints-ruby is developed using Ruby 4.0 and is tested against additional Ruby versions using [GitHub Actions](https://github.com/indieweb/indieweb-endpoints-ruby/actions).
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
@@ -37,11 +37,11 @@ With indieweb-endpoints-ruby added to your project's `Gemfile` and installed, yo
|
|
|
37
37
|
```ruby
|
|
38
38
|
require "indieweb/endpoints"
|
|
39
39
|
|
|
40
|
-
IndieWeb::Endpoints.get("https://
|
|
41
|
-
#=> { authorization_endpoint: "https://
|
|
40
|
+
IndieWeb::Endpoints.get("https://adactio.com")
|
|
41
|
+
#=> { authorization_endpoint: "https://indieauth.com/auth", "indieauth-metadata": nil, micropub: "https://adactio.com/micropub", microsub: "https://aperture.p3k.io/microsub/152", redirect_uri: nil, token_endpoint: "https://tokens.indieauth.com/token", webmention: "https://adactio.com/webmention"}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
This example will search [
|
|
44
|
+
This example will search [Jeremy's website](https://adactio.com) for valid IndieAuth, Micropub, and Webmention endpoints and return a `Hash` of results. Each key in the returned `Hash` will have a value of either a `String` representing a URL or `nil`. The `redirect_uri` key's value will be either an `Array` or `nil` since a given URL may register multiple callback URLs.
|
|
45
45
|
|
|
46
46
|
### Advanced Usage
|
|
47
47
|
|
|
@@ -50,27 +50,27 @@ Should the need arise, you may work with the `IndieWeb::Endpoints::Client` class
|
|
|
50
50
|
```ruby
|
|
51
51
|
require "indieweb/endpoints"
|
|
52
52
|
|
|
53
|
-
client = IndieWeb::Endpoints::Client.new("https://
|
|
54
|
-
#=> #<IndieWeb::Endpoints::Client uri:
|
|
53
|
+
client = IndieWeb::Endpoints::Client.new("https://adactio.com")
|
|
54
|
+
#=> #<IndieWeb::Endpoints::Client @uri: Addressable::URI URI:https://adactio.com>>
|
|
55
55
|
|
|
56
56
|
client.response
|
|
57
57
|
#=> #<HTTP::Response/1.1 200 OK {…}>
|
|
58
58
|
|
|
59
59
|
client.endpoints
|
|
60
|
-
#=> { authorization_endpoint: "https://
|
|
60
|
+
#=> { authorization_endpoint: "https://indieauth.com/auth", "indieauth-metadata": nil, micropub: "https://adactio.com/micropub", microsub: "https://aperture.p3k.io/microsub/152", redirect_uri: nil, token_endpoint: "https://tokens.indieauth.com/token", webmention: "https://adactio.com/webmention"}
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### Exception Handling
|
|
64
64
|
|
|
65
65
|
indieweb-endpoints-ruby may raise the following exceptions which are subclasses of `IndieWeb::Endpoints::Error` (which itself is a subclass of `StandardError`).
|
|
66
66
|
|
|
67
|
-
- `IndieWeb::Endpoints::InvalidURIError`
|
|
68
67
|
- `IndieWeb::Endpoints::HttpError`
|
|
68
|
+
- `IndieWeb::Endpoints::InvalidURIError`
|
|
69
69
|
- `IndieWeb::Endpoints::SSLError`
|
|
70
70
|
|
|
71
71
|
## Contributing
|
|
72
72
|
|
|
73
|
-
See [CONTRIBUTING.md](
|
|
73
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for more on how to contribute to indieweb-endpoints-ruby. Your help is greatly appreciated!
|
|
74
74
|
|
|
75
75
|
By contributing to and participating in the development of indieweb-endpoints-ruby, you acknowledge that you have read and agree to the [IndieWeb Code of Conduct](https://indieweb.org/code-of-conduct).
|
|
76
76
|
|
data/indieweb-endpoints.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
|
|
|
4
4
|
spec.required_ruby_version = ">= 2.7"
|
|
5
5
|
|
|
6
6
|
spec.name = "indieweb-endpoints"
|
|
7
|
-
spec.version = "10.
|
|
7
|
+
spec.version = "10.3.0"
|
|
8
8
|
spec.authors = ["Jason Garber"]
|
|
9
9
|
spec.email = ["jason@sixtwothree.org"]
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
|
|
16
16
|
spec.files = Dir["lib/**/*"].reject { |f| File.directory?(f) }
|
|
17
|
-
spec.files += ["LICENSE", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "README.md"]
|
|
17
|
+
spec.files += [".yardopts", "LICENSE", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "README.md"]
|
|
18
18
|
spec.files += ["indieweb-endpoints.gemspec"]
|
|
19
19
|
|
|
20
20
|
spec.require_paths = ["lib"]
|
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
"source_code_uri" => "#{spec.homepage}/tree/v#{spec.version}",
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
spec.add_dependency "
|
|
31
|
+
spec.add_dependency "addressable", "~> 2.9"
|
|
32
32
|
spec.add_dependency "link-header-parser", "~> 7.0", ">= 7.0.1"
|
|
33
33
|
spec.add_dependency "nokogiri-html-ext", "~> 1.7"
|
|
34
34
|
end
|
|
@@ -2,64 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
module IndieWeb
|
|
4
4
|
module Endpoints
|
|
5
|
+
# A client interface to parse IndieWeb endpoints from a URL.
|
|
5
6
|
class Client
|
|
6
|
-
# Create a new
|
|
7
|
+
# Create a new {Client} to parse a URL for IndieWeb endpoints.
|
|
7
8
|
#
|
|
8
9
|
# @example
|
|
9
|
-
#
|
|
10
|
+
# IndieWeb::Endpoints::Client.new("https://adactio.com")
|
|
10
11
|
#
|
|
11
|
-
# @param url [String,
|
|
12
|
-
#
|
|
13
|
-
# @raise [InvalidURIError]
|
|
12
|
+
# @param url [String, #to_s] An absolute URL.
|
|
14
13
|
def initialize(url)
|
|
15
|
-
@
|
|
16
|
-
rescue Addressable::URI::InvalidURIError, HTTP::URI::InvalidError => e
|
|
17
|
-
raise InvalidURIError, e
|
|
14
|
+
@url = url
|
|
18
15
|
end
|
|
19
16
|
|
|
20
|
-
#
|
|
21
|
-
#
|
|
17
|
+
# @!visibility private
|
|
18
|
+
# simplecov:disable
|
|
22
19
|
def inspect
|
|
23
|
-
format
|
|
24
|
-
class: self.class,
|
|
25
|
-
id: object_id << 1,
|
|
26
|
-
uri: uri.inspect
|
|
20
|
+
"#<#{self.class}:#{format("%#0x", object_id)} @url: #{@url}>"
|
|
27
21
|
end
|
|
28
|
-
# :
|
|
22
|
+
# simplecov:enable
|
|
29
23
|
|
|
30
|
-
#
|
|
24
|
+
# The IndieWeb endpoints advertised by the provided URL.
|
|
25
|
+
#
|
|
26
|
+
# @example
|
|
27
|
+
# IndieWeb::Endpoints::Client.new("https://adactio.com").endpoints
|
|
28
|
+
#
|
|
29
|
+
# @raise (see #response)
|
|
31
30
|
#
|
|
32
31
|
# @return [Hash{Symbol => String, Array, nil}]
|
|
33
32
|
def endpoints
|
|
34
|
-
@endpoints ||=
|
|
33
|
+
@endpoints ||=
|
|
34
|
+
Parser.new(
|
|
35
|
+
body: response.body,
|
|
36
|
+
headers: response.fetch("link", []),
|
|
37
|
+
mime_type: response.content_type,
|
|
38
|
+
uri: response.uri
|
|
39
|
+
).to_h
|
|
35
40
|
end
|
|
36
41
|
|
|
37
|
-
# The
|
|
42
|
+
# The `Net::HTTPResponse` for the provided URL.
|
|
38
43
|
#
|
|
39
|
-
# @
|
|
44
|
+
# @raise (see HTTP#get)
|
|
40
45
|
#
|
|
41
|
-
# @
|
|
46
|
+
# @return (see HTTP#get)
|
|
42
47
|
def response
|
|
43
|
-
@response ||=
|
|
44
|
-
HTTP
|
|
45
|
-
.follow(max_hops: 20)
|
|
46
|
-
.headers(accept: "*/*", user_agent: user_agent)
|
|
47
|
-
.timeout(connect: 5, read: 5)
|
|
48
|
-
.get(uri)
|
|
49
|
-
rescue HTTP::Error => e
|
|
50
|
-
raise HttpError, e
|
|
51
|
-
rescue OpenSSL::SSL::SSLError => e
|
|
52
|
-
raise SSLError, e
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
private
|
|
56
|
-
|
|
57
|
-
# @return [HTTP::URI]
|
|
58
|
-
attr_reader :uri
|
|
59
|
-
|
|
60
|
-
# @return [String]
|
|
61
|
-
def user_agent
|
|
62
|
-
"Mozilla/5.0 (compatible; IndieWebEndpointsDiscovery/1.0; +https://rubygems.org/gems/indieweb-endpoints)"
|
|
48
|
+
@response ||= HTTP.new(@url).fetch
|
|
63
49
|
end
|
|
64
50
|
end
|
|
65
51
|
end
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
module IndieWeb
|
|
4
4
|
module Endpoints
|
|
5
|
+
# Base error class.
|
|
5
6
|
class Error < StandardError; end
|
|
6
7
|
|
|
8
|
+
# Re-raises rescued exceptions originating from `Net::HTTP` responses.
|
|
7
9
|
class HttpError < Error; end
|
|
8
10
|
|
|
11
|
+
# Re-raises rescued `Addressable::URI::InvalidURIError`.
|
|
9
12
|
class InvalidURIError < Error; end
|
|
10
13
|
|
|
14
|
+
# Re-raises rescued `OpenSSL::OpenSSLError`.
|
|
11
15
|
class SSLError < Error; end
|
|
12
16
|
end
|
|
13
17
|
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IndieWeb
|
|
4
|
+
module Endpoints
|
|
5
|
+
# A simple HTTP client to fetch a URL.
|
|
6
|
+
#
|
|
7
|
+
# @api private
|
|
8
|
+
#
|
|
9
|
+
# HTTP client defaults are derived from Webmention specification.
|
|
10
|
+
#
|
|
11
|
+
# @see https://www.w3.org/TR/webmention/#limits-on-get-requests
|
|
12
|
+
# W3C Webmention Recommendation § 4.2 Limits on GET requests
|
|
13
|
+
class HTTP
|
|
14
|
+
HTTP_CLIENT_OPTS = {
|
|
15
|
+
open_timeout: 5,
|
|
16
|
+
read_timeout: 5,
|
|
17
|
+
ssl_timeout: 5,
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
HTTP_MAX_REDIRECTS = 20
|
|
21
|
+
|
|
22
|
+
HTTP_REQUEST_HEADERS = {
|
|
23
|
+
"accept" => "*/*",
|
|
24
|
+
"user-agent" => "Mozilla/5.0 (compatible; IndieWebEndpointsDiscovery/1.0; +https://rubygems.org/gems/indieweb-endpoints)",
|
|
25
|
+
}.freeze
|
|
26
|
+
|
|
27
|
+
private_constant :HTTP_CLIENT_OPTS
|
|
28
|
+
private_constant :HTTP_MAX_REDIRECTS
|
|
29
|
+
private_constant :HTTP_REQUEST_HEADERS
|
|
30
|
+
|
|
31
|
+
# @param uri [Addressable::URI]
|
|
32
|
+
def initialize(uri)
|
|
33
|
+
@redirects = 0
|
|
34
|
+
@uri = uri
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @param uri [Addressable::URI, URI, String] An absolute URL.
|
|
38
|
+
#
|
|
39
|
+
# @raise [HttpError, InvalidURIError, SSLError]
|
|
40
|
+
#
|
|
41
|
+
# @return [Net::HTTPResponse]
|
|
42
|
+
def fetch(uri = @uri)
|
|
43
|
+
raise if @redirects > HTTP_MAX_REDIRECTS
|
|
44
|
+
|
|
45
|
+
make_request(Addressable::URI.parse(uri).normalize!)
|
|
46
|
+
rescue Addressable::URI::InvalidURIError => e
|
|
47
|
+
raise InvalidURIError, e
|
|
48
|
+
rescue OpenSSL::OpenSSLError => e
|
|
49
|
+
raise SSLError, e
|
|
50
|
+
rescue StandardError => e
|
|
51
|
+
raise HttpError, e
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
def handle_response(response)
|
|
57
|
+
case response
|
|
58
|
+
when Net::HTTPRedirection
|
|
59
|
+
@redirects += 1
|
|
60
|
+
fetch(response.uri.merge(response.fetch("location")))
|
|
61
|
+
when Net::HTTPSuccess
|
|
62
|
+
response
|
|
63
|
+
else
|
|
64
|
+
response.value
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def make_request(uri)
|
|
69
|
+
Net::HTTP.start(uri.host, use_ssl: uri.scheme == "https", **HTTP_CLIENT_OPTS) do |http|
|
|
70
|
+
handle_response(http.get(URI.parse(uri), HTTP_REQUEST_HEADERS))
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -2,19 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
module IndieWeb
|
|
4
4
|
module Endpoints
|
|
5
|
-
#
|
|
5
|
+
# A parser for extracting IndieWeb endpoints from an HTTP response's headers
|
|
6
|
+
# and body.
|
|
6
7
|
class Parser
|
|
7
|
-
# @param
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
# @param body [String, #to_s]
|
|
9
|
+
# @param headers [Array<String>]
|
|
10
|
+
# @param mime_type [String, #to_s]
|
|
11
|
+
# @param uri [Addressable::URI, URI, #to_s]
|
|
12
|
+
def initialize(body: "", headers: [], mime_type: "text/html", uri: "")
|
|
13
|
+
@body = Nokogiri::HTML5(body.to_s, uri.to_s).resolve_urls!
|
|
14
|
+
@headers = LinkHeaderParser.parse(Array(headers), base_uri: uri).group_by_relation_type
|
|
15
|
+
@mime_type = mime_type.to_s
|
|
10
16
|
end
|
|
11
17
|
|
|
12
18
|
# @param identifier [String]
|
|
13
19
|
# @param node_names [Array<String>]
|
|
14
20
|
#
|
|
15
|
-
# @return [Array<String>]
|
|
16
|
-
#
|
|
17
21
|
# @raise [InvalidURIError]
|
|
22
|
+
#
|
|
23
|
+
# @return [Array<String>]
|
|
18
24
|
def matches(identifier, node_names: ["link"])
|
|
19
25
|
results = (matches_from_headers(identifier) + matches_from_body(identifier, node_names)).compact
|
|
20
26
|
|
|
@@ -46,19 +52,6 @@ module IndieWeb
|
|
|
46
52
|
|
|
47
53
|
private
|
|
48
54
|
|
|
49
|
-
# @return [HTTP::Response]
|
|
50
|
-
attr_reader :response
|
|
51
|
-
|
|
52
|
-
# @return [Nokogiri::HTML5::Document]
|
|
53
|
-
def body
|
|
54
|
-
@body ||= Nokogiri::HTML5(response.body, response.uri.to_s).resolve_urls!
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
# @return [Hash{Symbol => Array<LinkHeaderParser::LinkHeader>}]
|
|
58
|
-
def headers
|
|
59
|
-
@headers ||= LinkHeaderParser.parse(response.headers.get("link"), base_uri: response.uri).group_by_relation_type
|
|
60
|
-
end
|
|
61
|
-
|
|
62
55
|
# Reject URLs with fragment identifiers per the IndieAuth specification.
|
|
63
56
|
#
|
|
64
57
|
# @param identifier [String, #to_s]
|
|
@@ -66,9 +59,9 @@ module IndieWeb
|
|
|
66
59
|
#
|
|
67
60
|
# @return [Array<String>]
|
|
68
61
|
def matches_from_body(identifier, node_names)
|
|
69
|
-
return [] unless
|
|
62
|
+
return [] unless @mime_type == "text/html"
|
|
70
63
|
|
|
71
|
-
body
|
|
64
|
+
@body
|
|
72
65
|
.css(*node_names.map { |node| %(#{node}[rel~="#{identifier}"][href]:not([href*="#"]) / @href) })
|
|
73
66
|
.map(&:value)
|
|
74
67
|
end
|
|
@@ -77,11 +70,15 @@ module IndieWeb
|
|
|
77
70
|
#
|
|
78
71
|
# @param identifier [String, #to_sym]
|
|
79
72
|
#
|
|
73
|
+
# @raise [InvalidURIError]
|
|
74
|
+
#
|
|
80
75
|
# @return [Array<String>]
|
|
81
76
|
def matches_from_headers(identifier)
|
|
82
|
-
Array(headers[identifier]).filter_map do |header|
|
|
83
|
-
header.target_uri unless
|
|
77
|
+
Array(@headers[identifier]).filter_map do |header|
|
|
78
|
+
header.target_uri unless Addressable::URI.parse(header.target_uri).fragment
|
|
84
79
|
end
|
|
80
|
+
rescue Addressable::URI::InvalidURIError => e
|
|
81
|
+
raise InvalidURIError, e
|
|
85
82
|
end
|
|
86
83
|
end
|
|
87
84
|
end
|
data/lib/indieweb/endpoints.rb
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "http"
|
|
3
|
+
require "net/http"
|
|
4
|
+
|
|
5
|
+
require "addressable"
|
|
4
6
|
require "link-header-parser"
|
|
5
7
|
require "nokogiri/html-ext"
|
|
6
8
|
|
|
7
|
-
require_relative "endpoints/exceptions"
|
|
8
|
-
|
|
9
9
|
require_relative "endpoints/client"
|
|
10
|
+
require_relative "endpoints/exceptions"
|
|
11
|
+
require_relative "endpoints/http"
|
|
10
12
|
require_relative "endpoints/parser"
|
|
11
13
|
|
|
14
|
+
# Welcome to the IndieWeb, a people-focused alternative to the "corporate web."
|
|
15
|
+
#
|
|
16
|
+
# @see https://indieweb.org
|
|
12
17
|
module IndieWeb
|
|
18
|
+
# @see https://indieweb.org/endpoint
|
|
13
19
|
module Endpoints
|
|
14
20
|
# Discover a URL's IndieAuth, Micropub, Microsub, and Webmention endpoints.
|
|
15
21
|
#
|
|
16
22
|
# Convenience method for {Client#endpoints}.
|
|
17
23
|
#
|
|
18
24
|
# @example
|
|
19
|
-
# IndieWeb::Endpoints.get("https://
|
|
25
|
+
# IndieWeb::Endpoints.get("https://adactio.com")
|
|
20
26
|
#
|
|
21
27
|
# @param (see Client#initialize)
|
|
22
28
|
#
|
|
29
|
+
# @raise (see Client#endpoints)
|
|
30
|
+
#
|
|
23
31
|
# @return (see Client#endpoints)
|
|
24
32
|
def self.get(url)
|
|
25
33
|
Client.new(url).endpoints
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: indieweb-endpoints
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 10.
|
|
4
|
+
version: 10.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Garber
|
|
@@ -10,19 +10,19 @@ cert_chain: []
|
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name:
|
|
13
|
+
name: addressable
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '2.9'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
|
-
- - "
|
|
23
|
+
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '2.9'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: link-header-parser
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -64,6 +64,7 @@ executables: []
|
|
|
64
64
|
extensions: []
|
|
65
65
|
extra_rdoc_files: []
|
|
66
66
|
files:
|
|
67
|
+
- ".yardopts"
|
|
67
68
|
- CHANGELOG.md
|
|
68
69
|
- CODE_OF_CONDUCT.md
|
|
69
70
|
- CONTRIBUTING.md
|
|
@@ -73,17 +74,18 @@ files:
|
|
|
73
74
|
- lib/indieweb/endpoints.rb
|
|
74
75
|
- lib/indieweb/endpoints/client.rb
|
|
75
76
|
- lib/indieweb/endpoints/exceptions.rb
|
|
77
|
+
- lib/indieweb/endpoints/http.rb
|
|
76
78
|
- lib/indieweb/endpoints/parser.rb
|
|
77
79
|
homepage: https://github.com/indieweb/indieweb-endpoints-ruby
|
|
78
80
|
licenses:
|
|
79
81
|
- MIT
|
|
80
82
|
metadata:
|
|
81
83
|
bug_tracker_uri: https://github.com/indieweb/indieweb-endpoints-ruby/issues
|
|
82
|
-
changelog_uri: https://github.com/indieweb/indieweb-endpoints-ruby/releases/tag/v10.
|
|
83
|
-
documentation_uri: https://rubydoc.info/gems/indieweb-endpoints/10.
|
|
84
|
+
changelog_uri: https://github.com/indieweb/indieweb-endpoints-ruby/releases/tag/v10.3.0
|
|
85
|
+
documentation_uri: https://rubydoc.info/gems/indieweb-endpoints/10.3.0
|
|
84
86
|
homepage_uri: https://github.com/indieweb/indieweb-endpoints-ruby
|
|
85
87
|
rubygems_mfa_required: 'true'
|
|
86
|
-
source_code_uri: https://github.com/indieweb/indieweb-endpoints-ruby/tree/v10.
|
|
88
|
+
source_code_uri: https://github.com/indieweb/indieweb-endpoints-ruby/tree/v10.3.0
|
|
87
89
|
rdoc_options: []
|
|
88
90
|
require_paths:
|
|
89
91
|
- lib
|
|
@@ -98,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
98
100
|
- !ruby/object:Gem::Version
|
|
99
101
|
version: '0'
|
|
100
102
|
requirements: []
|
|
101
|
-
rubygems_version: 4.0.
|
|
103
|
+
rubygems_version: 4.0.20
|
|
102
104
|
specification_version: 4
|
|
103
105
|
summary: Discover a URL’s IndieAuth, Micropub, Microsub, and Webmention endpoints.
|
|
104
106
|
test_files: []
|