dishwasher 0.0.1 → 0.0.2
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 +4 -4
- data/.all-contributorsrc +37 -0
- data/.github/workflows/standardrb.yml +23 -0
- data/{lib/dishwasher/test.yml → .github/workflows/tests.yml} +10 -3
- data/Gemfile +4 -1
- data/Gemfile.lock +55 -16
- data/README.md +34 -4
- data/bin/console +2 -6
- data/bin/loc +3 -0
- data/bin/standardize +3 -0
- data/dishwasher.gemspec +10 -4
- data/exe/dishwasher +19 -0
- data/lib/dishwasher.rb +15 -2
- data/lib/dishwasher/delete_forks.rb +28 -0
- data/lib/dishwasher/github.rb +119 -0
- data/lib/dishwasher/message_formatter.rb +30 -0
- data/lib/dishwasher/version.rb +1 -1
- metadata +72 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 980f32c628420008c423eac255e4f4a8834c3a39de97f3beb7141800c79f9c4f
|
|
4
|
+
data.tar.gz: 35ccde08e9977d7b33d2b958a617c2bf6b709ff55425fee77210089d62fd76af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea4907a55e8b39e7fa314bc3d042780d6402aa296225d7337873c5f67032ca883a327955862e1c2d6196a341a668d8f5674242a6df4d159d697f4c2e58b8ffd9
|
|
7
|
+
data.tar.gz: 4c7015f6f3c43c81d342e29b3f87ce52c50550ea0b45bd50991a554a28b38105513001f6c9303462c4210680dfedb23820732dac5259c083bb2716b2a116d9f8
|
data/.all-contributorsrc
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
"README.md"
|
|
4
|
+
],
|
|
5
|
+
"imageSize": 100,
|
|
6
|
+
"commit": false,
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"login": "andrewmcodes",
|
|
10
|
+
"name": "Andrew Mason",
|
|
11
|
+
"avatar_url": "https://avatars1.githubusercontent.com/u/18423853?v=4",
|
|
12
|
+
"profile": "https://www.andrewmason.me/",
|
|
13
|
+
"contributions": [
|
|
14
|
+
"code",
|
|
15
|
+
"doc",
|
|
16
|
+
"tool",
|
|
17
|
+
"test",
|
|
18
|
+
"maintenance"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"login": "krainboltgreene",
|
|
23
|
+
"name": "Kurtis Rainbolt-Greene",
|
|
24
|
+
"avatar_url": "https://avatars1.githubusercontent.com/u/334809?v=4",
|
|
25
|
+
"profile": "https://www.kurtis.rainbolt-greene.online",
|
|
26
|
+
"contributions": [
|
|
27
|
+
"bug"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"contributorsPerLine": 7,
|
|
32
|
+
"projectName": "dishwasher",
|
|
33
|
+
"projectOwner": "andrewmcodes",
|
|
34
|
+
"repoType": "github",
|
|
35
|
+
"repoHost": "https://github.com",
|
|
36
|
+
"skipCi": true
|
|
37
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: StandardRB
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- '*'
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: StandardRB Check Action
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@master
|
|
17
|
+
- name: Build and test with Rake
|
|
18
|
+
run: |
|
|
19
|
+
gem install bundler
|
|
20
|
+
bundle install --jobs 4 --retry 3
|
|
21
|
+
bundle exec standardrb --format progress
|
|
22
|
+
container:
|
|
23
|
+
image: ruby:2.6.5
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: Tests
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- '*'
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
4
10
|
|
|
5
11
|
jobs:
|
|
6
12
|
build:
|
|
13
|
+
name: Ruby Test Action
|
|
7
14
|
runs-on: ubuntu-latest
|
|
8
15
|
steps:
|
|
9
16
|
- uses: actions/checkout@master
|
|
@@ -13,4 +20,4 @@ jobs:
|
|
|
13
20
|
bundle install --jobs 4 --retry 3
|
|
14
21
|
bundle exec rake test
|
|
15
22
|
container:
|
|
16
|
-
image: ruby:2.6.
|
|
23
|
+
image: ruby:2.6.5
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,43 +1,82 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
dishwasher (0.0.
|
|
4
|
+
dishwasher (0.0.2)
|
|
5
|
+
artii
|
|
6
|
+
octokit (~> 4.0)
|
|
7
|
+
tty-prompt (~> 0.19)
|
|
5
8
|
|
|
6
9
|
GEM
|
|
7
10
|
remote: https://rubygems.org/
|
|
8
11
|
specs:
|
|
12
|
+
addressable (2.7.0)
|
|
13
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
14
|
+
artii (2.1.2)
|
|
9
15
|
ast (2.4.0)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
coderay (1.1.2)
|
|
17
|
+
equatable (0.6.1)
|
|
18
|
+
faraday (1.0.0)
|
|
19
|
+
multipart-post (>= 1.2, < 3)
|
|
20
|
+
jaro_winkler (1.5.4)
|
|
21
|
+
method_source (0.9.2)
|
|
22
|
+
minitest (5.13.0)
|
|
23
|
+
multipart-post (2.1.1)
|
|
24
|
+
necromancer (0.5.1)
|
|
25
|
+
octokit (4.15.0)
|
|
26
|
+
faraday (>= 0.9)
|
|
27
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
|
28
|
+
parallel (1.19.1)
|
|
29
|
+
parser (2.7.0.1)
|
|
14
30
|
ast (~> 2.4.0)
|
|
31
|
+
pastel (0.7.3)
|
|
32
|
+
equatable (~> 0.6)
|
|
33
|
+
tty-color (~> 0.5)
|
|
34
|
+
pry (0.12.2)
|
|
35
|
+
coderay (~> 1.1.0)
|
|
36
|
+
method_source (~> 0.9.0)
|
|
37
|
+
public_suffix (4.0.2)
|
|
15
38
|
rainbow (3.0.0)
|
|
16
|
-
rake (
|
|
17
|
-
rubocop (0.
|
|
39
|
+
rake (13.0.1)
|
|
40
|
+
rubocop (0.77.0)
|
|
18
41
|
jaro_winkler (~> 1.5.1)
|
|
19
42
|
parallel (~> 1.10)
|
|
20
43
|
parser (>= 2.6)
|
|
21
44
|
rainbow (>= 2.2.2, < 4.0)
|
|
22
45
|
ruby-progressbar (~> 1.7)
|
|
23
46
|
unicode-display_width (>= 1.4.0, < 1.7)
|
|
24
|
-
rubocop-performance (1.5.
|
|
47
|
+
rubocop-performance (1.5.2)
|
|
25
48
|
rubocop (>= 0.71.0)
|
|
26
49
|
ruby-progressbar (1.10.1)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
sawyer (0.8.2)
|
|
51
|
+
addressable (>= 2.3.5)
|
|
52
|
+
faraday (> 0.8, < 2.0)
|
|
53
|
+
standard (0.1.7)
|
|
54
|
+
rubocop (~> 0.77.0)
|
|
55
|
+
rubocop-performance (~> 1.5.1)
|
|
56
|
+
tty-color (0.5.0)
|
|
57
|
+
tty-cursor (0.7.0)
|
|
58
|
+
tty-prompt (0.20.0)
|
|
59
|
+
necromancer (~> 0.5.0)
|
|
60
|
+
pastel (~> 0.7.0)
|
|
61
|
+
tty-reader (~> 0.7.0)
|
|
62
|
+
tty-reader (0.7.0)
|
|
63
|
+
tty-cursor (~> 0.7)
|
|
64
|
+
tty-screen (~> 0.7)
|
|
65
|
+
wisper (~> 2.0.0)
|
|
66
|
+
tty-screen (0.7.0)
|
|
30
67
|
unicode-display_width (1.6.0)
|
|
68
|
+
wisper (2.0.1)
|
|
31
69
|
|
|
32
70
|
PLATFORMS
|
|
33
71
|
ruby
|
|
34
72
|
|
|
35
73
|
DEPENDENCIES
|
|
36
|
-
bundler
|
|
74
|
+
bundler
|
|
37
75
|
dishwasher!
|
|
38
|
-
minitest (~> 5.0)
|
|
39
|
-
|
|
40
|
-
|
|
76
|
+
minitest (~> 5.13.0)
|
|
77
|
+
pry
|
|
78
|
+
rake
|
|
79
|
+
standard
|
|
41
80
|
|
|
42
81
|
BUNDLED WITH
|
|
43
|
-
2.
|
|
82
|
+
2.1.1
|
data/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
[](#contributors)
|
|
2
|
+

|
|
3
|
+

|
|
4
|
+
|
|
1
5
|
# Dishwasher
|
|
2
6
|
|
|
3
7
|
A CLI tool written in Ruby to help you remove unneeded GitHub forks.
|
|
@@ -10,7 +14,7 @@ A CLI tool written in Ruby to help you remove unneeded GitHub forks.
|
|
|
10
14
|
|
|
11
15
|
## Usage
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
Update with real documentation...
|
|
14
18
|
|
|
15
19
|
## Development
|
|
16
20
|
|
|
@@ -20,12 +24,38 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
20
24
|
|
|
21
25
|
## Contributing
|
|
22
26
|
|
|
23
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
27
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/andrewmcodes/dishwasher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
28
|
+
|
|
29
|
+
### Code of Conduct
|
|
30
|
+
|
|
31
|
+
Everyone interacting in the Dishwasher project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/andrewmcodes/dishwasher/blob/master/CODE_OF_CONDUCT.md).
|
|
32
|
+
|
|
33
|
+
### Coding Standards
|
|
34
|
+
|
|
35
|
+
This project uses [Standard](https://github.com/testdouble/standard) to minimize bike shedding related to code formatting.
|
|
36
|
+
|
|
37
|
+
Please run `./bin/standardize` prior submitting pull requests.
|
|
24
38
|
|
|
25
39
|
## License
|
|
26
40
|
|
|
27
41
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
28
42
|
|
|
29
|
-
##
|
|
43
|
+
## Contributors ✨
|
|
44
|
+
|
|
45
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
46
|
+
|
|
47
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
48
|
+
<!-- prettier-ignore-start -->
|
|
49
|
+
<!-- markdownlint-disable -->
|
|
50
|
+
<table>
|
|
51
|
+
<tr>
|
|
52
|
+
<td align="center"><a href="https://www.andrewmason.me/"><img src="https://avatars1.githubusercontent.com/u/18423853?v=4" width="100px;" alt=""/><br /><sub><b>Andrew Mason</b></sub></a><br /><a href="https://github.com/andrewmcodes/dishwasher/commits?author=andrewmcodes" title="Code">💻</a> <a href="https://github.com/andrewmcodes/dishwasher/commits?author=andrewmcodes" title="Documentation">📖</a> <a href="#tool-andrewmcodes" title="Tools">🔧</a> <a href="https://github.com/andrewmcodes/dishwasher/commits?author=andrewmcodes" title="Tests">⚠️</a> <a href="#maintenance-andrewmcodes" title="Maintenance">🚧</a></td>
|
|
53
|
+
<td align="center"><a href="https://www.kurtis.rainbolt-greene.online"><img src="https://avatars1.githubusercontent.com/u/334809?v=4" width="100px;" alt=""/><br /><sub><b>Kurtis Rainbolt-Greene</b></sub></a><br /><a href="https://github.com/andrewmcodes/dishwasher/issues?q=author%3Akrainboltgreene" title="Bug reports">🐛</a></td>
|
|
54
|
+
</tr>
|
|
55
|
+
</table>
|
|
56
|
+
|
|
57
|
+
<!-- markdownlint-enable -->
|
|
58
|
+
<!-- prettier-ignore-end -->
|
|
59
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
30
60
|
|
|
31
|
-
|
|
61
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
data/bin/console
CHANGED
|
@@ -6,9 +6,5 @@ require "dishwasher"
|
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start(__FILE__)
|
|
9
|
+
require "pry"
|
|
10
|
+
Pry.start
|
data/bin/loc
ADDED
data/bin/standardize
ADDED
data/dishwasher.gemspec
CHANGED
|
@@ -25,8 +25,14 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
26
26
|
spec.require_paths = ["lib"]
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
spec.
|
|
30
|
-
spec.
|
|
31
|
-
spec.
|
|
28
|
+
# Dependencies
|
|
29
|
+
spec.add_dependency "artii"
|
|
30
|
+
spec.add_dependency "octokit", "~> 4.0"
|
|
31
|
+
spec.add_dependency "tty-prompt", "~> 0.19"
|
|
32
|
+
|
|
33
|
+
# Development Dependencies
|
|
34
|
+
spec.add_development_dependency "bundler"
|
|
35
|
+
spec.add_development_dependency "pry"
|
|
36
|
+
spec.add_development_dependency "rake"
|
|
37
|
+
spec.add_development_dependency "standard"
|
|
32
38
|
end
|
data/exe/dishwasher
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
|
4
|
+
|
|
5
|
+
require "dishwasher"
|
|
6
|
+
|
|
7
|
+
begin
|
|
8
|
+
Dishwasher.start
|
|
9
|
+
rescue SignalException => e
|
|
10
|
+
if Signal.signame(e.signo) == "TERM"
|
|
11
|
+
exit(0)
|
|
12
|
+
else
|
|
13
|
+
raise
|
|
14
|
+
end
|
|
15
|
+
rescue
|
|
16
|
+
exit(1)
|
|
17
|
+
else
|
|
18
|
+
exit(0)
|
|
19
|
+
end
|
data/lib/dishwasher.rb
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
require "artii"
|
|
2
|
+
require "octokit"
|
|
3
|
+
require "tty-prompt"
|
|
4
|
+
|
|
5
|
+
require "dishwasher/message_formatter"
|
|
6
|
+
require "dishwasher/github"
|
|
7
|
+
require "dishwasher/delete_forks"
|
|
1
8
|
require "dishwasher/version"
|
|
2
9
|
|
|
3
10
|
module Dishwasher
|
|
4
|
-
class
|
|
5
|
-
|
|
11
|
+
class << self
|
|
12
|
+
def start
|
|
13
|
+
puts Artii::Base.new.asciify("Dishwasher")
|
|
14
|
+
cs = Dishwasher::Github.confirmed_selections
|
|
15
|
+
Dishwasher::DeleteForks.delete(cs)
|
|
16
|
+
true
|
|
17
|
+
end
|
|
18
|
+
end
|
|
6
19
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Dishwasher
|
|
2
|
+
module DeleteForks
|
|
3
|
+
class << self
|
|
4
|
+
include MessageFormatter
|
|
5
|
+
#
|
|
6
|
+
# Loop to delete the selected forked repos
|
|
7
|
+
#
|
|
8
|
+
# @return [string] confirmation_message
|
|
9
|
+
#
|
|
10
|
+
def delete(selections)
|
|
11
|
+
title_message("Deleting Forks")
|
|
12
|
+
selections.each do |s|
|
|
13
|
+
Dishwasher::Github.delete_repo(s)
|
|
14
|
+
end
|
|
15
|
+
confirmation_message
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
#
|
|
19
|
+
# Confirmation message that the repos were removed
|
|
20
|
+
#
|
|
21
|
+
# @return [string] forks deleted message
|
|
22
|
+
#
|
|
23
|
+
def confirmation_message
|
|
24
|
+
title_message("Forks Deleted")
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
module Dishwasher
|
|
2
|
+
module Github
|
|
3
|
+
class << self
|
|
4
|
+
include MessageFormatter
|
|
5
|
+
#
|
|
6
|
+
# Initialize new TTY Prompt
|
|
7
|
+
#
|
|
8
|
+
# @return [object] TTY::Prompt
|
|
9
|
+
#
|
|
10
|
+
def prompt
|
|
11
|
+
@prompt ||= TTY::Prompt.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
#
|
|
15
|
+
# Get GitHub Access Token so we can authenticate with GitHub's API
|
|
16
|
+
#
|
|
17
|
+
# @return [string] GitHub Access Token
|
|
18
|
+
#
|
|
19
|
+
def token
|
|
20
|
+
@token ||= prompt.mask(title_message("What is your GitHub Personal Access Token?"), default: ENV["GITHUB_ACCESS_TOKEN"])
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
# GitHub Client Object
|
|
25
|
+
#
|
|
26
|
+
# @return [object] GitHub Client Object
|
|
27
|
+
#
|
|
28
|
+
def client
|
|
29
|
+
@client ||= Octokit::Client.new(access_token: token, per_page: 1000)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
#
|
|
33
|
+
# Delete passed in repository ID
|
|
34
|
+
#
|
|
35
|
+
# @param [int] r repository ID
|
|
36
|
+
#
|
|
37
|
+
# @return [Boolean] success or failure
|
|
38
|
+
#
|
|
39
|
+
def delete_repo(r)
|
|
40
|
+
client.delete_repository(r)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
#
|
|
44
|
+
# Repositories for the client object
|
|
45
|
+
#
|
|
46
|
+
# @return [object] repository objects
|
|
47
|
+
#
|
|
48
|
+
def repos
|
|
49
|
+
client.repos(user: client.user, query: {type: "owner", sort: "asc"})
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
#
|
|
53
|
+
# All forked repositories for the client
|
|
54
|
+
#
|
|
55
|
+
# @return [object] all forked repositories for the client
|
|
56
|
+
#
|
|
57
|
+
def forks
|
|
58
|
+
repos.select { |hash| hash[:fork] == true }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
#
|
|
62
|
+
# Potential choices to choose from for deletion
|
|
63
|
+
#
|
|
64
|
+
# @return [hash] key: repo name, value: repo id
|
|
65
|
+
#
|
|
66
|
+
def choices
|
|
67
|
+
forks.map { |f| [f[:full_name], f[:id]] }.to_h
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
#
|
|
71
|
+
# Selected forks for deletion
|
|
72
|
+
#
|
|
73
|
+
# @return [array] array of repo id's
|
|
74
|
+
#
|
|
75
|
+
def confirmed_selections
|
|
76
|
+
selections = selection(choices)
|
|
77
|
+
no_selections if selections.empty?
|
|
78
|
+
confirmation_prompt ? selections : canceled_message
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
#
|
|
82
|
+
# Prompt to confirm deletion of repos
|
|
83
|
+
#
|
|
84
|
+
# @return [boolean] T:F depending on selection
|
|
85
|
+
#
|
|
86
|
+
def confirmation_prompt
|
|
87
|
+
title_message("Are you sure you want to delete these forked repos?")
|
|
88
|
+
prompt.yes?("→")
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
#
|
|
92
|
+
# Array of selected id's
|
|
93
|
+
#
|
|
94
|
+
# @return [array] repo id's chosen for deletion
|
|
95
|
+
#
|
|
96
|
+
def selection(c)
|
|
97
|
+
prompt.multi_select(title_message("Select forks to delete"), c)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
#
|
|
101
|
+
# No selection message
|
|
102
|
+
#
|
|
103
|
+
# @return [string] message indicating no selections were made
|
|
104
|
+
#
|
|
105
|
+
def no_selections
|
|
106
|
+
abort_message("No selections were made.")
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
#
|
|
110
|
+
# Canceled message
|
|
111
|
+
#
|
|
112
|
+
# @return [string] message indicating the operation was canceled
|
|
113
|
+
#
|
|
114
|
+
def canceled_message
|
|
115
|
+
abort_message("Operation canceled by user.")
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module Dishwasher
|
|
2
|
+
module MessageFormatter
|
|
3
|
+
#
|
|
4
|
+
# Title message formatter
|
|
5
|
+
#
|
|
6
|
+
# @return [string] formatted title string
|
|
7
|
+
#
|
|
8
|
+
def title_message(message)
|
|
9
|
+
puts "\n==== #{message} ====\n"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
#
|
|
13
|
+
# Abort message formatter
|
|
14
|
+
#
|
|
15
|
+
# @return [string] formatted abort string
|
|
16
|
+
#
|
|
17
|
+
def abort_message(message)
|
|
18
|
+
abort "\n==== #{message} ====\n"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Body message formatter
|
|
23
|
+
#
|
|
24
|
+
# @return [string] formatted body string
|
|
25
|
+
#
|
|
26
|
+
def body_message(message)
|
|
27
|
+
puts "\n#{message}\n"
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/dishwasher/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,78 +1,124 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dishwasher
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Mason
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-01-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: artii
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: octokit
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
16
30
|
requirements:
|
|
17
31
|
- - "~>"
|
|
18
32
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
20
|
-
type: :
|
|
33
|
+
version: '4.0'
|
|
34
|
+
type: :runtime
|
|
21
35
|
prerelease: false
|
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
37
|
requirements:
|
|
24
38
|
- - "~>"
|
|
25
39
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
40
|
+
version: '4.0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
42
|
+
name: tty-prompt
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
30
44
|
requirements:
|
|
31
45
|
- - "~>"
|
|
32
46
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
34
|
-
type: :
|
|
47
|
+
version: '0.19'
|
|
48
|
+
type: :runtime
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
52
|
- - "~>"
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
54
|
+
version: '0.19'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
56
|
+
name: bundler
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
|
-
- - "
|
|
59
|
+
- - ">="
|
|
46
60
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
61
|
+
version: '0'
|
|
48
62
|
type: :development
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
|
-
- - "
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: pry
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rake
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
53
88
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
55
97
|
- !ruby/object:Gem::Dependency
|
|
56
98
|
name: standard
|
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
|
58
100
|
requirements:
|
|
59
|
-
- - "
|
|
101
|
+
- - ">="
|
|
60
102
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0
|
|
103
|
+
version: '0'
|
|
62
104
|
type: :development
|
|
63
105
|
prerelease: false
|
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
107
|
requirements:
|
|
66
|
-
- - "
|
|
108
|
+
- - ">="
|
|
67
109
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0
|
|
110
|
+
version: '0'
|
|
69
111
|
description: A CLI tool written in Ruby to help you remove unneeded GitHub forks.
|
|
70
112
|
email:
|
|
71
113
|
- andrewmcodes@protonmail.com
|
|
72
|
-
executables:
|
|
114
|
+
executables:
|
|
115
|
+
- dishwasher
|
|
73
116
|
extensions: []
|
|
74
117
|
extra_rdoc_files: []
|
|
75
118
|
files:
|
|
119
|
+
- ".all-contributorsrc"
|
|
120
|
+
- ".github/workflows/standardrb.yml"
|
|
121
|
+
- ".github/workflows/tests.yml"
|
|
76
122
|
- ".gitignore"
|
|
77
123
|
- CODE_OF_CONDUCT.md
|
|
78
124
|
- Gemfile
|
|
@@ -81,11 +127,16 @@ files:
|
|
|
81
127
|
- README.md
|
|
82
128
|
- Rakefile
|
|
83
129
|
- bin/console
|
|
130
|
+
- bin/loc
|
|
84
131
|
- bin/setup
|
|
132
|
+
- bin/standardize
|
|
85
133
|
- bin/standardrb
|
|
86
134
|
- dishwasher.gemspec
|
|
135
|
+
- exe/dishwasher
|
|
87
136
|
- lib/dishwasher.rb
|
|
88
|
-
- lib/dishwasher/
|
|
137
|
+
- lib/dishwasher/delete_forks.rb
|
|
138
|
+
- lib/dishwasher/github.rb
|
|
139
|
+
- lib/dishwasher/message_formatter.rb
|
|
89
140
|
- lib/dishwasher/version.rb
|
|
90
141
|
homepage: https://github.com/andrewmcodes/dishwasher
|
|
91
142
|
licenses:
|