webmention-cli 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +4 -14
- data/exe/webmention +2 -2
- data/lib/webmention/cli/runner.rb +9 -9
- data/lib/webmention/cli/version.rb +1 -1
- data/lib/webmention/cli.rb +5 -4
- data/webmention-cli.gemspec +18 -18
- metadata +9 -13
- data/CONTRIBUTING.md +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adf698b6264dfd85238169735736d3bd0f2116fb010310e6f56688dc79e0ade4
|
4
|
+
data.tar.gz: bea659bb79b192d4faa6751c3d141ed56ab1bb1e4bebbeefc5d6f22da1958b60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2168ce58e9ed1e894c742faffa6cf216659d3e7e6c69cbd634ed888ad0db748dcf4c9902b322c9573de8509731743bb41c0f3a94a1b25af87bba96a647b0b61d
|
7
|
+
data.tar.gz: 2f3794784624266b1c90a1af08a30d9e415a02620ff78db5279868bf85696e7092edbb5366e163fb0137a2ba8aa7d954a3046f009bafa0cef0c2543ce46596ee
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.0.0 / 2023-12-12
|
4
|
+
|
5
|
+
- **Breaking change:** Update Thor and Webmention dependencies (#90) (b89a756)
|
6
|
+
- Address RuboCop warnings (#89) (9a405bf)
|
7
|
+
- Code cleanup (#88) (445984f)
|
8
|
+
- **Breaking change:** Update Ruby versions (#87) (8a36cd3)
|
9
|
+
- Development: 2.7.8
|
10
|
+
- Minimum supported: 2.7
|
11
|
+
|
3
12
|
## 2.0.0 / 2022-05-20
|
4
13
|
|
5
14
|
- **Breaking change:** Rewrite gem code (35e9442)
|
data/README.md
CHANGED
@@ -4,20 +4,14 @@
|
|
4
4
|
|
5
5
|
[![Gem](https://img.shields.io/gem/v/webmention-cli.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/webmention-cli)
|
6
6
|
[![Downloads](https://img.shields.io/gem/dt/webmention-cli.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/webmention-cli)
|
7
|
-
[![Build](https://img.shields.io/github/workflow/status/jgarber623/webmention-cli/
|
8
|
-
[![Maintainability](https://img.shields.io/codeclimate/maintainability/jgarber623/webmention-cli.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/jgarber623/webmention-cli)
|
9
|
-
[![Coverage](https://img.shields.io/codeclimate/c/jgarber623/webmention-cli.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/jgarber623/webmention-cli/code)
|
10
|
-
|
11
|
-
## Getting Started
|
12
|
-
|
13
|
-
Before installing and using webmention-cli, you'll want to have [Ruby](https://www.ruby-lang.org) 2.6 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
|
14
|
-
|
15
|
-
webmention-cli is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/jgarber623/webmention-cli/actions).
|
7
|
+
[![Build](https://img.shields.io/github/actions/workflow/status/jgarber623/webmention-cli/ci.yml?branch=main&logo=github&style=for-the-badge)](https://github.com/jgarber623/webmention-cli/actions/workflows/ci.yml)
|
16
8
|
|
17
9
|
## Installation
|
18
10
|
|
11
|
+
Before installing and using webmention-cli, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed.
|
12
|
+
|
19
13
|
```sh
|
20
|
-
gem install webmention-cli
|
14
|
+
$ gem install webmention-cli
|
21
15
|
```
|
22
16
|
|
23
17
|
## Usage
|
@@ -75,10 +69,6 @@ $ webmention verify https://kartikprabhu.com/notes/re-launching-franciscms https
|
|
75
69
|
|
76
70
|
The command will return a zero exit code if `<source>` links to `<target>` _and_ the provided vouch URL links to the `<source>`'s domain. A non-zero exist code is returned in all other cases.
|
77
71
|
|
78
|
-
## Contributing
|
79
|
-
|
80
|
-
Interested in helping improve webmention-cli? Awesome! Your help is greatly appreciated. See [CONTRIBUTING.md](https://github.com/jgarber623/webmention-cli/blob/main/CONTRIBUTING.md) for details.
|
81
|
-
|
82
72
|
## Acknowledgments
|
83
73
|
|
84
74
|
webmention-cli wouldn't exist without Webmention and the hard work put in by everyone involved in the [IndieWeb](https://indieweb.org) movement.
|
data/exe/webmention
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
lib = File.expand_path(
|
4
|
+
lib = File.expand_path("../lib", __dir__)
|
5
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
6
|
|
7
|
-
require
|
7
|
+
require "webmention/cli"
|
8
8
|
|
9
9
|
Webmention::CLI::Runner.start
|
@@ -5,9 +5,9 @@ module Webmention
|
|
5
5
|
class Runner < Thor
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
|
-
package_name
|
8
|
+
package_name "Webmention"
|
9
9
|
|
10
|
-
map [
|
10
|
+
map ["-v", "--version"] => :version
|
11
11
|
|
12
12
|
# :nocov:
|
13
13
|
def self.exit_on_failure?
|
@@ -15,7 +15,7 @@ module Webmention
|
|
15
15
|
end
|
16
16
|
# :nocov:
|
17
17
|
|
18
|
-
desc
|
18
|
+
desc "endpoint <target>", "Discover the Webmention endpoint for <target> URL"
|
19
19
|
def endpoint(target)
|
20
20
|
url = Webmention::Url.new(target)
|
21
21
|
|
@@ -24,30 +24,30 @@ module Webmention
|
|
24
24
|
say url.webmention_endpoint
|
25
25
|
end
|
26
26
|
|
27
|
-
desc
|
28
|
-
option :vouch, desc:
|
27
|
+
desc "send <source> <target>", "Send a webmention from <source> URL to <target> URL"
|
28
|
+
option :vouch, desc: "Submit a <vouch> URL"
|
29
29
|
def send(source, target)
|
30
30
|
response = Webmention.send_webmention(source, target, vouch: options[:vouch])
|
31
31
|
|
32
32
|
exit 1 unless response.ok?
|
33
33
|
|
34
34
|
code = response.code
|
35
|
-
location = response.headers[
|
35
|
+
location = response.headers["Location"]
|
36
36
|
|
37
37
|
say(code == 201 && location ? location : "#{code} #{response.reason}")
|
38
38
|
|
39
39
|
exit 1 unless code.between?(200, 299)
|
40
40
|
end
|
41
41
|
|
42
|
-
desc
|
43
|
-
option :vouch, desc:
|
42
|
+
desc "verify <source> <target>", "Verify that <source> URL links to <target> URL"
|
43
|
+
option :vouch, desc: "Verify that <vouch> URL mentions the <source> URL domain"
|
44
44
|
def verify(source, target)
|
45
45
|
verification = Webmention.verify_webmention(source, target, vouch: options[:vouch])
|
46
46
|
|
47
47
|
exit 1 unless verification.verified?
|
48
48
|
end
|
49
49
|
|
50
|
-
desc
|
50
|
+
desc "version", "Print version information"
|
51
51
|
def version
|
52
52
|
say "webmention-cli version #{Webmention::CLI::VERSION}"
|
53
53
|
end
|
data/lib/webmention/cli.rb
CHANGED
data/webmention-cli.gemspec
CHANGED
@@ -1,34 +1,34 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "lib/webmention/cli/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.required_ruby_version =
|
6
|
+
spec.required_ruby_version = ">= 2.7"
|
7
7
|
|
8
|
-
spec.name =
|
8
|
+
spec.name = "webmention-cli"
|
9
9
|
spec.version = Webmention::CLI::VERSION
|
10
|
-
spec.authors = [
|
11
|
-
spec.email = [
|
10
|
+
spec.authors = ["Jason Garber"]
|
11
|
+
spec.email = ["jason@sixtwothree.org"]
|
12
12
|
|
13
|
-
spec.summary =
|
13
|
+
spec.summary = "A command-line interface for Webmention."
|
14
14
|
spec.description = spec.summary
|
15
|
-
spec.homepage =
|
16
|
-
spec.license =
|
15
|
+
spec.homepage = "https://github.com/jgarber623/webmention-cli"
|
16
|
+
spec.license = "MIT"
|
17
17
|
|
18
|
-
spec.files = Dir[
|
19
|
-
spec.files += %w[LICENSE CHANGELOG.md
|
18
|
+
spec.files = Dir["lib/**/*"].reject { |f| File.directory?(f) }
|
19
|
+
spec.files += %w[LICENSE CHANGELOG.md README.md]
|
20
20
|
spec.files += %w[webmention-cli.gemspec]
|
21
21
|
|
22
|
-
spec.bindir =
|
23
|
-
spec.executables = [
|
24
|
-
spec.require_paths = [
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = ["webmention"]
|
24
|
+
spec.require_paths = ["lib"]
|
25
25
|
|
26
26
|
spec.metadata = {
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
"bug_tracker_uri" => "#{spec.homepage}/issues",
|
28
|
+
"changelog_uri" => "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md",
|
29
|
+
"rubygems_mfa_required" => "true"
|
30
30
|
}
|
31
31
|
|
32
|
-
spec.add_runtime_dependency
|
33
|
-
spec.add_runtime_dependency
|
32
|
+
spec.add_runtime_dependency "thor", "~> 1.3"
|
33
|
+
spec.add_runtime_dependency "webmention", "~> 7.0"
|
34
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmention-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: webmention
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '7.0'
|
41
41
|
description: A command-line interface for Webmention.
|
42
42
|
email:
|
43
43
|
- jason@sixtwothree.org
|
@@ -47,7 +47,6 @@ extensions: []
|
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
49
|
- CHANGELOG.md
|
50
|
-
- CONTRIBUTING.md
|
51
50
|
- LICENSE
|
52
51
|
- README.md
|
53
52
|
- exe/webmention
|
@@ -60,7 +59,7 @@ licenses:
|
|
60
59
|
- MIT
|
61
60
|
metadata:
|
62
61
|
bug_tracker_uri: https://github.com/jgarber623/webmention-cli/issues
|
63
|
-
changelog_uri: https://github.com/jgarber623/webmention-cli/blob/
|
62
|
+
changelog_uri: https://github.com/jgarber623/webmention-cli/blob/v3.0.0/CHANGELOG.md
|
64
63
|
rubygems_mfa_required: 'true'
|
65
64
|
post_install_message:
|
66
65
|
rdoc_options: []
|
@@ -70,17 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
69
|
requirements:
|
71
70
|
- - ">="
|
72
71
|
- !ruby/object:Gem::Version
|
73
|
-
version: '2.
|
74
|
-
- - "<"
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '4'
|
72
|
+
version: '2.7'
|
77
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
74
|
requirements:
|
79
75
|
- - ">="
|
80
76
|
- !ruby/object:Gem::Version
|
81
77
|
version: '0'
|
82
78
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
79
|
+
rubygems_version: 3.1.6
|
84
80
|
signing_key:
|
85
81
|
specification_version: 4
|
86
82
|
summary: A command-line interface for Webmention.
|
data/CONTRIBUTING.md
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# Contributing to webmention-cli
|
2
|
-
|
3
|
-
There are a couple ways you can help improve webmention-cli:
|
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._
|
8
|
-
|
9
|
-
## Getting Started
|
10
|
-
|
11
|
-
webmention-cli is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/jgarber623/webmention-cli/actions).
|
12
|
-
|
13
|
-
Before making changes to webmention-cli, you'll want to install Ruby 2.6.10. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.6.10 using your method of choice, install the project's gems by running:
|
14
|
-
|
15
|
-
```sh
|
16
|
-
bundle install
|
17
|
-
```
|
18
|
-
|
19
|
-
## Making Changes
|
20
|
-
|
21
|
-
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.
|
29
|
-
|
30
|
-
## Code Style
|
31
|
-
|
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.
|
33
|
-
|
34
|
-
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
|
-
|
36
|
-
[issues]: https://github.com/jgarber623/webmention-cli/issues
|
37
|
-
[pulls]: https://github.com/jgarber623/webmention-cli/pulls
|