soopr 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/Gemfile.lock +1 -1
- data/README.md +5 -3
- data/bin/soopr +30 -23
- data/exe/soopr +30 -23
- data/lib/soopr/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d508b6ab57a1cfb688398786870f281ec73fbb29
|
4
|
+
data.tar.gz: b6e7e1e2167f5bd71d937b9b0c85ff378a626695
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dc8346c6e06407463caf4deb0e0b3ea914df059e38727f7a72995cb18f4f94a0363f66aea536f8a1c04520504273892f21f66490d7a2b99dd1d4031435f4b22
|
7
|
+
data.tar.gz: 1d37b8673b1ddcac6a1490c1135ec166e0056292c29628578305a37ab37df7db515bf2285d5f384f9106c20b1cd3e43fca87753e8f83c0b224d68efd9939d350
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ SOOPR offers open pull requests
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
`gem install soopr`
|
8
8
|
|
9
9
|
SOOPR assumes you have a `~/.netrc` file for Github API auth:
|
10
10
|
|
@@ -14,15 +14,17 @@ machine api.github.com
|
|
14
14
|
password [password or oauth token]
|
15
15
|
```
|
16
16
|
|
17
|
+
You can create a personal token to be used at https://github.com/settings/tokens
|
18
|
+
|
17
19
|
## Usage
|
18
20
|
|
19
21
|
Run from the project root:
|
20
22
|
|
21
|
-
`
|
23
|
+
`soopr [organisation] [team]` (parameters are case-sensitive)
|
22
24
|
|
23
25
|
Usage help is available, too:
|
24
26
|
|
25
|
-
`
|
27
|
+
`soopr --help`
|
26
28
|
|
27
29
|
## Development
|
28
30
|
|
data/bin/soopr
CHANGED
@@ -5,35 +5,36 @@ require 'methadone'
|
|
5
5
|
require 'octokit'
|
6
6
|
require 'soopr.rb'
|
7
7
|
|
8
|
-
class
|
9
|
-
|
10
|
-
|
11
|
-
"\e[#{color_code}m#{self}\e[0m"
|
12
|
-
end
|
8
|
+
class App
|
9
|
+
include Methadone::Main
|
10
|
+
include Methadone::CLILogging
|
13
11
|
|
14
|
-
def
|
15
|
-
|
12
|
+
def self.colorize color_code, string
|
13
|
+
if options[:monochrome]
|
14
|
+
string
|
15
|
+
else
|
16
|
+
"\e[#{color_code}m#{string}\e[0m"
|
17
|
+
end
|
16
18
|
end
|
17
19
|
|
18
|
-
def
|
19
|
-
colorize
|
20
|
+
def self.blue string
|
21
|
+
colorize 34, string
|
20
22
|
end
|
21
23
|
|
22
|
-
def
|
23
|
-
colorize
|
24
|
+
def self.green string
|
25
|
+
colorize 32, string
|
24
26
|
end
|
25
|
-
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
def self.red string
|
29
|
+
colorize 31, string
|
30
|
+
end
|
30
31
|
|
31
32
|
main do |organisation, team|
|
32
33
|
Octokit.configure do |c|
|
33
34
|
c.netrc = true
|
34
35
|
end
|
35
36
|
|
36
|
-
debug "Starting to fetch teams for organisation '#{organisation}'"
|
37
|
+
logger.debug "Starting to fetch teams for organisation '#{organisation}'"
|
37
38
|
|
38
39
|
teams = Octokit.organization_teams organisation
|
39
40
|
team_resource = teams.find{ |t| t.name == team}
|
@@ -43,22 +44,26 @@ class App
|
|
43
44
|
|
44
45
|
debug "Starting to fetch repos for team '#{team}'"
|
45
46
|
|
46
|
-
|
47
|
-
.select{|r| r.open_issues_count > 0}
|
47
|
+
all_repos = Octokit.team_repositories(team_resource.id)
|
48
48
|
|
49
|
+
logger.debug "All repos found for team: #{all_repos.map(&:name)}"
|
49
50
|
|
50
|
-
|
51
|
-
|
51
|
+
repos_with_issues = all_repos.select{|r| r.open_issues_count > 0}
|
52
|
+
|
53
|
+
debug "Repos with open issues: #{repos_with_issues.map(&:name)}"
|
54
|
+
|
55
|
+
if repos_with_issues.empty?
|
56
|
+
puts green "No open pull requests found."
|
52
57
|
else
|
53
58
|
|
54
59
|
debug "Open pull requests for '#{team}':"
|
55
60
|
|
56
|
-
|
61
|
+
repos_with_issues.each do |repo|
|
57
62
|
pull_requests = Octokit.pull_requests repo.id
|
58
63
|
if pull_requests.size > 0 then
|
59
|
-
puts "# #{repo.name}"
|
64
|
+
puts red "# #{repo.name}"
|
60
65
|
pull_requests.each do |pr|
|
61
|
-
puts "- #{pr.title}: "
|
66
|
+
puts blue("- #{pr.title}: ") + green("#{pr.html_url}\n\n")
|
62
67
|
end
|
63
68
|
end
|
64
69
|
end
|
@@ -69,6 +74,8 @@ class App
|
|
69
74
|
|
70
75
|
description 'List open pull requests of a Github team'
|
71
76
|
|
77
|
+
on "-m", "--monochrome", "Use monochrome output instead of colors"
|
78
|
+
|
72
79
|
arg :organisation, "Github organisation the team belongs to"
|
73
80
|
arg :team, "Github team from which to list open pull requests"
|
74
81
|
|
data/exe/soopr
CHANGED
@@ -5,35 +5,36 @@ require 'methadone'
|
|
5
5
|
require 'octokit'
|
6
6
|
require 'soopr.rb'
|
7
7
|
|
8
|
-
class
|
9
|
-
|
10
|
-
|
11
|
-
"\e[#{color_code}m#{self}\e[0m"
|
12
|
-
end
|
8
|
+
class App
|
9
|
+
include Methadone::Main
|
10
|
+
include Methadone::CLILogging
|
13
11
|
|
14
|
-
def
|
15
|
-
|
12
|
+
def self.colorize color_code, string
|
13
|
+
if options[:monochrome]
|
14
|
+
string
|
15
|
+
else
|
16
|
+
"\e[#{color_code}m#{string}\e[0m"
|
17
|
+
end
|
16
18
|
end
|
17
19
|
|
18
|
-
def
|
19
|
-
colorize
|
20
|
+
def self.blue string
|
21
|
+
colorize 34, string
|
20
22
|
end
|
21
23
|
|
22
|
-
def
|
23
|
-
colorize
|
24
|
+
def self.green string
|
25
|
+
colorize 32, string
|
24
26
|
end
|
25
|
-
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
def self.red string
|
29
|
+
colorize 31, string
|
30
|
+
end
|
30
31
|
|
31
32
|
main do |organisation, team|
|
32
33
|
Octokit.configure do |c|
|
33
34
|
c.netrc = true
|
34
35
|
end
|
35
36
|
|
36
|
-
debug "Starting to fetch teams for organisation '#{organisation}'"
|
37
|
+
logger.debug "Starting to fetch teams for organisation '#{organisation}'"
|
37
38
|
|
38
39
|
teams = Octokit.organization_teams organisation
|
39
40
|
team_resource = teams.find{ |t| t.name == team}
|
@@ -43,22 +44,26 @@ class App
|
|
43
44
|
|
44
45
|
debug "Starting to fetch repos for team '#{team}'"
|
45
46
|
|
46
|
-
|
47
|
-
.select{|r| r.open_issues_count > 0}
|
47
|
+
all_repos = Octokit.team_repositories(team_resource.id)
|
48
48
|
|
49
|
+
logger.debug "All repos found for team: #{all_repos.map(&:name)}"
|
49
50
|
|
50
|
-
|
51
|
-
|
51
|
+
repos_with_issues = all_repos.select{|r| r.open_issues_count > 0}
|
52
|
+
|
53
|
+
debug "Repos with open issues: #{repos_with_issues.map(&:name)}"
|
54
|
+
|
55
|
+
if repos_with_issues.empty?
|
56
|
+
puts green "No open pull requests found."
|
52
57
|
else
|
53
58
|
|
54
59
|
debug "Open pull requests for '#{team}':"
|
55
60
|
|
56
|
-
|
61
|
+
repos_with_issues.each do |repo|
|
57
62
|
pull_requests = Octokit.pull_requests repo.id
|
58
63
|
if pull_requests.size > 0 then
|
59
|
-
puts "# #{repo.name}"
|
64
|
+
puts red "# #{repo.name}"
|
60
65
|
pull_requests.each do |pr|
|
61
|
-
puts "- #{pr.title}: "
|
66
|
+
puts blue("- #{pr.title}: ") + green("#{pr.html_url}\n\n")
|
62
67
|
end
|
63
68
|
end
|
64
69
|
end
|
@@ -69,6 +74,8 @@ class App
|
|
69
74
|
|
70
75
|
description 'List open pull requests of a Github team'
|
71
76
|
|
77
|
+
on "-m", "--monochrome", "Use monochrome output instead of colors"
|
78
|
+
|
72
79
|
arg :organisation, "Github organisation the team belongs to"
|
73
80
|
arg :team, "Github team from which to list open pull requests"
|
74
81
|
|
data/lib/soopr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soopr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nils Blum-Oeste
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -169,4 +169,3 @@ signing_key:
|
|
169
169
|
specification_version: 4
|
170
170
|
summary: Simple CLI tool to list open pull requests of a Github team.
|
171
171
|
test_files: []
|
172
|
-
has_rdoc:
|