octokitty 1.1.0 → 1.2.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 +4 -4
- data/bin/octokitty +5 -4
- data/octokitty.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7f6b03ab25315b66d56cfc7ff794f35a990b69a
|
4
|
+
data.tar.gz: 79b4de898368d44df0d31f067bf6c04d6d19721c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7d5d69991105e7e841687c32b53b0da45372b0ce7b5041d48236d0f423a52f1445ab77bcf7c199d55859e759b518e00318feee5465058ab4a2a710086a07430
|
7
|
+
data.tar.gz: ca849d8c0e6a7230a6711771ea96a3f0a5c3f376a4f19aba7f0ceb13224bec4d522f46ef5047fc2a6ae70730df50b30d046f50e4cb6f94e55a49df54b824ed82
|
data/bin/octokitty
CHANGED
@@ -7,7 +7,7 @@ github = Octokit::Client.new auto_paginate: true, access_token: ENV.fetch('GITHU
|
|
7
7
|
command = File.basename($0).gsub('-', '_')
|
8
8
|
|
9
9
|
if command == 'octokitty'
|
10
|
-
if ARGV.empty?
|
10
|
+
if ARGV.empty? || (ARGV.first == '--help')
|
11
11
|
puts 'usage: octokitty <function>'
|
12
12
|
exit false
|
13
13
|
else
|
@@ -20,13 +20,14 @@ if command == 'octokitty'
|
|
20
20
|
end
|
21
21
|
|
22
22
|
required, optional = github.method(command).parameters.partition { |p,_| p == :req }.map { |l| l.flat_map { |p| p.last } }
|
23
|
-
arguments = ARGV.shift(required.length)
|
24
|
-
options = ARGV.select { |a| a.start_with? '--' }.map{ |a| a[2..-1].to_sym }.zip(ARGV.reject { |a| a.start_with? '--' }).to_h
|
25
23
|
|
26
|
-
if
|
24
|
+
if (ARGV.first == '--help') || (ARGV.length < required.length)
|
27
25
|
printf "usage: %s %s %s\n", command, required.map { |r| "<#{r}>" }.join(' '), optional.map { |o| "[#{o}]" }.join(' ')
|
28
26
|
exit false
|
29
27
|
end
|
30
28
|
|
29
|
+
arguments = ARGV.shift(required.length)
|
30
|
+
options = ARGV.select { |a| a.start_with? '--' }.map{ |a| a[2..-1].to_sym }.zip(ARGV.reject { |a| a.start_with? '--' }).to_h
|
31
|
+
|
31
32
|
response = github.method(command).call(*arguments, options)
|
32
33
|
puts JSON.dump(response.class == Sawyer::Resource ? response.to_h : response.map(&:to_h))
|
data/octokitty.gemspec
CHANGED