webmention-cli 1.5.0 → 2.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: d9d31bf3347d905dc8f057cd324300158ec400fdbf9535578c53c15c1459dbcc
4
- data.tar.gz: 40d2958c3709997c6d683fa7b666a1cc5a3b73b8f3d0b0eef8490b58ee6aba75
3
+ metadata.gz: ffe5ed94ca3826e7bbde73673af684d2e5cf14bcd88923b3016d2c9f6f2b0621
4
+ data.tar.gz: 614c66da93de19e0dbe0934c0729e45d16aac9b8c585d80d6449a1931dcbb6ed
5
5
  SHA512:
6
- metadata.gz: 625dbca65123e9a1abd7669739cbb16a28475e9d5f77f955840255daaa4b56a4d36e34a233587d215f005c9eb6586061ee9c9a9d5ae12dd85c1b4f03b02d677b
7
- data.tar.gz: 51470bb35562080af17f8121de97aa451e83a6f35e00952327b25f51bd782d56ccc9e513ac39e8e27c66e6cf70071ea5f4dc6e70432416e812dfcda92dda504a
6
+ metadata.gz: 27d70232453c7b8694b48fd633875bf43854ede49ef35edf6cb5a7ba88b434baaaa53489548f2a6b8de460981d299b8d05378d15b5804ae64a51f68c1727443f
7
+ data.tar.gz: 7bb36cf15f8954a40871905bca46899c5f4230fa4546797c45f5e255c040f3df1c4782b20a3dc2ff133456ecf5623f75c3cc63b57c16f96ea64ce638fe41cf89
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0 / 2022-05-20
4
+
5
+ - **Breaking change:** Rewrite gem code (35e9442)
6
+ - **Breaking change:** Update minimum supported Ruby version to 2.6 (b8bca32)
7
+ - Update maximum required Ruby version to < 4 (d5ca374)
8
+ - Update development Ruby version to 2.6.10 (cd27f96)
9
+ - Remove Reek (95096d0)
10
+
3
11
  ## 1.5.0 / 2020-08-23
4
12
 
5
13
  - Update indieweb-endpoints and webmention dependencies (209a75b)
data/CONTRIBUTING.md CHANGED
@@ -8,9 +8,9 @@ There are a couple ways you can help improve webmention-cli:
8
8
 
9
9
  ## Getting Started
10
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).
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
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:
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
14
 
15
15
  ```sh
16
16
  bundle install
data/README.md CHANGED
@@ -2,18 +2,17 @@
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)
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/workflow/status/jgarber623/webmention-cli/CI?logo=github&style=for-the-badge)](https://github.com/jgarber623/webmention-cli/actions/workflows/ci.yml)
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)
11
10
 
12
11
  ## Getting Started
13
12
 
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).
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).
15
14
 
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).
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).
17
16
 
18
17
  ## Installation
19
18
 
@@ -27,40 +26,55 @@ webmention-cli makes available the following commands:
27
26
 
28
27
  ### `webmention endpoint <target>`
29
28
 
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.
29
+ Discover the Webmention endpoint for a `<target>` URL.
31
30
 
32
31
  ```sh
33
32
  $ webmention endpoint https://sixtwothree.org
34
33
  https://sixtwothree.org/webmentions
35
34
  ```
36
35
 
36
+ 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).
37
+
37
38
  ### `webmention send <source> <target>`
38
39
 
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.
40
+ Send a webmention from a `<source>` URL to a `<target>` URL.
40
41
 
41
42
  ```sh
42
43
  $ webmention send https://sixtwothree.org/posts/an-engineer-walks-into-a-design-sprint https://adactio.com/journal/6246
43
44
  202 Accepted
44
45
  ```
45
46
 
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`).
47
+ 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`).
48
+
49
+ A non-zero exit code is returned if the HTTP status is _not_ within the 200 range (or if an HTTP error was encountered).
50
+
51
+ #### Send a webmention with a vouch URL
52
+
53
+ ```sh
54
+ $ webmention send https://sixtwothree.org/posts/now-accepting-webmentions https://aaronparecki.com --vouch https://adactio.com/links/9229
55
+ 202 Accepted
56
+ ```
57
+
58
+ The command with a vouch URL included responds in the same fashion as noted above.
47
59
 
48
60
  ### `webmention verify <source> <target>`
49
61
 
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.
62
+ Confirm whether or not a `<source>` URL links to a `<target>` URL.
51
63
 
52
64
  ```sh
53
65
  $ webmention verify https://kartikprabhu.com/notes/re-launching-franciscms https://sixtwothree.org/posts/launching-franciscms-onto-the-indieweb
54
- true
55
66
  ```
56
67
 
57
- By default, the `verify` command will strictly match URLs. For a bit more flexibility, use the `--no-strict` flag:
68
+ The command will return a zero exit code if `<source>` links to `<target>` and a non-zero exit code in all other cases.
69
+
70
+ #### Verify a webmention with a vouch URL
58
71
 
59
72
  ```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
73
+ $ 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
74
  ```
63
75
 
76
+ 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
+
64
78
  ## Contributing
65
79
 
66
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.
data/exe/webmention CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  lib = File.expand_path('../lib', __dir__)
4
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
 
6
7
  require 'webmention/cli'
7
8
 
8
- Webmention::CLI.start(ARGV)
9
+ Webmention::CLI::Runner.start
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Webmention
2
4
  module CLI
3
5
  class Runner < Thor
@@ -5,67 +7,50 @@ module Webmention
5
7
 
6
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
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 = '2.0.0'
4
6
  end
5
7
  end
@@ -1,22 +1,7 @@
1
- require 'thor'
1
+ # frozen_string_literal: true
2
2
 
3
- require 'indieweb/endpoints'
3
+ require 'thor'
4
4
  require 'webmention'
5
- require 'webmention/verification'
6
-
7
- require 'webmention/cli/version'
8
- require 'webmention/cli/exceptions'
9
-
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
5
 
16
- module Webmention
17
- module CLI
18
- def self.start(argv)
19
- Runner.start(argv)
20
- end
21
- end
22
- end
6
+ require_relative 'cli/version'
7
+ require_relative 'cli/runner'
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
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.6', '< 4'
5
7
 
6
8
  spec.name = 'webmention-cli'
7
9
  spec.version = Webmention::CLI::VERSION
@@ -13,19 +15,20 @@ Gem::Specification.new do |spec|
13
15
  spec.homepage = 'https://github.com/jgarber623/webmention-cli'
14
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 CONTRIBUTING.md README.md]
20
+ spec.files += %w[webmention-cli.gemspec]
19
21
 
20
22
  spec.bindir = 'exe'
21
23
  spec.executables = ['webmention']
22
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.2'
33
+ spec.add_runtime_dependency 'webmention', '~> 6.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: 2.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: 2022-05-21 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.2'
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.2'
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'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !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'
33
+ version: '6.0'
62
34
  type: :runtime
63
35
  prerelease: false
64
36
  version_requirements: !ruby/object:Gem::Requirement
65
37
  requirements:
66
38
  - - "~>"
67
39
  - !ruby/object:Gem::Version
68
- version: '4.0'
40
+ version: '6.0'
69
41
  description: A command-line interface for Webmention.
70
42
  email:
71
43
  - jason@sixtwothree.org
@@ -74,27 +46,12 @@ 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
50
  - CONTRIBUTING.md
88
- - Gemfile
89
51
  - LICENSE
90
52
  - README.md
91
- - Rakefile
92
53
  - exe/webmention
93
54
  - 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
55
  - lib/webmention/cli/runner.rb
99
56
  - lib/webmention/cli/version.rb
100
57
  - webmention-cli.gemspec
@@ -103,8 +60,9 @@ licenses:
103
60
  - MIT
104
61
  metadata:
105
62
  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:
63
+ changelog_uri: https://github.com/jgarber623/webmention-cli/blob/v2.0.0/CHANGELOG.md
64
+ rubygems_mfa_required: 'true'
65
+ post_install_message:
108
66
  rdoc_options: []
109
67
  require_paths:
110
68
  - lib
@@ -112,18 +70,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
70
  requirements:
113
71
  - - ">="
114
72
  - !ruby/object:Gem::Version
115
- version: '2.5'
73
+ version: '2.6'
116
74
  - - "<"
117
75
  - !ruby/object:Gem::Version
118
- version: '2.8'
76
+ version: '4'
119
77
  required_rubygems_version: !ruby/object:Gem::Requirement
120
78
  requirements:
121
79
  - - ">="
122
80
  - !ruby/object:Gem::Version
123
81
  version: '0'
124
82
  requirements: []
125
- rubygems_version: 3.1.2
126
- signing_key:
83
+ rubygems_version: 3.3.12
84
+ signing_key:
127
85
  specification_version: 4
128
86
  summary: A command-line interface for Webmention.
129
87
  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/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