webmention-cli 1.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9d31bf3347d905dc8f057cd324300158ec400fdbf9535578c53c15c1459dbcc
4
- data.tar.gz: 40d2958c3709997c6d683fa7b666a1cc5a3b73b8f3d0b0eef8490b58ee6aba75
3
+ metadata.gz: adf698b6264dfd85238169735736d3bd0f2116fb010310e6f56688dc79e0ade4
4
+ data.tar.gz: bea659bb79b192d4faa6751c3d141ed56ab1bb1e4bebbeefc5d6f22da1958b60
5
5
  SHA512:
6
- metadata.gz: 625dbca65123e9a1abd7669739cbb16a28475e9d5f77f955840255daaa4b56a4d36e34a233587d215f005c9eb6586061ee9c9a9d5ae12dd85c1b4f03b02d677b
7
- data.tar.gz: 51470bb35562080af17f8121de97aa451e83a6f35e00952327b25f51bd782d56ccc9e513ac39e8e27c66e6cf70071ea5f4dc6e70432416e812dfcda92dda504a
6
+ metadata.gz: 2168ce58e9ed1e894c742faffa6cf216659d3e7e6c69cbd634ed888ad0db748dcf4c9902b322c9573de8509731743bb41c0f3a94a1b25af87bba96a647b0b61d
7
+ data.tar.gz: 2f3794784624266b1c90a1af08a30d9e415a02620ff78db5279868bf85696e7092edbb5366e163fb0137a2ba8aa7d954a3046f009bafa0cef0c2543ce46596ee
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
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
+
12
+ ## 2.0.0 / 2022-05-20
13
+
14
+ - **Breaking change:** Rewrite gem code (35e9442)
15
+ - **Breaking change:** Update minimum supported Ruby version to 2.6 (b8bca32)
16
+ - Update maximum required Ruby version to < 4 (d5ca374)
17
+ - Update development Ruby version to 2.6.10 (cd27f96)
18
+ - Remove Reek (95096d0)
19
+
3
20
  ## 1.5.0 / 2020-08-23
4
21
 
5
22
  - Update indieweb-endpoints and webmention dependencies (209a75b)
data/README.md CHANGED
@@ -2,23 +2,16 @@
2
2
 
3
3
  **A command-line interface for Webmention written in Ruby.**
4
4
 
5
- [![Gem](https://img.shields.io/gem/v/webmention-cli.svg?style=for-the-badge)](https://rubygems.org/gems/webmention-cli)
6
- [![Downloads](https://img.shields.io/gem/dt/webmention-cli.svg?style=for-the-badge)](https://rubygems.org/gems/webmention-cli)
7
- [![Build](https://img.shields.io/travis/com/jgarber623/webmention-cli/main.svg?style=for-the-badge)](https://travis-ci.com/jgarber623/webmention-cli)
8
- [![Dependencies](https://img.shields.io/depfu/jgarber623/webmention-cli.svg?style=for-the-badge)](https://depfu.com/github/jgarber623/webmention-cli)
9
- [![Maintainability](https://img.shields.io/codeclimate/maintainability/jgarber623/webmention-cli.svg?style=for-the-badge)](https://codeclimate.com/github/jgarber623/webmention-cli)
10
- [![Coverage](https://img.shields.io/codeclimate/c/jgarber623/webmention-cli.svg?style=for-the-badge)](https://codeclimate.com/github/jgarber623/webmention-cli/code)
11
-
12
- ## Getting Started
13
-
14
- Before installing and using webmention-cli, you'll want to have [Ruby](https://www.ruby-lang.org) 2.5 (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).
15
-
16
- webmention-cli is developed using Ruby 2.5.8 and is additionally tested against Ruby 2.6 and 2.7 using [Travis CI](https://travis-ci.com/jgarber623/webmention-cli).
5
+ [![Gem](https://img.shields.io/gem/v/webmention-cli.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/webmention-cli)
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/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)
17
8
 
18
9
  ## Installation
19
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
+
20
13
  ```sh
21
- gem install webmention-cli
14
+ $ gem install webmention-cli
22
15
  ```
23
16
 
24
17
  ## Usage
@@ -27,43 +20,54 @@ webmention-cli makes available the following commands:
27
20
 
28
21
  ### `webmention endpoint <target>`
29
22
 
30
- Discover the webmention endpoint for the given `<target>` URL using the [webmention-endpoint-ruby](https://github.com/jgarber623/webmention-endpoint-ruby) gem's endpoint discovery.
23
+ Discover the Webmention endpoint for a `<target>` URL.
31
24
 
32
25
  ```sh
33
26
  $ webmention endpoint https://sixtwothree.org
34
27
  https://sixtwothree.org/webmentions
35
28
  ```
36
29
 
30
+ The command returns a non-zero exit code if the `<target>` URL does not advertise a Webmention endpoint (or if an HTTP error was encountered).
31
+
37
32
  ### `webmention send <source> <target>`
38
33
 
39
- Send a webmention from `<source>` URL to the given `<target>` URL using the [webmention-client-ruby](https://github.com/indieweb/webmention-client-ruby) gem.
34
+ Send a webmention from a `<source>` URL to a `<target>` URL.
40
35
 
41
36
  ```sh
42
37
  $ webmention send https://sixtwothree.org/posts/an-engineer-walks-into-a-design-sprint https://adactio.com/journal/6246
43
38
  202 Accepted
44
39
  ```
45
40
 
46
- The `send` command will return either an HTTP status _or_ the value of the response's `Location` header (if provided _and_ the response's HTTP status is `201 Created`).
41
+ The command will return either an HTTP status _or_ the value of the response's `Location` header (if provided _and_ the response's HTTP status is `201 Created`).
42
+
43
+ A non-zero exit code is returned if the HTTP status is _not_ within the 200 range (or if an HTTP error was encountered).
44
+
45
+ #### Send a webmention with a vouch URL
46
+
47
+ ```sh
48
+ $ webmention send https://sixtwothree.org/posts/now-accepting-webmentions https://aaronparecki.com --vouch https://adactio.com/links/9229
49
+ 202 Accepted
50
+ ```
51
+
52
+ The command with a vouch URL included responds in the same fashion as noted above.
47
53
 
48
54
  ### `webmention verify <source> <target>`
49
55
 
50
- Confirm whether or not a `<source>` URL links to the given `<target>` URL using the [webmention-verification-ruby](https://github.com/jgarber623/webmention-verification-ruby) gem's verifers.
56
+ Confirm whether or not a `<source>` URL links to a `<target>` URL.
51
57
 
52
58
  ```sh
53
59
  $ webmention verify https://kartikprabhu.com/notes/re-launching-franciscms https://sixtwothree.org/posts/launching-franciscms-onto-the-indieweb
54
- true
55
60
  ```
56
61
 
57
- By default, the `verify` command will strictly match URLs. For a bit more flexibility, use the `--no-strict` flag:
62
+ The command will return a zero exit code if `<source>` links to `<target>` and a non-zero exit code in all other cases.
63
+
64
+ #### Verify a webmention with a vouch URL
58
65
 
59
66
  ```sh
60
- $ webmention verify https://aaronparecki.com/2014/12/17/5/webmention-indieweb https://sixtwothree.org/posts/open-sourcing-my-webmention-service --no-strict
61
- true
67
+ $ webmention verify https://kartikprabhu.com/notes/re-launching-franciscms https://sixtwothree.org/posts/launching-franciscms-onto-the-indieweb --vouch https://adactio.com/links/9229
62
68
  ```
63
69
 
64
- ## Contributing
65
-
66
- 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.
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.
67
71
 
68
72
  ## Acknowledgments
69
73
 
data/exe/webmention CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- lib = File.expand_path('../lib', __dir__)
4
+ lib = File.expand_path("../lib", __dir__)
4
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
 
6
- require 'webmention/cli'
7
+ require "webmention/cli"
7
8
 
8
- Webmention::CLI.start(ARGV)
9
+ Webmention::CLI::Runner.start
@@ -1,71 +1,56 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Webmention
2
4
  module CLI
3
5
  class Runner < Thor
4
6
  include Thor::Actions
5
7
 
6
- package_name 'Webmention'
8
+ package_name "Webmention"
7
9
 
8
- map ['-v', '--version'] => :__version
10
+ map ["-v", "--version"] => :version
9
11
 
10
- desc 'endpoint <target>', 'Discover Webmention endpoint for <target> URL'
12
+ # :nocov:
13
+ def self.exit_on_failure?
14
+ true
15
+ end
16
+ # :nocov:
17
+
18
+ desc "endpoint <target>", "Discover the Webmention endpoint for <target> URL"
11
19
  def endpoint(target)
12
- url = Commands::Endpoint.new(target).run
20
+ url = Webmention::Url.new(target)
13
21
 
14
- raise WebmentionEndpointError unless url
22
+ exit 1 unless url.webmention_endpoint?
15
23
 
16
- say_success(url)
17
- rescue Error => exception
18
- say_failure(exception)
24
+ say url.webmention_endpoint
19
25
  end
20
26
 
21
- desc 'send <source> <target>', 'Send a webmention from <source> URL to <target> URL'
27
+ desc "send <source> <target>", "Send a webmention from <source> URL to <target> URL"
28
+ option :vouch, desc: "Submit a <vouch> URL"
22
29
  def send(source, target)
23
- response = Commands::Send.new(source, target).run
30
+ response = Webmention.send_webmention(source, target, vouch: options[:vouch])
24
31
 
25
- raise WebmentionEndpointError unless response
32
+ exit 1 unless response.ok?
26
33
 
27
- status = response.status
28
- location = response.headers[:location]
34
+ code = response.code
35
+ location = response.headers["Location"]
29
36
 
30
- raise WebmentionSendError, status unless status.success?
37
+ say(code == 201 && location ? location : "#{code} #{response.reason}")
31
38
 
32
- say_success(response.code == 201 && location ? location : status)
33
- rescue Error => exception
34
- say_failure(exception)
39
+ exit 1 unless code.between?(200, 299)
35
40
  end
36
41
 
37
- desc 'verify <source> <target>', 'Verify <source> URL links to <target> URL'
38
- option :strict, type: :boolean, desc: 'Enable or disable strict URL matching', default: true
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"
39
44
  def verify(source, target)
40
- verified = Commands::Verify.new(source, target, options[:strict]).run
41
-
42
- raise WebmentionVerificationError, verified unless verified
45
+ verification = Webmention.verify_webmention(source, target, vouch: options[:vouch])
43
46
 
44
- say_success(verified)
45
- rescue Error => exception
46
- say_failure(exception)
47
+ exit 1 unless verification.verified?
47
48
  end
48
49
 
49
- desc '--version', 'Print version information'
50
- def __version
50
+ desc "version", "Print version information"
51
+ def version
51
52
  say "webmention-cli version #{Webmention::CLI::VERSION}"
52
53
  end
53
-
54
- no_commands do
55
- def say_failure(message)
56
- say message, :red
57
- exit 1
58
- end
59
-
60
- def say_success(message)
61
- say message, :green
62
- exit 0
63
- end
64
- end
65
-
66
- def self.exit_on_failure?
67
- true
68
- end
69
54
  end
70
55
  end
71
56
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Webmention
2
4
  module CLI
3
- VERSION = '1.5.0'.freeze
5
+ VERSION = "3.0.0"
4
6
  end
5
7
  end
@@ -1,22 +1,8 @@
1
- require 'thor'
1
+ # frozen_string_literal: true
2
2
 
3
- require 'indieweb/endpoints'
4
- require 'webmention'
5
- require 'webmention/verification'
3
+ require "thor"
4
+ require "webmention"
6
5
 
7
- require 'webmention/cli/version'
8
- require 'webmention/cli/exceptions'
6
+ require_relative "cli/version"
9
7
 
10
- require 'webmention/cli/commands/endpoint'
11
- require 'webmention/cli/commands/send'
12
- require 'webmention/cli/commands/verify'
13
-
14
- require 'webmention/cli/runner'
15
-
16
- module Webmention
17
- module CLI
18
- def self.start(argv)
19
- Runner.start(argv)
20
- end
21
- end
22
- end
8
+ require_relative "cli/runner"
@@ -1,31 +1,34 @@
1
- require_relative 'lib/webmention/cli/version'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/webmention/cli/version"
2
4
 
3
5
  Gem::Specification.new do |spec|
4
- spec.required_ruby_version = Gem::Requirement.new('>= 2.5', '< 2.8')
6
+ spec.required_ruby_version = ">= 2.7"
5
7
 
6
- spec.name = 'webmention-cli'
8
+ spec.name = "webmention-cli"
7
9
  spec.version = Webmention::CLI::VERSION
8
- spec.authors = ['Jason Garber']
9
- spec.email = ['jason@sixtwothree.org']
10
+ spec.authors = ["Jason Garber"]
11
+ spec.email = ["jason@sixtwothree.org"]
10
12
 
11
- spec.summary = 'A command-line interface for Webmention.'
13
+ spec.summary = "A command-line interface for Webmention."
12
14
  spec.description = spec.summary
13
- spec.homepage = 'https://github.com/jgarber623/webmention-cli'
14
- spec.license = 'MIT'
15
+ spec.homepage = "https://github.com/jgarber623/webmention-cli"
16
+ spec.license = "MIT"
15
17
 
16
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
17
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(bin|spec)/}) }
18
- end
18
+ spec.files = Dir["lib/**/*"].reject { |f| File.directory?(f) }
19
+ spec.files += %w[LICENSE CHANGELOG.md README.md]
20
+ spec.files += %w[webmention-cli.gemspec]
19
21
 
20
- spec.bindir = 'exe'
21
- spec.executables = ['webmention']
22
- spec.require_paths = ['lib']
22
+ spec.bindir = "exe"
23
+ spec.executables = ["webmention"]
24
+ spec.require_paths = ["lib"]
23
25
 
24
- spec.metadata['bug_tracker_uri'] = "#{spec.homepage}/issues"
25
- spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md"
26
+ spec.metadata = {
27
+ "bug_tracker_uri" => "#{spec.homepage}/issues",
28
+ "changelog_uri" => "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md",
29
+ "rubygems_mfa_required" => "true"
30
+ }
26
31
 
27
- spec.add_runtime_dependency 'indieweb-endpoints', '~> 5.0'
28
- spec.add_runtime_dependency 'thor', '~> 1.0'
29
- spec.add_runtime_dependency 'webmention', '~> 5.0'
30
- spec.add_runtime_dependency 'webmention-verification', '~> 4.0'
32
+ spec.add_runtime_dependency "thor", "~> 1.3"
33
+ spec.add_runtime_dependency "webmention", "~> 7.0"
31
34
  end
metadata CHANGED
@@ -1,71 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmention-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Garber
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-23 00:00:00.000000000 Z
11
+ date: 2023-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: indieweb-endpoints
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '5.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: thor
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '1.0'
19
+ version: '1.3'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '1.0'
26
+ version: '1.3'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: webmention
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '5.0'
33
+ version: '7.0'
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '5.0'
55
- - !ruby/object:Gem::Dependency
56
- name: webmention-verification
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '4.0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '4.0'
40
+ version: '7.0'
69
41
  description: A command-line interface for Webmention.
70
42
  email:
71
43
  - jason@sixtwothree.org
@@ -74,27 +46,11 @@ executables:
74
46
  extensions: []
75
47
  extra_rdoc_files: []
76
48
  files:
77
- - ".editorconfig"
78
- - ".gitignore"
79
- - ".reek.yml"
80
- - ".rspec"
81
- - ".rubocop"
82
- - ".rubocop.yml"
83
- - ".ruby-version"
84
- - ".simplecov"
85
- - ".travis.yml"
86
49
  - CHANGELOG.md
87
- - CONTRIBUTING.md
88
- - Gemfile
89
50
  - LICENSE
90
51
  - README.md
91
- - Rakefile
92
52
  - exe/webmention
93
53
  - lib/webmention/cli.rb
94
- - lib/webmention/cli/commands/endpoint.rb
95
- - lib/webmention/cli/commands/send.rb
96
- - lib/webmention/cli/commands/verify.rb
97
- - lib/webmention/cli/exceptions.rb
98
54
  - lib/webmention/cli/runner.rb
99
55
  - lib/webmention/cli/version.rb
100
56
  - webmention-cli.gemspec
@@ -103,8 +59,9 @@ licenses:
103
59
  - MIT
104
60
  metadata:
105
61
  bug_tracker_uri: https://github.com/jgarber623/webmention-cli/issues
106
- changelog_uri: https://github.com/jgarber623/webmention-cli/blob/v1.5.0/CHANGELOG.md
107
- post_install_message:
62
+ changelog_uri: https://github.com/jgarber623/webmention-cli/blob/v3.0.0/CHANGELOG.md
63
+ rubygems_mfa_required: 'true'
64
+ post_install_message:
108
65
  rdoc_options: []
109
66
  require_paths:
110
67
  - lib
@@ -112,18 +69,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
69
  requirements:
113
70
  - - ">="
114
71
  - !ruby/object:Gem::Version
115
- version: '2.5'
116
- - - "<"
117
- - !ruby/object:Gem::Version
118
- version: '2.8'
72
+ version: '2.7'
119
73
  required_rubygems_version: !ruby/object:Gem::Requirement
120
74
  requirements:
121
75
  - - ">="
122
76
  - !ruby/object:Gem::Version
123
77
  version: '0'
124
78
  requirements: []
125
- rubygems_version: 3.1.2
126
- signing_key:
79
+ rubygems_version: 3.1.6
80
+ signing_key:
127
81
  specification_version: 4
128
82
  summary: A command-line interface for Webmention.
129
83
  test_files: []
data/.editorconfig DELETED
@@ -1,14 +0,0 @@
1
- # EditorConfig is awesome: https://EditorConfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- end_of_line = lf
7
- insert_final_newline = true
8
- indent_size = 2
9
- indent_style = space
10
- trim_trailing_whitespace = true
11
-
12
- [*.md]
13
- indent_size = 4
14
- indent_style = tab
data/.gitignore DELETED
@@ -1,34 +0,0 @@
1
- *.gem
2
- *.rbc
3
- /.config
4
- /coverage/
5
- /InstalledFiles
6
- /pkg/
7
- /spec/reports/
8
- /spec/examples.txt
9
- /test/tmp/
10
- /test/version_tmp/
11
- /tmp/
12
-
13
- # Used by dotenv library to load environment variables.
14
- # .env
15
-
16
- # Documentation cache and generated files:
17
- /.yardoc/
18
- /_yardoc/
19
- /doc/
20
- /rdoc/
21
-
22
- # Environment normalization:
23
- /.bundle/
24
- /vendor/bundle
25
- /lib/bundler/man/
26
-
27
- # for a library or gem, you might want to ignore these files since the code is
28
- # intended to run in multiple environments; otherwise, check them in:
29
- Gemfile.lock
30
- # .ruby-version
31
- # .ruby-gemset
32
-
33
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
- .rvmrc
data/.reek.yml DELETED
@@ -1,6 +0,0 @@
1
- detectors:
2
- IrresponsibleModule:
3
- enabled: false
4
-
5
- exclude_paths:
6
- - vendor/
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --order random
2
- --require spec_helper
data/.rubocop DELETED
@@ -1,3 +0,0 @@
1
- --display-style-guide
2
- --extra-details
3
- --parallel
data/.rubocop.yml DELETED
@@ -1,26 +0,0 @@
1
- require:
2
- - rubocop-performance
3
- - rubocop-rake
4
- - rubocop-rspec
5
-
6
- AllCops:
7
- NewCops: enable
8
-
9
- Layout/LineLength:
10
- Enabled: false
11
-
12
- Metrics/BlockLength:
13
- Exclude:
14
- - spec/**/*.rb
15
-
16
- Naming/RescuedExceptionsVariableName:
17
- PreferredName: exception
18
-
19
- Style/Documentation:
20
- Enabled: false
21
-
22
- Style/FrozenStringLiteralComment:
23
- Enabled: false
24
-
25
- Style/SymbolArray:
26
- Enabled: false
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.8
data/.simplecov DELETED
@@ -1,13 +0,0 @@
1
- require 'simplecov-console'
2
-
3
- formatters = [SimpleCov::Formatter::HTMLFormatter]
4
-
5
- # rubocop:disable Style/IfUnlessModifier
6
- if RSpec.configuration.files_to_run.length > 1
7
- formatters << SimpleCov::Formatter::Console
8
- end
9
- # rubocop:enable Style/IfUnlessModifier
10
-
11
- SimpleCov.start do
12
- formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
13
- end
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- dist: bionic
2
- language: ruby
3
- rvm:
4
- - 2.5
5
- - 2.6
6
- - 2.7
7
- cache: bundler
8
- before_script:
9
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
10
- - chmod +x ./cc-test-reporter
11
- - ./cc-test-reporter before-build
12
- after_script:
13
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
14
- notifications:
15
- email: false
16
- slack:
17
- rooms:
18
- secure: UUgS4sye0G9UMrj4TSEs2MQBwNbJd93o3GB/AJTJdlglCgtDSlRdTSkF4vt0zQOwmSZY04eSxubGsgccW54UZCUpABQLEJ6MEpVrG/xlCwh1AQ4ySvAsfAqYlJB64Huh/eHV9UvDQGpCduJ+K4z6eSA4eF2ioqEBJd2jXlsjb1/g1u3sezzfL/qxZBEr9sPM5TORRLpEcJYhO1NE1FJQzcCjBQg+hg2VrLvevErolFiRUbQmh3obzEGx9TE8BJVC4E4ZjWMpfWEtCOXnVuwiEfoe2fYHktoP4cI8KKqwCAD/dQYQcCTuuKiaQdwxBWbmMPgJPFSuR66TvaWN+m95lRqIp//E9u9PAeusleHCSt2DkyEs1eA9GQqYum/KIX/TcXXeGAKAWJuqzMmS51BUgCo2IaxkwAaGgCWLhKH1ZyFowpHV6nWvU7j15vlhLjani9lJcoeAKZqIxHH4QZpXmngdVZqwQddRfD/g4bu3tOyGqg+9rYqwJ5xhNkqLrHf0de3p8jZ5bqAxVMfrABvFw8s+f/GuL575wu+lnM4zPw70f2MnCfS4BJn1JJ8dXeQRiJr4YcRkBBlHmmGyUk4xPlfhs5hiQGL/dG6DZRv2TjEHmVjvgNgP3DcESmUgpfoSr2S0pQ8o5EqDC9UpqdGBY/juwC7A+wZcvVBxFIfmajU=
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.5.8 and is additionally tested against Ruby 2.6 and 2.7 using [Travis CI](https://travis-ci.com/jgarber623/webmention-cli).
12
-
13
- Before making changes to webmention-cli, you'll want to install Ruby 2.5.8. 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.5.8 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
data/Gemfile DELETED
@@ -1,16 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in webmention-cli.gemspec
4
- gemspec
5
-
6
- gem 'pry-byebug', '~> 3.9'
7
- gem 'rake', '~> 13.0'
8
- gem 'reek', '~> 6.0'
9
- gem 'rspec', '~> 3.10'
10
- gem 'rubocop', '~> 1.6'
11
- gem 'rubocop-performance', '~> 1.9'
12
- gem 'rubocop-rake', '~> 0.5.1'
13
- gem 'rubocop-rspec', '~> 2.1'
14
- gem 'simplecov', '~> 0.20.0'
15
- gem 'simplecov-console', '~> 0.8.0'
16
- gem 'webmock', '~> 3.11'
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- require 'reek/rake/task'
4
- require 'rspec/core/rake_task'
5
- require 'rubocop/rake_task'
6
-
7
- Reek::Rake::Task.new do |task|
8
- task.fail_on_error = false
9
- end
10
-
11
- RSpec::Core::RakeTask.new
12
-
13
- RuboCop::RakeTask.new do |task|
14
- task.fail_on_error = false
15
- end
16
-
17
- task default: [:rubocop, :reek, :spec]
@@ -1,20 +0,0 @@
1
- module Webmention
2
- module CLI
3
- module Commands
4
- class Endpoint
5
- def initialize(url)
6
- @url = url
7
- end
8
-
9
- def run
10
- IndieWeb::Endpoints.get(@url)[:webmention]
11
- rescue IndieWeb::Endpoints::ArgumentError,
12
- IndieWeb::Endpoints::InvalidURIError => exception
13
- raise ArgumentError, exception
14
- rescue IndieWeb::Endpoints::IndieWebEndpointsError => exception
15
- raise WebmentionEndpointError, exception
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,21 +0,0 @@
1
- module Webmention
2
- module CLI
3
- module Commands
4
- class Send
5
- def initialize(source, target)
6
- @source = source
7
- @target = target
8
- end
9
-
10
- def run
11
- Webmention.send_mention(@source, @target)
12
- rescue Webmention::ArgumentError,
13
- Webmention::InvalidURIError => exception
14
- raise ArgumentError, exception
15
- rescue Webmention::WebmentionClientError => exception
16
- raise WebmentionSendError, exception
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,22 +0,0 @@
1
- module Webmention
2
- module CLI
3
- module Commands
4
- class Verify
5
- def initialize(source, target, strict)
6
- @source = source
7
- @target = target
8
- @strict = strict
9
- end
10
-
11
- def run
12
- Webmention::Verification.verified?(@source, @target, strict: @strict)
13
- rescue Webmention::Verification::ArgumentError,
14
- Webmention::Verification::InvalidURIError => exception
15
- raise ArgumentError, exception
16
- rescue Webmention::Verification::WebmentionVerificationError => exception
17
- raise WebmentionVerificationError, exception
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,17 +0,0 @@
1
- module Webmention
2
- module CLI
3
- class Error < RuntimeError; end
4
-
5
- class ArgumentError < Error; end
6
-
7
- class WebmentionEndpointError < Error
8
- def initialize(msg = 'No Webmention endpoint found')
9
- super(msg)
10
- end
11
- end
12
-
13
- class WebmentionSendError < Error; end
14
-
15
- class WebmentionVerificationError < Error; end
16
- end
17
- end