jekyll-webmention_io 3.3.6 → 3.3.7

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: 020334fc76fba2718d1567fc7938e4b09d3f9612023f32be752f41b88ded0fd9
4
- data.tar.gz: bf9f07dd3cb7bc2fe266e92fab05f5122125fdf4012272e576d1095cf8a9cfde
3
+ metadata.gz: 92d94de0add9cc4571ce7b0f312cce727c3b387e645101f8c190e025c58be261
4
+ data.tar.gz: 8dbd9f8960c7c5c427c861fc08bc368a901e04b51267219fc1030b81b33b25e7
5
5
  SHA512:
6
- metadata.gz: 1876c839ad26beae83a09d2a41d066fcd2187d3914c2c5b3086a3582a878f0b90dd2f46a2929efb0cf51d71ef106cf3459a7016668d5b163a03d4e8e7c8be97e
7
- data.tar.gz: e33a2f9291ea21f7c83b8e558b8f0c3e7b2a179442b4675b7d46c00b3df8300e553b039451e5731455f2662f1875a85b34cd62ac63f8441f0c97072d497fd984
6
+ metadata.gz: 676aa2fd229c06d44f077f3eb7fb7f52deec8bad2f082b101fffb6379b66f35e90a1fcfe31d06539f4baeb77f6a5f7712aa5319d09c463fe5d2cf2c02e34974d
7
+ data.tar.gz: f73660974098440e3b658183dd9a9a10817d8fc010db197766e80678d43e4e295341adef6e057eee33c5acc5b06b1f3ce38f1bd1cbbad776199c64a95129147f
@@ -39,15 +39,19 @@ module Jekyll
39
39
  target = "http:#{target}"
40
40
  end
41
41
 
42
+ # produce an escaped version of the target (in case of special
43
+ # characters, etc).
44
+ escaped = URI::Parser.new.escape(target);
45
+
42
46
  # skip bad URLs
43
- next unless WebmentionIO.uri_ok?(target)
47
+ next unless WebmentionIO.uri_ok?(escaped)
44
48
 
45
49
  # get the endpoint
46
- endpoint = WebmentionIO.get_webmention_endpoint(target)
50
+ endpoint = WebmentionIO.get_webmention_endpoint(escaped)
47
51
  next unless endpoint
48
52
 
49
53
  # get the response
50
- response = WebmentionIO.webmention(source, target, endpoint)
54
+ response = WebmentionIO.webmention(source, target)
51
55
  next unless response
52
56
 
53
57
  # capture JSON responses in case site wants to do anything with them
@@ -72,7 +72,7 @@ module Jekyll
72
72
  if post.data["in_reply_to"]
73
73
  uris[post.data["in_reply_to"]] = false
74
74
  end
75
- post.content.scan(/(?:https?:)?\/\/[^\s)#\[\]{}<>%|\^"]+/) do |match|
75
+ post.content.scan(/(?:https?:)?\/\/[^\s)#\[\]{}<>%|\^"']+/) do |match|
76
76
  unless uris.key? match
77
77
  uris[match] = false
78
78
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module WebmentionIO
5
- VERSION = "3.3.6"
5
+ VERSION = "3.3.7"
6
6
  end
7
7
  end
@@ -16,6 +16,7 @@ require "net/http"
16
16
  require "uri"
17
17
  require "openssl"
18
18
  require "string_inflection"
19
+ require "indieweb/endpoints"
19
20
  require "webmention"
20
21
 
21
22
  module Jekyll
@@ -209,7 +210,7 @@ module Jekyll
209
210
  def self.get_webmention_endpoint(uri)
210
211
  # log "info", "Looking for webmention endpoint at #{uri}"
211
212
  begin
212
- endpoint = Webmention::Client.supports_webmention?(uri)
213
+ endpoint = IndieWeb::Endpoints.get(uri)[:webmention]
213
214
  unless endpoint
214
215
  log("info", "Could not find a webmention endpoint at #{uri}")
215
216
  uri_is_not_ok(uri)
@@ -222,16 +223,17 @@ module Jekyll
222
223
  endpoint
223
224
  end
224
225
 
225
- def self.webmention(source, target, endpoint)
226
+ def self.webmention(source, target)
226
227
  log "info", "Sending webmention of #{target} in #{source}"
227
228
  # return `curl -s -i -d \"source=#{source}&target=#{target}\" -o /dev/null #{endpoint}`
228
- mention = Webmention::Client.send_mention(endpoint, source, target, true)
229
- case mention.response
230
- when Net::HTTPOK, Net::HTTPCreated, Net::HTTPAccepted
229
+ response = Webmention.send_webmention(source, target)
230
+
231
+ case response.code
232
+ when 200, 201, 202
231
233
  log "info", "Webmention successful!"
232
- mention.response.body
234
+ response.body
233
235
  else
234
- log "info", mention.inspect
236
+ log "info", response.inspect
235
237
  log "info", "Webmention failed, but will remain queued for next time"
236
238
  false
237
239
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-webmention_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.6
4
+ version: 3.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Gustafson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-22 00:00:00.000000000 Z
11
+ date: 2023-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -48,16 +48,22 @@ dependencies:
48
48
  name: openssl
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '2.0'
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '4.0'
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
- - - "~>"
61
+ - - ">="
59
62
  - !ruby/object:Gem::Version
60
63
  version: '2.0'
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '4.0'
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: string_inflection
63
69
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +112,14 @@ dependencies:
106
112
  requirements:
107
113
  - - "~>"
108
114
  - !ruby/object:Gem::Version
109
- version: 0.1.6
115
+ version: '7.0'
110
116
  type: :runtime
111
117
  prerelease: false
112
118
  version_requirements: !ruby/object:Gem::Requirement
113
119
  requirements:
114
120
  - - "~>"
115
121
  - !ruby/object:Gem::Version
116
- version: 0.1.6
122
+ version: '7.0'
117
123
  - !ruby/object:Gem::Dependency
118
124
  name: bundler
119
125
  requirement: !ruby/object:Gem::Requirement
@@ -276,7 +282,7 @@ homepage: https://github.com/aarongustafson/jekyll-webmention_io
276
282
  licenses:
277
283
  - MIT
278
284
  metadata: {}
279
- post_install_message:
285
+ post_install_message:
280
286
  rdoc_options: []
281
287
  require_paths:
282
288
  - lib
@@ -291,8 +297,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
297
  - !ruby/object:Gem::Version
292
298
  version: '0'
293
299
  requirements: []
294
- rubygems_version: 3.0.3.1
295
- signing_key:
300
+ rubygems_version: 3.3.3
301
+ signing_key:
296
302
  specification_version: 4
297
303
  summary: A Jekyll plugin for sending & receiving webmentions via Webmention.io.
298
304
  test_files: []