githuh 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +15 -12
- data/LICENSE +2 -2
- data/README.md +7 -2
- data/codecov.yml +28 -0
- data/docs/img/coverage.svg +16 -18
- data/lib/githuh/cli/commands/repo/list.rb +1 -1
- data/lib/githuh/cli/launcher.rb +30 -22
- data/lib/githuh/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3a45fc490639008c37abdd3146bed48d32e37f6ac8dbdb1ff6233ae09f7f02d
|
4
|
+
data.tar.gz: 8c0b02873e0610f53ec6fbda2929e0f4bff89c038a89cbfcb8781c64f6799617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c4f4028647cba9c4ac7e911186fbe13627d3337aa6179c2b6e658d1fb8e65030006b8ff8e5959cfed11304c4eac0aec31e6081c5cd02b817e3e7d414201d1d9
|
7
|
+
data.tar.gz: 2615059a09a55172b2aade924cfe98468060459f71905d7219516c47342cbf324ed9ac2cd17fb25ae7c81f36d0e4174416d5b9334e7a32264a9e41e7179296f3
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
githuh (0.
|
4
|
+
githuh (0.2.0)
|
5
5
|
colored2 (~> 3)
|
6
6
|
dry-cli (~> 0.6)
|
7
7
|
octokit (~> 4)
|
@@ -21,11 +21,11 @@ GEM
|
|
21
21
|
rspec-expectations (~> 3.4)
|
22
22
|
thor (~> 1.0)
|
23
23
|
awesome_print (1.8.0)
|
24
|
-
backports (3.
|
24
|
+
backports (3.17.1)
|
25
25
|
builder (3.2.4)
|
26
26
|
childprocess (3.0.0)
|
27
27
|
colored2 (3.1.2)
|
28
|
-
concurrent-ruby (1.1.
|
28
|
+
concurrent-ruby (1.1.7)
|
29
29
|
contracts (0.16.0)
|
30
30
|
cucumber (3.1.2)
|
31
31
|
builder (>= 2.1.2)
|
@@ -48,20 +48,20 @@ GEM
|
|
48
48
|
dry-cli (0.6.0)
|
49
49
|
concurrent-ruby (~> 1.0)
|
50
50
|
equatable (0.6.1)
|
51
|
-
faraday (1.0.
|
51
|
+
faraday (1.0.1)
|
52
52
|
multipart-post (>= 1.2, < 3)
|
53
53
|
ffi (1.12.2)
|
54
54
|
gherkin (5.1.0)
|
55
55
|
multi_json (1.14.1)
|
56
56
|
multi_test (0.1.2)
|
57
57
|
multipart-post (2.1.1)
|
58
|
-
octokit (4.
|
58
|
+
octokit (4.18.0)
|
59
59
|
faraday (>= 0.9)
|
60
60
|
sawyer (~> 0.8.0, >= 0.5.3)
|
61
61
|
pastel (0.7.3)
|
62
62
|
equatable (~> 0.6)
|
63
63
|
tty-color (~> 0.5)
|
64
|
-
public_suffix (4.0.
|
64
|
+
public_suffix (4.0.5)
|
65
65
|
rake (13.0.1)
|
66
66
|
rspec (3.9.0)
|
67
67
|
rspec-core (~> 3.9.0)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
rspec-mocks (~> 3.9.0)
|
70
70
|
rspec-core (3.9.1)
|
71
71
|
rspec-support (~> 3.9.1)
|
72
|
-
rspec-expectations (3.9.
|
72
|
+
rspec-expectations (3.9.1)
|
73
73
|
diff-lcs (>= 1.2.0, < 2.0)
|
74
74
|
rspec-support (~> 3.9.0)
|
75
75
|
rspec-its (1.3.0)
|
@@ -91,7 +91,7 @@ GEM
|
|
91
91
|
strings-ansi (~> 0.1)
|
92
92
|
unicode-display_width (~> 1.5)
|
93
93
|
unicode_utils (~> 1.4)
|
94
|
-
strings-ansi (0.
|
94
|
+
strings-ansi (0.1.0)
|
95
95
|
thor (1.0.1)
|
96
96
|
tty-box (0.5.0)
|
97
97
|
pastel (~> 0.7.2)
|
@@ -99,9 +99,12 @@ GEM
|
|
99
99
|
tty-cursor (~> 0.7)
|
100
100
|
tty-color (0.5.1)
|
101
101
|
tty-cursor (0.7.1)
|
102
|
-
tty-progressbar (0.
|
103
|
-
|
104
|
-
|
102
|
+
tty-progressbar (0.17.0)
|
103
|
+
strings-ansi (~> 0.1.0)
|
104
|
+
tty-cursor (~> 0.7)
|
105
|
+
tty-screen (~> 0.7)
|
106
|
+
unicode-display_width (~> 1.6)
|
107
|
+
tty-screen (0.7.1)
|
105
108
|
unicode-display_width (1.7.0)
|
106
109
|
unicode_utils (1.4.0)
|
107
110
|
|
@@ -120,4 +123,4 @@ DEPENDENCIES
|
|
120
123
|
simplecov-formatter-badge
|
121
124
|
|
122
125
|
BUNDLED WITH
|
123
|
-
2.1.
|
126
|
+
2.1.4
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright ©
|
1
|
+
Copyright © 2000-present Konstantin Gredeskoul, all rights reserved.
|
2
2
|
|
3
3
|
MIT License
|
4
4
|
|
@@ -16,7 +16,7 @@ included in all copies or substantial portions of the Software.
|
|
16
16
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
17
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
18
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
|
19
|
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
22
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -93,6 +93,11 @@ This command prints the info about currently authenticated user.
|
|
93
93
|
|
94
94
|
```
|
95
95
|
|
96
|
-
##
|
96
|
+
## Contributing
|
97
|
+
|
98
|
+
Please submit a pull request at https://github.com/kigster/githuh/pulls
|
99
|
+
|
100
|
+
## License
|
101
|
+
|
102
|
+
© 2020 Konstantin Gredeskoul, [MIT License](LICENSE)
|
97
103
|
|
98
|
-
© 2020 Konstantin Gredeskoul
|
data/codecov.yml
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
codecov:
|
2
|
+
require_ci_to_pass: no
|
3
|
+
|
4
|
+
notify:
|
5
|
+
after_n_builds: 30
|
6
|
+
wait_for_ci: yes
|
7
|
+
|
8
|
+
parsers:
|
9
|
+
v1:
|
10
|
+
include_full_missed_files: true # To use with Ruby so we see files that have NO tests written
|
11
|
+
|
12
|
+
coverage:
|
13
|
+
precision: 1
|
14
|
+
status:
|
15
|
+
project:
|
16
|
+
default: off
|
17
|
+
githuh
|
18
|
+
target: 20%
|
19
|
+
threshold: 100%
|
20
|
+
informational: true
|
21
|
+
if_not_found: success
|
22
|
+
if_ci_failed: error
|
23
|
+
paths:
|
24
|
+
- lib/
|
25
|
+
flags:
|
26
|
+
githuh:
|
27
|
+
paths:
|
28
|
+
- lib/
|
data/docs/img/coverage.svg
CHANGED
@@ -1,19 +1,17 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<rect
|
8
|
-
|
9
|
-
<
|
10
|
-
<
|
11
|
-
<
|
12
|
-
|
13
|
-
</
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
<text x="755" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">67%</text>
|
18
|
-
<text x="755" y="140" transform="scale(.1)" textLength="250">67%</text></g>
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="130" height="20">
|
3
|
+
<linearGradient id="a" x2="0" y2="100%">
|
4
|
+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
5
|
+
<stop offset="1" stop-opacity=".1"/>
|
6
|
+
</linearGradient>
|
7
|
+
<rect rx="5" width="130" height="20" fill="#555"/>
|
8
|
+
<rect rx="5" width="130" height="20" fill="url(#a)"/>
|
9
|
+
<rect rx="5" x="80" width="50" height="20" fill="#4BAF00"/>
|
10
|
+
<rect rx="5" x="80" width="50" height="20" fill="url(#a)"/>
|
11
|
+
<g fill="#fff" text-anchor="middle" font-weight="800" font-family="Consolas,DejaVu Sans,Verdana,Geneva,sans-serif" font-size="12">
|
12
|
+
<text x="40.5" y="15" fill="#010101" fill-opacity=".3">COVERAGE</text>
|
13
|
+
<text x="41.5" y="14">COVERAGE</text>
|
14
|
+
<text x="105.5" y="15" fill="#010101" fill-opacity=".3">67%</text>
|
15
|
+
<text x="106.5" y="14">67%</text>
|
16
|
+
</g>
|
19
17
|
</svg>
|
@@ -53,7 +53,7 @@ module Githuh
|
|
53
53
|
width: ui_width,
|
54
54
|
padding: 1)
|
55
55
|
puts
|
56
|
-
# ——————————
|
56
|
+
# —————————— actually get all repositories ———————————————
|
57
57
|
self.file.write send("render_as_#{format}", repositories)
|
58
58
|
# ————————————————————————————————————————————————————————
|
59
59
|
|
data/lib/githuh/cli/launcher.rb
CHANGED
@@ -4,10 +4,11 @@ require 'dry/cli'
|
|
4
4
|
require 'forwardable'
|
5
5
|
require 'tty/box'
|
6
6
|
|
7
|
+
require 'githuh'
|
7
8
|
module Githuh
|
8
9
|
module CLI
|
9
10
|
class Launcher
|
10
|
-
attr_accessor :argv, :stdin, :stdout, :stderr, :kernel
|
11
|
+
attr_accessor :argv, :stdin, :stdout, :stderr, :kernel, :command
|
11
12
|
|
12
13
|
def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = nil)
|
13
14
|
if ::Githuh.launcher
|
@@ -25,38 +26,45 @@ module Githuh
|
|
25
26
|
|
26
27
|
def execute!
|
27
28
|
if argv.empty? || !(%w(--help -h) & argv).empty?
|
28
|
-
stdout.puts
|
29
|
-
|
30
|
-
#{'Githuh CLI'.bold.yellow} #{::Githuh::VERSION.bold.green} — API client for Github.com.
|
31
|
-
#{'© 2020 Konstantin Gredeskoul, All rights reserved. MIT License.'.cyan}
|
32
|
-
|
33
|
-
BANNER
|
34
|
-
|
29
|
+
stdout.puts BANNER
|
35
30
|
Githuh.configure_kernel_behavior! help: true
|
36
31
|
else
|
37
32
|
Githuh.configure_kernel_behavior!
|
38
33
|
end
|
39
34
|
|
40
|
-
::Dry::CLI.new(Commands)
|
35
|
+
self.command = ::Dry::CLI.new(::Githuh::CLI::Commands)
|
36
|
+
command.call(arguments: argv, out: stdout, err: stderr)
|
37
|
+
|
41
38
|
rescue StandardError => e
|
42
|
-
box = TTY::Box.frame('ERROR:', ' ',
|
43
|
-
e.message,
|
44
|
-
padding: 1,
|
45
|
-
align: :left,
|
46
|
-
title: { top_center: Githuh::BANNER },
|
47
|
-
width: 80,
|
48
|
-
style: {
|
49
|
-
bg: :red,
|
50
|
-
border: {
|
51
|
-
fg: :bright_yellow,
|
52
|
-
bg: :red
|
53
|
-
}
|
54
|
-
})
|
39
|
+
box = TTY::Box.frame('ERROR:', ' ', e.message, **BOX_OPTIONS)
|
55
40
|
stderr.print box
|
41
|
+
|
56
42
|
ensure
|
57
43
|
Githuh.restore_kernel_behavior!
|
58
44
|
exit(10) unless Githuh.in_test
|
59
45
|
end
|
60
46
|
end
|
47
|
+
|
48
|
+
BANNER = <<~BANNER
|
49
|
+
|
50
|
+
#{'Githuh CLI'.bold.yellow} #{::Githuh::VERSION.bold.green} — API client for Github.com.
|
51
|
+
#{'© 2020 Konstantin Gredeskoul, All rights reserved. MIT License.'.cyan}
|
52
|
+
|
53
|
+
BANNER
|
54
|
+
|
55
|
+
BOX_OPTIONS = {
|
56
|
+
padding: 1,
|
57
|
+
align: :left,
|
58
|
+
title: { top_center: Githuh::BANNER },
|
59
|
+
width: 80,
|
60
|
+
style: {
|
61
|
+
bg: :red,
|
62
|
+
border: {
|
63
|
+
fg: :bright_yellow,
|
64
|
+
bg: :red
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}.freeze
|
68
|
+
|
61
69
|
end
|
62
70
|
end
|
data/lib/githuh/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githuh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Gredeskoul
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored2
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- README.md
|
211
211
|
- Rakefile
|
212
212
|
- WARRANTY.md
|
213
|
+
- codecov.yml
|
213
214
|
- docs/img/coverage.svg
|
214
215
|
- exe/githuh
|
215
216
|
- githuh.gemspec
|
@@ -224,7 +225,7 @@ homepage: https://github.com/kigster/githuh
|
|
224
225
|
licenses:
|
225
226
|
- MIT
|
226
227
|
metadata: {}
|
227
|
-
post_install_message:
|
228
|
+
post_install_message:
|
228
229
|
rdoc_options: []
|
229
230
|
require_paths:
|
230
231
|
- lib
|
@@ -239,8 +240,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
240
|
- !ruby/object:Gem::Version
|
240
241
|
version: '0'
|
241
242
|
requirements: []
|
242
|
-
rubygems_version: 3.1.
|
243
|
-
signing_key:
|
243
|
+
rubygems_version: 3.1.4
|
244
|
+
signing_key:
|
244
245
|
specification_version: 4
|
245
246
|
summary: Extensible CLI helper client for Github, for automating various tasks, such
|
246
247
|
as — generating a list of org's repos and converting it into a pretty markdown,
|