webmention-cli 0.1.0 → 1.3.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
- SHA1:
3
- metadata.gz: 579a8cdb3a27bca2d6ac537727b201553bf3b988
4
- data.tar.gz: 0750e3192cb6ea780fe561019e4e9d0aabf1bb95
2
+ SHA256:
3
+ metadata.gz: 3ef1fff1c6095c2c55cdb595f744ed0c628012cb01b7bd1faf3cdc1ab7a001d1
4
+ data.tar.gz: a6c75a3e175b5a5cd835f3ccc61a6c4d69e60c338a430d402538639344629e10
5
5
  SHA512:
6
- metadata.gz: f532a2365a4f0de51cd5edcf4147f1ca30d87a26e6a1b1a0a55a28ae47826a2c02059ecff44429a4375e461fa97c30f38a4b8d315a389de5bc184975c8b7a6e8
7
- data.tar.gz: c6f645716ab07555841f777b2086efe0fd9138e119dd2dbf6fc6f5de5e4a5c7a7a221f0e8f14b9b76df21214c57c9feef016e30c8c844dc968bcf0090f20bf20
6
+ metadata.gz: 346c9767a32f89213946d43bef9c053e48659277cc8909c140406b8ba8684f779e2128f30dd8a3372e474b73b6d5878ea95803e885b1d3da274822352eeb5816
7
+ data.tar.gz: bec8edde869d4d82902205b74bb500f631ac6b588550d6f6639debc69deb52e650b1e12a8e7944d0743f4ef28382d95a3a8a9411107269da7cc0632858726705
@@ -0,0 +1,6 @@
1
+ detectors:
2
+ IrresponsibleModule:
3
+ enabled: false
4
+
5
+ exclude_paths:
6
+ - vendor/
@@ -1,15 +1,25 @@
1
1
  require:
2
+ - rubocop-performance
2
3
  - rubocop-rspec
3
4
 
5
+ AllCops:
6
+ NewCops: enable
7
+
8
+ Layout/LineLength:
9
+ Enabled: false
10
+
4
11
  Metrics/BlockLength:
5
12
  Exclude:
6
13
  - spec/**/*.rb
7
14
 
8
- Metrics/LineLength:
9
- Enabled: false
15
+ Naming/RescuedExceptionsVariableName:
16
+ PreferredName: exception
10
17
 
11
18
  Style/Documentation:
12
19
  Enabled: false
13
20
 
14
21
  Style/FrozenStringLiteralComment:
15
22
  Enabled: false
23
+
24
+ Style/SymbolArray:
25
+ Enabled: false
@@ -1 +1 @@
1
- 2.4.4
1
+ 2.5.8
data/.simplecov CHANGED
@@ -2,9 +2,11 @@ require 'simplecov-console'
2
2
 
3
3
  formatters = [SimpleCov::Formatter::HTMLFormatter]
4
4
 
5
+ # rubocop:disable Style/IfUnlessModifier
5
6
  if RSpec.configuration.files_to_run.length > 1
6
7
  formatters << SimpleCov::Formatter::Console
7
8
  end
9
+ # rubocop:enable Style/IfUnlessModifier
8
10
 
9
11
  SimpleCov.start do
10
12
  formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
@@ -1,18 +1,14 @@
1
+ dist: bionic
1
2
  language: ruby
2
3
  rvm:
3
- - 2.4.4
4
- - 2.5.1
4
+ - 2.5
5
+ - 2.6
6
+ - 2.7
5
7
  cache: bundler
6
- before_install:
7
- - gem update --system
8
- - gem install bundler
9
8
  before_script:
10
9
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
10
  - chmod +x ./cc-test-reporter
12
11
  - ./cc-test-reporter before-build
13
- script:
14
- - bundle exec rubocop
15
- - bundle exec rake
16
12
  after_script:
17
13
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
18
14
  notifications:
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.0 / 2020-05-26
4
+
5
+ - Update webmention dependency (4540771)
6
+
7
+ ## 1.2.0 / 2020-05-18
8
+
9
+ - Update indieweb-endpoints, webmention, and webmention-verification gems (2ad2f78)
10
+ - Move development dependencies to Gemfile per current Bundler conventions (434f785)
11
+ - Update development Ruby version to 2.5.8 (1438a62)
12
+
13
+ ## 1.1.0 / 2020-04-17
14
+
15
+ - Update webmention dependency (21695df)
16
+
17
+ ## 1.0.0 / 2020-02-08
18
+
19
+ - Rewrite gem code
20
+ - Rewrite specs
21
+ - Update development and runtime dependencies to latest versions (67744c1)
22
+ - Change supported Ruby versions to >= 2.5 and < 2.8 (1b30b8c)
23
+ - Update project Ruby version to 2.5.7 (21e94b6)
24
+
25
+ ## 0.1.1 / 2019-01-03
26
+
27
+ - Expand supported Ruby versions to include 2.6 (8930501)
28
+
3
29
  ## 0.1.0 / 2018-08-14
4
30
 
5
31
  - Initial release!
@@ -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.4.4 and is additionally tested against Ruby 2.5.1 using [Travis CI](https://travis-ci.com/jgarber623/webmention-cli).
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
12
 
13
- Before making changes to webmention-cli, you'll want to install Ruby 2.4.4. 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.4.4 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.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
14
 
15
15
  ```sh
16
16
  bundle install
data/Gemfile CHANGED
@@ -2,3 +2,14 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in webmention-cli.gemspec
4
4
  gemspec
5
+
6
+ gem 'pry-byebug', '~> 3.9'
7
+ gem 'rake', '~> 13.0'
8
+ gem 'reek', '~> 6.0'
9
+ gem 'rspec', '~> 3.9'
10
+ gem 'rubocop', '~> 0.84.0'
11
+ gem 'rubocop-performance', '~> 1.6'
12
+ gem 'rubocop-rspec', '~> 1.39'
13
+ gem 'simplecov', '~> 0.18.5'
14
+ gem 'simplecov-console', '~> 0.7.2'
15
+ gem 'webmock', '~> 3.8'
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018 Jason Garber
3
+ Copyright (c) 2018–present Jason Garber
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -11,9 +11,9 @@
11
11
 
12
12
  ## Getting Started
13
13
 
14
- Before installing and using webmention-cli, you'll want to have [Ruby](https://www.ruby-lang.org) 2.4 (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
+ 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
15
 
16
- webmention-cli is developed using Ruby 2.4.4 and is additionally tested against Ruby 2.5.1 using [Travis CI](https://travis-ci.com/jgarber623/webmention-cli).
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).
17
17
 
18
18
  ## Installation
19
19
 
@@ -25,22 +25,40 @@ gem install webmention-cli
25
25
 
26
26
  webmention-cli makes available the following commands:
27
27
 
28
- ### `webmention endpoint <url>`
28
+ ### `webmention endpoint <target>`
29
29
 
30
- Discover the webmention endpoint for the given `<url>` using the [webmention-endpoint-ruby](https://github.com/jgarber623/webmention-endpoint-ruby) gem's endpoint discovery.
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.
31
31
 
32
32
  ```sh
33
33
  $ webmention endpoint https://sixtwothree.org
34
34
  https://sixtwothree.org/webmentions
35
35
  ```
36
36
 
37
+ ### `webmention send <source> <target>`
38
+
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
+
41
+ ```sh
42
+ $ webmention send https://sixtwothree.org/posts/an-engineer-walks-into-a-design-sprint https://adactio.com/journal/6246
43
+ 202 Accepted
44
+ ```
45
+
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
+
37
48
  ### `webmention verify <source> <target>`
38
49
 
39
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.
40
51
 
41
52
  ```sh
42
53
  $ webmention verify https://kartikprabhu.com/notes/re-launching-franciscms https://sixtwothree.org/posts/launching-franciscms-onto-the-indieweb
43
- SUCCESS: https://kartikprabhu.com/notes/re-launching-franciscms links to https://sixtwothree.org/posts/launching-franciscms-onto-the-indieweb
54
+ true
55
+ ```
56
+
57
+ By default, the `verify` command will strictly match URLs. For a bit more flexibility, use the `--no-strict` flag:
58
+
59
+ ```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
44
62
  ```
45
63
 
46
64
  ## Contributing
data/Rakefile CHANGED
@@ -1,6 +1,17 @@
1
1
  require 'bundler/gem_tasks'
2
+
3
+ require 'reek/rake/task'
2
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
3
10
 
4
11
  RSpec::Core::RakeTask.new
5
12
 
6
- task default: :spec
13
+ RuboCop::RakeTask.new do |task|
14
+ task.fail_on_error = false
15
+ end
16
+
17
+ task default: [:rubocop, :reek, :spec]
@@ -3,6 +3,6 @@
3
3
  lib = File.expand_path('../lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
- require 'webmention_cli'
6
+ require 'webmention/cli'
7
7
 
8
- WebmentionCLI::Webmention.start(ARGV)
8
+ Webmention::CLI.start(ARGV)
@@ -0,0 +1,22 @@
1
+ require 'thor'
2
+
3
+ require 'indieweb/endpoints'
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
+
16
+ module Webmention
17
+ module CLI
18
+ def self.start(argv)
19
+ Runner.start(argv)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,20 @@
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
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,22 @@
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
@@ -0,0 +1,17 @@
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
@@ -0,0 +1,71 @@
1
+ module Webmention
2
+ module CLI
3
+ class Runner < Thor
4
+ include Thor::Actions
5
+
6
+ package_name 'Webmention'
7
+
8
+ map ['-v', '--version'] => :__version
9
+
10
+ desc 'endpoint <target>', 'Discover Webmention endpoint for <target> URL'
11
+ def endpoint(target)
12
+ url = Commands::Endpoint.new(target).run
13
+
14
+ raise WebmentionEndpointError unless url
15
+
16
+ say_success(url)
17
+ rescue Error => exception
18
+ say_failure(exception)
19
+ end
20
+
21
+ desc 'send <source> <target>', 'Send a webmention from <source> URL to <target> URL'
22
+ def send(source, target)
23
+ response = Commands::Send.new(source, target).run
24
+
25
+ raise WebmentionEndpointError unless response
26
+
27
+ status = response.status
28
+ location = response.headers[:location]
29
+
30
+ raise WebmentionSendError, status unless status.success?
31
+
32
+ say_success(response.code == 201 && location ? location : status)
33
+ rescue Error => exception
34
+ say_failure(exception)
35
+ end
36
+
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
39
+ def verify(source, target)
40
+ verified = Commands::Verify.new(source, target, options[:strict]).run
41
+
42
+ raise WebmentionVerificationError, verified unless verified
43
+
44
+ say_success(verified)
45
+ rescue Error => exception
46
+ say_failure(exception)
47
+ end
48
+
49
+ desc '--version', 'Print version information'
50
+ def __version
51
+ say "webmention-cli version #{Webmention::CLI::VERSION}"
52
+ 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
+ end
70
+ end
71
+ end
@@ -0,0 +1,5 @@
1
+ module Webmention
2
+ module CLI
3
+ VERSION = '1.3.0'.freeze
4
+ end
5
+ end
@@ -1,13 +1,10 @@
1
- lib = File.expand_path('lib', __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
-
4
- require 'webmention_cli/version'
1
+ require_relative 'lib/webmention/cli/version'
5
2
 
6
3
  Gem::Specification.new do |spec|
7
- spec.required_ruby_version = ['>= 2.4', '< 2.6']
4
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.5', '< 2.8')
8
5
 
9
6
  spec.name = 'webmention-cli'
10
- spec.version = WebmentionCLI::VERSION
7
+ spec.version = Webmention::CLI::VERSION
11
8
  spec.authors = ['Jason Garber']
12
9
  spec.email = ['jason@sixtwothree.org']
13
10
 
@@ -16,21 +13,19 @@ Gem::Specification.new do |spec|
16
13
  spec.homepage = 'https://github.com/jgarber623/webmention-cli'
17
14
  spec.license = 'MIT'
18
15
 
19
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(bin|spec)/}) }
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
20
19
 
21
20
  spec.bindir = 'exe'
22
21
  spec.executables = ['webmention']
23
22
  spec.require_paths = ['lib']
24
23
 
25
- spec.add_development_dependency 'bundler', '~> 1.16', '>= 1.16.3'
26
- spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.1'
27
- spec.add_development_dependency 'rspec', '~> 3.8'
28
- spec.add_development_dependency 'rubocop', '~> 0.58.2'
29
- spec.add_development_dependency 'rubocop-rspec', '~> 1.27'
30
- spec.add_development_dependency 'simplecov', '~> 0.16.1'
31
- spec.add_development_dependency 'simplecov-console', '~> 0.4.2'
24
+ spec.metadata['bug_tracker_uri'] = "#{spec.homepage}/issues"
25
+ spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md"
32
26
 
33
- spec.add_runtime_dependency 'thor', '~> 0.20.0'
34
- spec.add_runtime_dependency 'webmention-endpoint', '~> 1.0', '>= 1.0.1'
35
- spec.add_runtime_dependency 'webmention-verification', '~> 0.1.0'
27
+ spec.add_runtime_dependency 'indieweb-endpoints', '~> 3.0'
28
+ spec.add_runtime_dependency 'thor', '~> 1.0'
29
+ spec.add_runtime_dependency 'webmention', '~> 3.0'
30
+ spec.add_runtime_dependency 'webmention-verification', '~> 3.0'
36
31
  end
metadata CHANGED
@@ -1,173 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmention-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.3.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: 2018-08-15 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: indieweb-endpoints
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.16.3
23
- type: :development
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '1.16'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.16.3
33
- - !ruby/object:Gem::Dependency
34
- name: rake
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '12.3'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 12.3.1
43
- type: :development
44
- prerelease: false
45
- version_requirements: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '12.3'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 12.3.1
53
- - !ruby/object:Gem::Dependency
54
- name: rspec
55
- requirement: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '3.8'
60
- type: :development
61
- prerelease: false
62
- version_requirements: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '3.8'
67
- - !ruby/object:Gem::Dependency
68
- name: rubocop
69
- requirement: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: 0.58.2
74
- type: :development
75
- prerelease: false
76
- version_requirements: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: 0.58.2
81
- - !ruby/object:Gem::Dependency
82
- name: rubocop-rspec
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '1.27'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '1.27'
95
- - !ruby/object:Gem::Dependency
96
- name: simplecov
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: 0.16.1
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: 0.16.1
109
- - !ruby/object:Gem::Dependency
110
- name: simplecov-console
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: 0.4.2
116
- type: :development
19
+ version: '3.0'
20
+ type: :runtime
117
21
  prerelease: false
118
22
  version_requirements: !ruby/object:Gem::Requirement
119
23
  requirements:
120
24
  - - "~>"
121
25
  - !ruby/object:Gem::Version
122
- version: 0.4.2
26
+ version: '3.0'
123
27
  - !ruby/object:Gem::Dependency
124
28
  name: thor
125
29
  requirement: !ruby/object:Gem::Requirement
126
30
  requirements:
127
31
  - - "~>"
128
32
  - !ruby/object:Gem::Version
129
- version: 0.20.0
33
+ version: '1.0'
130
34
  type: :runtime
131
35
  prerelease: false
132
36
  version_requirements: !ruby/object:Gem::Requirement
133
37
  requirements:
134
38
  - - "~>"
135
39
  - !ruby/object:Gem::Version
136
- version: 0.20.0
40
+ version: '1.0'
137
41
  - !ruby/object:Gem::Dependency
138
- name: webmention-endpoint
42
+ name: webmention
139
43
  requirement: !ruby/object:Gem::Requirement
140
44
  requirements:
141
45
  - - "~>"
142
46
  - !ruby/object:Gem::Version
143
- version: '1.0'
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 1.0.1
47
+ version: '3.0'
147
48
  type: :runtime
148
49
  prerelease: false
149
50
  version_requirements: !ruby/object:Gem::Requirement
150
51
  requirements:
151
52
  - - "~>"
152
53
  - !ruby/object:Gem::Version
153
- version: '1.0'
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: 1.0.1
54
+ version: '3.0'
157
55
  - !ruby/object:Gem::Dependency
158
56
  name: webmention-verification
159
57
  requirement: !ruby/object:Gem::Requirement
160
58
  requirements:
161
59
  - - "~>"
162
60
  - !ruby/object:Gem::Version
163
- version: 0.1.0
61
+ version: '3.0'
164
62
  type: :runtime
165
63
  prerelease: false
166
64
  version_requirements: !ruby/object:Gem::Requirement
167
65
  requirements:
168
66
  - - "~>"
169
67
  - !ruby/object:Gem::Version
170
- version: 0.1.0
68
+ version: '3.0'
171
69
  description: A command-line interface for Webmention.
172
70
  email:
173
71
  - jason@sixtwothree.org
@@ -178,6 +76,7 @@ extra_rdoc_files: []
178
76
  files:
179
77
  - ".editorconfig"
180
78
  - ".gitignore"
79
+ - ".reek.yml"
181
80
  - ".rspec"
182
81
  - ".rubocop"
183
82
  - ".rubocop.yml"
@@ -191,14 +90,20 @@ files:
191
90
  - README.md
192
91
  - Rakefile
193
92
  - exe/webmention
194
- - lib/webmention_cli.rb
195
- - lib/webmention_cli/version.rb
196
- - lib/webmention_cli/webmention.rb
93
+ - 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
+ - lib/webmention/cli/runner.rb
99
+ - lib/webmention/cli/version.rb
197
100
  - webmention-cli.gemspec
198
101
  homepage: https://github.com/jgarber623/webmention-cli
199
102
  licenses:
200
103
  - MIT
201
- metadata: {}
104
+ metadata:
105
+ bug_tracker_uri: https://github.com/jgarber623/webmention-cli/issues
106
+ changelog_uri: https://github.com/jgarber623/webmention-cli/blob/v1.3.0/CHANGELOG.md
202
107
  post_install_message:
203
108
  rdoc_options: []
204
109
  require_paths:
@@ -207,18 +112,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
112
  requirements:
208
113
  - - ">="
209
114
  - !ruby/object:Gem::Version
210
- version: '2.4'
115
+ version: '2.5'
211
116
  - - "<"
212
117
  - !ruby/object:Gem::Version
213
- version: '2.6'
118
+ version: '2.8'
214
119
  required_rubygems_version: !ruby/object:Gem::Requirement
215
120
  requirements:
216
121
  - - ">="
217
122
  - !ruby/object:Gem::Version
218
123
  version: '0'
219
124
  requirements: []
220
- rubyforge_project:
221
- rubygems_version: 2.6.14.1
125
+ rubygems_version: 3.1.2
222
126
  signing_key:
223
127
  specification_version: 4
224
128
  summary: A command-line interface for Webmention.
@@ -1,6 +0,0 @@
1
- require 'thor'
2
- require 'webmention/endpoint'
3
- require 'webmention/verification'
4
-
5
- require 'webmention_cli/version'
6
- require 'webmention_cli/webmention'
@@ -1,3 +0,0 @@
1
- module WebmentionCLI
2
- VERSION = '0.1.0'.freeze
3
- end
@@ -1,39 +0,0 @@
1
- module WebmentionCLI
2
- class Webmention < Thor
3
- def self.exit_on_failure?
4
- true
5
- end
6
-
7
- desc 'endpoint <url>', 'Discover webmention endpoint for <url>'
8
- def endpoint(url)
9
- result = ::Webmention::Endpoint.discover(url)
10
-
11
- puts result if result
12
-
13
- exit(result ? true : false)
14
- rescue ::Webmention::Endpoint::ArgumentError, ::Webmention::Endpoint::InvalidURIError
15
- raise Thor::MalformattedArgumentError, "ERROR: Expected '#{url}' to be an absolute URI (e.g. https://example.com)"
16
- end
17
-
18
- # desc 'send <source> <target>', 'Send a webmention from <source> URL to <target> URL'
19
- # def send(source, target)
20
- # puts source
21
- # puts target
22
- # end
23
-
24
- desc 'verify <source> <target>', 'Verify <source> URL links to <target> URL'
25
- def verify(source, target)
26
- result = ::Webmention::Verification.verified?(source, target)
27
-
28
- if result
29
- puts "SUCCESS: #{source} links to #{target}"
30
- else
31
- puts "ERROR: #{source} does not link to #{target}"
32
- end
33
-
34
- exit(result)
35
- rescue ::Webmention::Verification::ArgumentError
36
- raise Thor::MalformattedArgumentError, "ERROR: Expected '#{source}' and '#{target}' to be absolute URIs (e.g. https://example.com)"
37
- end
38
- end
39
- end