gawky 0.0.3.pre3 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/lib/gawky.rb +0 -8
- data/lib/gawky/runner.rb +5 -20
- data/lib/gawky/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fde6b7494f117f8c0e1f6294f2a242e0ff6a26c
|
4
|
+
data.tar.gz: dfae7fdcdaaa203dd538f9147004b1a1c47015e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 304620953e6fac7bfc324c2d3c94954bea4cf886a1c68ac276cb204b0927eee2493b17aec9e148549419a9c9d051bb658dc0b4a2ff0a3ed23a874c8f4f76ec13
|
7
|
+
data.tar.gz: 8b2c14948a103c2b8763056e3f71dee57924f8c3cb3b84441ac4f3857ab1ad3306c02406e072c97f8cb85734082fd00271a2b73cb99a09c540e11d5a22cf5b68
|
data/README.md
CHANGED
@@ -12,11 +12,15 @@ A tiny and simple console tool for pull requests
|
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
15
|
-
|
15
|
+
Clone the repository
|
16
|
+
|
17
|
+
And then execute:
|
16
18
|
|
17
|
-
|
19
|
+
$ bundle install
|
18
20
|
|
19
|
-
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ [sudo] gem install gawky
|
20
24
|
|
21
25
|
Copy the sample.json file to gawky.json at your HOME directory
|
22
26
|
|
@@ -29,11 +33,9 @@ Please make sure to change the values:
|
|
29
33
|
"maxElapsedDays":5
|
30
34
|
}
|
31
35
|
|
32
|
-
See [github article](https://help.github.com/articles/creating-an-access-token-for-command-line-use) about how to create the Github token
|
33
|
-
|
34
36
|
## Usage
|
35
37
|
|
36
|
-
$ gawky [organization name]
|
38
|
+
$ gawky or gawky [organization name]
|
37
39
|
|
38
40
|
## Contributing
|
39
41
|
|
data/lib/gawky.rb
CHANGED
@@ -8,14 +8,6 @@ module Gawky
|
|
8
8
|
|
9
9
|
@@configuration = JSON.load(IO.read(ENV['HOME'] + '/.gawky.json'))
|
10
10
|
|
11
|
-
if ARGV.empty?
|
12
|
-
puts "Please provide the organization name\n Usage: gawky [organization]"
|
13
|
-
exit
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.organization
|
17
|
-
ARGV.first
|
18
|
-
end
|
19
11
|
def self.github
|
20
12
|
Github.new oauth_token: @@configuration['token']
|
21
13
|
end
|
data/lib/gawky/runner.rb
CHANGED
@@ -6,13 +6,10 @@ module Gawky
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def run
|
9
|
-
|
10
|
-
repos = Gawky.github.repos.list org: Gawky.organization, per_page: 100
|
9
|
+
repos = Gawky.github.repos.list org: ARGV[0], per_page: 100
|
11
10
|
repos.each do |repo|
|
12
|
-
|
13
|
-
|
14
|
-
if ARGV.length == 1 && repo.open_issues_count > 0
|
15
|
-
pulls = Gawky.github.pull_requests.list user: Gawky.organization, repo: repo.name
|
11
|
+
if repo.open_issues_count > 0
|
12
|
+
pulls = Gawky.github.pull_requests.list user: ARGV[0], repo: repo.name
|
16
13
|
pulls.each do |pull|
|
17
14
|
date = DateTime.parse(pull.created_at)
|
18
15
|
if elapsed_time(date) > Gawky.max_elapsed_days
|
@@ -23,25 +20,13 @@ module Gawky
|
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
26
|
-
|
27
|
-
if ARGV[1] == "forks"
|
28
|
-
stats = @stats.sort {|a,b| b[:forks] <=> a[:forks]}
|
29
|
-
stats.each do |repo|
|
30
|
-
puts "Repository: #{repo[:name]} - forks: #{repo[:forks]} - watchers: #{repo[:watchers]}"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
if ARGV[1] == "watchers"
|
34
|
-
stats = @stats.sort {|a,b| b[:watchers] <=> a[:watchers]}
|
35
|
-
stats.each do |repo|
|
36
|
-
puts "Repository: #{repo[:name]} - watchers: #{repo[:watchers]} - forks: #{repo[:forks]}"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
23
|
end
|
41
24
|
|
42
25
|
private
|
26
|
+
|
43
27
|
def elapsed_time(date)
|
44
28
|
(@date_now - date).to_i
|
45
29
|
end
|
46
30
|
end
|
47
31
|
end
|
32
|
+
|
data/lib/gawky/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gawky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.3
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github_api
|
@@ -116,12 +116,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
|
-
- - '
|
119
|
+
- - '>='
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
121
|
+
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.1.11
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: A tiny and simple console tool for pull requests
|