reponaut 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/reponaut +19 -1
- data/features/count.feature +17 -25
- data/features/help.feature +36 -21
- data/features/list.feature +210 -8
- data/features/step_definitions/github_steps.rb +5 -0
- data/lib/reponaut.rb +14 -1
- data/lib/reponaut/command.rb +37 -0
- data/lib/reponaut/commands/count.rb +41 -0
- data/lib/reponaut/commands/list.rb +40 -0
- data/lib/reponaut/ext/ENV.rb +9 -0
- data/lib/reponaut/ext/mercenary.rb +16 -0
- data/lib/reponaut/github.rb +37 -7
- data/lib/reponaut/presenter.rb +30 -0
- data/lib/reponaut/sorter.rb +29 -0
- data/lib/reponaut/version.rb +1 -1
- data/reponaut.gemspec +9 -3
- data/spec/fixtures/rate_limiting.json +4 -0
- data/spec/fixtures/repos/mdippery/Smyck-Color-Scheme.json +266 -0
- data/spec/fixtures/repos/mdippery/dnsimple-python.json +266 -0
- data/spec/fixtures/repos/mdippery/nginx.vim.json +266 -0
- data/spec/fixtures/repos/mdippery/staticgenerator.json +266 -0
- data/spec/reponaut/github_spec.rb +9 -0
- data/spec/reponaut/presenter_spec.rb +59 -0
- data/spec/reponaut/sorter_spec.rb +64 -0
- metadata +41 -12
- data/lib/reponaut/application.rb +0 -99
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 985b9da1a543fc796c3ce12f0905e43cf20abb43
|
4
|
+
data.tar.gz: 7655ae1f153449137992b2a03f8be9fdcb9cbc77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc1b74370e8d307a6e297745b3ccc7c983edf91823144c38a5b34a1fe0cd2783fe4ec40843570ba822e6b08c3fe172d27e268294751581f4ab65aea01d54424
|
7
|
+
data.tar.gz: 1edef2e6384a54b7c907ec4e6d0c62e6b9bda58690baf7a5a237c0a042bbe98c38ad690018e56486f8f0f2207c14954f5a6dd5d8f4479748129e6dc73625f2f8
|
data/bin/reponaut
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'mercenary'
|
3
4
|
require 'reponaut'
|
4
|
-
|
5
|
+
require 'reponaut/ext/mercenary'
|
6
|
+
|
7
|
+
Mercenary.program(:reponaut) do |p|
|
8
|
+
p.version Reponaut::VERSION
|
9
|
+
p.description 'Explore GitHub users'
|
10
|
+
p.syntax 'reponaut <command> [options] <args>'
|
11
|
+
|
12
|
+
Reponaut::Application::Command.subclasses.each { |c| c.new(p) }
|
13
|
+
|
14
|
+
p.action do |args, options|
|
15
|
+
if args.empty?
|
16
|
+
puts p
|
17
|
+
exit 0
|
18
|
+
else
|
19
|
+
abort "Invalid command: #{args.first}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/features/count.feature
CHANGED
@@ -6,7 +6,7 @@ Feature: Count repositories by language
|
|
6
6
|
|
7
7
|
Scenario: List repository counts sorted by language
|
8
8
|
Given the GitHub service returns repository data for the user "mdippery"
|
9
|
-
When I run `reponaut mdippery`
|
9
|
+
When I run `reponaut count mdippery`
|
10
10
|
Then it should pass with:
|
11
11
|
"""
|
12
12
|
C 1
|
@@ -23,24 +23,7 @@ Feature: Count repositories by language
|
|
23
23
|
|
24
24
|
Scenario: List repository counts sorted by language count
|
25
25
|
Given the GitHub service returns repository data for the user "mdippery"
|
26
|
-
When I run `reponaut -
|
27
|
-
Then it should pass with:
|
28
|
-
"""
|
29
|
-
Objective-C 5
|
30
|
-
Python 4
|
31
|
-
Clojure 3
|
32
|
-
Ruby 3
|
33
|
-
VimL 3
|
34
|
-
Java 2
|
35
|
-
C 1
|
36
|
-
Erlang 1
|
37
|
-
JavaScript 1
|
38
|
-
Perl 1
|
39
|
-
"""
|
40
|
-
|
41
|
-
Scenario: List repository counts sorted by language count using long option
|
42
|
-
Given the GitHub service returns repository data for the user "mdippery"
|
43
|
-
When I run `reponaut --count mdippery`
|
26
|
+
When I run `reponaut count -n mdippery`
|
44
27
|
Then it should pass with:
|
45
28
|
"""
|
46
29
|
Objective-C 5
|
@@ -57,7 +40,7 @@ Feature: Count repositories by language
|
|
57
40
|
|
58
41
|
Scenario: List repository counts for source repositories ordered by language
|
59
42
|
Given the GitHub service returns repository data for the user "mdippery"
|
60
|
-
When I run `reponaut -f mdippery`
|
43
|
+
When I run `reponaut count -f mdippery`
|
61
44
|
Then it should pass with:
|
62
45
|
"""
|
63
46
|
C 1
|
@@ -74,7 +57,7 @@ Feature: Count repositories by language
|
|
74
57
|
|
75
58
|
Scenario: List repository counts for source repositories ordered by language using long option
|
76
59
|
Given the GitHub service returns repository data for the user "mdippery"
|
77
|
-
When I run `reponaut --ignore-forks mdippery`
|
60
|
+
When I run `reponaut count --ignore-forks mdippery`
|
78
61
|
Then it should pass with:
|
79
62
|
"""
|
80
63
|
C 1
|
@@ -91,7 +74,7 @@ Feature: Count repositories by language
|
|
91
74
|
|
92
75
|
Scenario: List repository counts for source repositories ordered by count
|
93
76
|
Given the GitHub service returns repository data for the user "mdippery"
|
94
|
-
When I run `reponaut -f -
|
77
|
+
When I run `reponaut count -f -n mdippery`
|
95
78
|
Then it should pass with:
|
96
79
|
"""
|
97
80
|
Objective-C 5
|
@@ -108,7 +91,7 @@ Feature: Count repositories by language
|
|
108
91
|
|
109
92
|
Scenario: List repository counts for users with over 10 repositories
|
110
93
|
Given the GitHub service returns repository data for the user "testuser1"
|
111
|
-
When I run `reponaut testuser1`
|
94
|
+
When I run `reponaut count testuser1`
|
112
95
|
Then it should pass with:
|
113
96
|
"""
|
114
97
|
HTML 1
|
@@ -121,7 +104,7 @@ Feature: Count repositories by language
|
|
121
104
|
|
122
105
|
Scenario: List repository counts for a non-existent user
|
123
106
|
Given the GitHub service returns 404 for the user "nosuchuser"
|
124
|
-
When I run `reponaut nosuchuser`
|
107
|
+
When I run `reponaut count nosuchuser`
|
125
108
|
Then the exit status should not be 0
|
126
109
|
And the stderr should contain:
|
127
110
|
"""
|
@@ -130,9 +113,18 @@ Feature: Count repositories by language
|
|
130
113
|
|
131
114
|
Scenario: List repository counts for a user with no repositories
|
132
115
|
Given the GitHub service returns repository data for the user "emptyuser"
|
133
|
-
When I run `reponaut emptyuser`
|
116
|
+
When I run `reponaut count emptyuser`
|
134
117
|
Then the exit status should not be 0
|
135
118
|
And the stderr should contain:
|
136
119
|
"""
|
137
120
|
emptyuser has no repositories
|
138
121
|
"""
|
122
|
+
|
123
|
+
Scenario: List repository counts when GitHub has limited the requests
|
124
|
+
Given the GitHub service is rate limiting requests for the user "mdippery"
|
125
|
+
When I run `reponaut count mdippery`
|
126
|
+
Then the exit status should not be 0
|
127
|
+
And stderr should contain:
|
128
|
+
"""
|
129
|
+
GitHub rate limit exceeded. Try your request again later.
|
130
|
+
"""
|
data/features/help.feature
CHANGED
@@ -8,34 +8,44 @@ Feature: Get help
|
|
8
8
|
When I run `reponaut -h`
|
9
9
|
Then it should pass with:
|
10
10
|
"""
|
11
|
-
Usage:
|
11
|
+
Usage:
|
12
|
+
|
13
|
+
reponaut <command> [options] <args>
|
12
14
|
|
13
15
|
Options:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
-h, --help Show this message
|
17
|
+
-v, --version Print the name and version
|
18
|
+
-t, --trace Show the full backtrace when an error occurs
|
19
|
+
|
20
|
+
Subcommands:
|
21
|
+
count Shows a breakdown of a user's total number of repos
|
22
|
+
list, ls List a user's repos
|
18
23
|
"""
|
19
24
|
|
20
25
|
Scenario: List usage details with long option
|
21
26
|
When I run `reponaut --help`
|
22
27
|
Then it should pass with:
|
23
28
|
"""
|
24
|
-
Usage:
|
29
|
+
Usage:
|
30
|
+
|
31
|
+
reponaut <command> [options] <args>
|
25
32
|
|
26
33
|
Options:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
34
|
+
-h, --help Show this message
|
35
|
+
-v, --version Print the name and version
|
36
|
+
-t, --trace Show the full backtrace when an error occurs
|
37
|
+
|
38
|
+
Subcommands:
|
39
|
+
count Shows a breakdown of a user's total number of repos
|
40
|
+
list, ls List a user's repos
|
31
41
|
"""
|
32
42
|
|
33
43
|
Scenario: Get version
|
34
44
|
When I run `reponaut --version`
|
35
45
|
Then the exit status should be 0
|
36
|
-
And the
|
46
|
+
And the output should match:
|
37
47
|
"""
|
38
|
-
reponaut
|
48
|
+
reponaut [0-9]+\.[0-9]+\.[0-9]+(\.[a-z]+)?
|
39
49
|
"""
|
40
50
|
|
41
51
|
Scenario: Specify an invalid option
|
@@ -43,20 +53,25 @@ Feature: Get help
|
|
43
53
|
Then the exit status should not be 0
|
44
54
|
And the stderr should contain:
|
45
55
|
"""
|
46
|
-
|
47
|
-
|
56
|
+
Whoops, we can't understand your command.
|
57
|
+
invalid option: -b
|
58
|
+
Run your command again with the --help switch to see available options.
|
48
59
|
"""
|
49
60
|
|
50
61
|
Scenario: Specify no options
|
51
62
|
When I run `reponaut`
|
52
|
-
Then
|
53
|
-
And the stderr should contain:
|
63
|
+
Then it should pass with:
|
54
64
|
"""
|
55
|
-
Usage:
|
65
|
+
Usage:
|
66
|
+
|
67
|
+
reponaut <command> [options] <args>
|
56
68
|
|
57
69
|
Options:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
70
|
+
-h, --help Show this message
|
71
|
+
-v, --version Print the name and version
|
72
|
+
-t, --trace Show the full backtrace when an error occurs
|
73
|
+
|
74
|
+
Subcommands:
|
75
|
+
count Shows a breakdown of a user's total number of repos
|
76
|
+
list, ls List a user's repos
|
62
77
|
"""
|
data/features/list.feature
CHANGED
@@ -4,9 +4,211 @@ Feature: List repos for a given language
|
|
4
4
|
I want to see what projects another user has created in a given language
|
5
5
|
In order to see what software they've written
|
6
6
|
|
7
|
+
Scenario: List all repositories
|
8
|
+
Given the GitHub service returns repository data for the user "mdippery"
|
9
|
+
When I run `reponaut ls mdippery`
|
10
|
+
Then it should pass with:
|
11
|
+
"""
|
12
|
+
3ddv
|
13
|
+
blackout
|
14
|
+
bucknellbug
|
15
|
+
chameleon
|
16
|
+
collections
|
17
|
+
dnsimple-python -> tbunnyman/dnsimple-python
|
18
|
+
dotfiles
|
19
|
+
glitz
|
20
|
+
homebrew-self
|
21
|
+
karmanaut
|
22
|
+
libtar
|
23
|
+
nginx.vim -> vim-scripts/nginx.vim
|
24
|
+
rack-pesticide
|
25
|
+
rainyday
|
26
|
+
reponaut
|
27
|
+
Smyck-Color-Scheme -> hukl/Smyck-Color-Scheme
|
28
|
+
snodes
|
29
|
+
squash
|
30
|
+
stackim
|
31
|
+
staticgenerator -> mrj0/staticgenerator
|
32
|
+
usaidwat
|
33
|
+
vimfiles
|
34
|
+
whitman
|
35
|
+
zanegort
|
36
|
+
"""
|
37
|
+
|
38
|
+
Scenario: List all repositories without forks
|
39
|
+
Given the GitHub service returns repository data for the user "mdippery"
|
40
|
+
When I run `reponaut ls -f mdippery`
|
41
|
+
Then it should pass with:
|
42
|
+
"""
|
43
|
+
3ddv
|
44
|
+
blackout
|
45
|
+
bucknellbug
|
46
|
+
chameleon
|
47
|
+
collections
|
48
|
+
dotfiles
|
49
|
+
glitz
|
50
|
+
homebrew-self
|
51
|
+
karmanaut
|
52
|
+
libtar
|
53
|
+
rack-pesticide
|
54
|
+
rainyday
|
55
|
+
reponaut
|
56
|
+
snodes
|
57
|
+
squash
|
58
|
+
stackim
|
59
|
+
usaidwat
|
60
|
+
vimfiles
|
61
|
+
whitman
|
62
|
+
zanegort
|
63
|
+
"""
|
64
|
+
|
65
|
+
Scenario: Describe all repositories
|
66
|
+
Given the GitHub service returns repository data for the user "mdippery"
|
67
|
+
When I run `reponaut ls -d mdippery`
|
68
|
+
Then it should pass with:
|
69
|
+
"""
|
70
|
+
3ddv
|
71
|
+
NEES 3D Data Viewer from the Center for Earthquake Engineering Simulation at RPI
|
72
|
+
|
73
|
+
blackout
|
74
|
+
Activate your Mac OS X screen saver with a simple keystroke
|
75
|
+
|
76
|
+
bucknellbug
|
77
|
+
Mac OS X weather widget that pulls info from Bucknell University's weather station
|
78
|
+
|
79
|
+
chameleon
|
80
|
+
Samples Stack Overflow user reputation scores
|
81
|
+
|
82
|
+
collections
|
83
|
+
Bringing Smalltalk and Ruby collections methods to Objective-C since 2011
|
84
|
+
|
85
|
+
dnsimple-python -> tbunnyman/dnsimple-python
|
86
|
+
Python client for DNSimple domain registration and DNS hosting
|
87
|
+
|
88
|
+
dotfiles
|
89
|
+
My configuration files
|
90
|
+
|
91
|
+
glitz
|
92
|
+
Track and manage your Sparkle-enabled software with a Django webapp
|
93
|
+
|
94
|
+
homebrew-self
|
95
|
+
My own Homebrew formulæ that aren't suitable for inclusion in the main Homebrew repo
|
96
|
+
|
97
|
+
karmanaut
|
98
|
+
Samples Reddit users' link and comment karma scores
|
99
|
+
|
100
|
+
libtar
|
101
|
+
A tarfile handling library for C and Objective-C
|
102
|
+
|
103
|
+
nginx.vim -> vim-scripts/nginx.vim
|
104
|
+
Ease editing of nginx conf files in Vim
|
105
|
+
|
106
|
+
rack-pesticide
|
107
|
+
Block annoying HTTP referrers
|
108
|
+
|
109
|
+
rainyday
|
110
|
+
Mac OS X screen saver that wraps Marek Brodziak's rainyday.js code
|
111
|
+
|
112
|
+
reponaut
|
113
|
+
Exploring the depths of GitHub
|
114
|
+
|
115
|
+
Smyck-Color-Scheme -> hukl/Smyck-Color-Scheme
|
116
|
+
Color Scheme for Terminal.app, iTerm2, Vim, MacVim, Sublime Text2 and Textmate
|
117
|
+
|
118
|
+
snodes
|
119
|
+
A distributed, encrypted file sharing network
|
120
|
+
|
121
|
+
squash
|
122
|
+
Minify your JavaScript, CSS, SASS, and LESS files—automagically!
|
123
|
+
|
124
|
+
stackim
|
125
|
+
URL shortener for Stack Overflow profiles
|
126
|
+
|
127
|
+
staticgenerator -> mrj0/staticgenerator
|
128
|
+
StaticGenerator for Django
|
129
|
+
|
130
|
+
usaidwat
|
131
|
+
Answers the age-old question, "Where does a Redditor comment the most?"
|
132
|
+
|
133
|
+
vimfiles
|
134
|
+
My Vim configuration
|
135
|
+
|
136
|
+
whitman
|
137
|
+
Sample data from JSON web APIs
|
138
|
+
|
139
|
+
zanegort
|
140
|
+
An IRC bot
|
141
|
+
"""
|
142
|
+
|
143
|
+
Scenario: Describe all repositories without forks
|
144
|
+
Given the GitHub service returns repository data for the user "mdippery"
|
145
|
+
When I run `reponaut ls -fd mdippery`
|
146
|
+
Then it should pass with:
|
147
|
+
"""
|
148
|
+
3ddv
|
149
|
+
NEES 3D Data Viewer from the Center for Earthquake Engineering Simulation at RPI
|
150
|
+
|
151
|
+
blackout
|
152
|
+
Activate your Mac OS X screen saver with a simple keystroke
|
153
|
+
|
154
|
+
bucknellbug
|
155
|
+
Mac OS X weather widget that pulls info from Bucknell University's weather station
|
156
|
+
|
157
|
+
chameleon
|
158
|
+
Samples Stack Overflow user reputation scores
|
159
|
+
|
160
|
+
collections
|
161
|
+
Bringing Smalltalk and Ruby collections methods to Objective-C since 2011
|
162
|
+
|
163
|
+
dotfiles
|
164
|
+
My configuration files
|
165
|
+
|
166
|
+
glitz
|
167
|
+
Track and manage your Sparkle-enabled software with a Django webapp
|
168
|
+
|
169
|
+
homebrew-self
|
170
|
+
My own Homebrew formulæ that aren't suitable for inclusion in the main Homebrew repo
|
171
|
+
|
172
|
+
karmanaut
|
173
|
+
Samples Reddit users' link and comment karma scores
|
174
|
+
|
175
|
+
libtar
|
176
|
+
A tarfile handling library for C and Objective-C
|
177
|
+
|
178
|
+
rack-pesticide
|
179
|
+
Block annoying HTTP referrers
|
180
|
+
|
181
|
+
rainyday
|
182
|
+
Mac OS X screen saver that wraps Marek Brodziak's rainyday.js code
|
183
|
+
|
184
|
+
reponaut
|
185
|
+
Exploring the depths of GitHub
|
186
|
+
|
187
|
+
snodes
|
188
|
+
A distributed, encrypted file sharing network
|
189
|
+
|
190
|
+
squash
|
191
|
+
Minify your JavaScript, CSS, SASS, and LESS files—automagically!
|
192
|
+
|
193
|
+
stackim
|
194
|
+
URL shortener for Stack Overflow profiles
|
195
|
+
|
196
|
+
usaidwat
|
197
|
+
Answers the age-old question, "Where does a Redditor comment the most?"
|
198
|
+
|
199
|
+
vimfiles
|
200
|
+
My Vim configuration
|
201
|
+
|
202
|
+
whitman
|
203
|
+
Sample data from JSON web APIs
|
204
|
+
|
205
|
+
zanegort
|
206
|
+
An IRC bot
|
207
|
+
"""
|
208
|
+
|
7
209
|
Scenario: List repositories in a given language
|
8
210
|
Given the GitHub service returns repository data for the user "mdippery"
|
9
|
-
When I run `reponaut mdippery VimL`
|
211
|
+
When I run `reponaut ls mdippery VimL`
|
10
212
|
Then it should pass with:
|
11
213
|
"""
|
12
214
|
nginx.vim -> vim-scripts/nginx.vim
|
@@ -16,7 +218,7 @@ Feature: List repos for a given language
|
|
16
218
|
|
17
219
|
Scenario: List repositories in a given language, ignoring case
|
18
220
|
Given the GitHub service returns repository data for the user "mdippery"
|
19
|
-
When I run `reponaut mdippery viml`
|
221
|
+
When I run `reponaut ls mdippery viml`
|
20
222
|
Then it should pass with:
|
21
223
|
"""
|
22
224
|
nginx.vim -> vim-scripts/nginx.vim
|
@@ -26,7 +228,7 @@ Feature: List repos for a given language
|
|
26
228
|
|
27
229
|
Scenario: List repositories in a given language, excluding forks
|
28
230
|
Given the GitHub service returns repository data for the user "mdippery"
|
29
|
-
When I run `reponaut -f mdippery VimL`
|
231
|
+
When I run `reponaut ls -f mdippery VimL`
|
30
232
|
Then it should pass with:
|
31
233
|
"""
|
32
234
|
vimfiles
|
@@ -34,18 +236,18 @@ Feature: List repos for a given language
|
|
34
236
|
|
35
237
|
Scenario: List repositories in a given language with no results
|
36
238
|
Given the GitHub service returns repository data for the user "mdippery"
|
37
|
-
When I run `reponaut mdippery C++`
|
239
|
+
When I run `reponaut ls mdippery C++`
|
38
240
|
Then the exit status should not be 0
|
39
241
|
And the output should contain:
|
40
242
|
"""
|
41
243
|
mdippery has no repositories written in C++
|
42
244
|
"""
|
43
245
|
|
44
|
-
Scenario: List repositories
|
45
|
-
Given the GitHub service
|
46
|
-
When I run `reponaut
|
246
|
+
Scenario: List repositories for a given user when the API has been rate limited
|
247
|
+
Given the GitHub service is rate limiting requests for the user "mdippery"
|
248
|
+
When I run `reponaut ls mdippery python`
|
47
249
|
Then the exit status should not be 0
|
48
250
|
And stderr should contain:
|
49
251
|
"""
|
50
|
-
|
252
|
+
GitHub rate limit exceeded. Try your request again later.
|
51
253
|
"""
|