gawky 0.0.3.pre2 → 0.0.3.pre3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df8066a5f186dd8804c420810091c8c2a0eb4469
4
- data.tar.gz: 8364281fa48b5c3ba05b53540e9492facd4af7bb
3
+ metadata.gz: 969f0b934cd63360e47f720632ebf7273acb1c97
4
+ data.tar.gz: 566e42101e751cf662066b3b0852e62a1c5a4c2a
5
5
  SHA512:
6
- metadata.gz: 5405d6b2015bb7e1e2bd8e1f381dc6d08b569279dae031fb4ddc8ce0ee44710b73c04c40725c8834f0f4581694b44863ee4ce3809434eea4b64bbb637fc9f4f2
7
- data.tar.gz: d82e050915ffa8233c4d6675f435cad393ffa2061ae0bf36ec8dfcf78fe0d4c274036155bbd00a5c60a929c381ca1c8415012cbd00bcd263658903e404dc8f24
6
+ metadata.gz: cdb297f4a092e8fe5c32d87a58d407fa190af09a66af80a4767a5b9f90a24f30c5e3ca20a10317a15d0dab685a17d5bca65ecee622c1f24fbfac851254e65964
7
+ data.tar.gz: df1bd14146c2b5ce400dbe2e260fb19776c49ed8a33de07583b40d7f1cb25285057076c5b88b587d344e346785a1b9e4b7fe74060047d4df06bbcd231f493cfa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gawky (0.0.3.pre2)
4
+ gawky (0.0.3)
5
5
  github_api (~> 0.11.3)
6
6
  json (~> 1.8.1)
7
7
  term-ansicolor (~> 1.3.0)
data/README.md CHANGED
@@ -12,15 +12,11 @@ A tiny and simple console tool for pull requests
12
12
 
13
13
  ## Installation
14
14
 
15
- Clone the repository
16
-
17
- And then execute:
15
+ $ [sudo] gem install gawky
18
16
 
19
- $ bundle install
17
+ Or if you want the latest changes
20
18
 
21
- Or install it yourself as:
22
-
23
- $ [sudo] gem install gawky
19
+ $ [sudo] gem install gawky --pre
24
20
 
25
21
  Copy the sample.json file to gawky.json at your HOME directory
26
22
 
@@ -33,6 +29,8 @@ Please make sure to change the values:
33
29
  "maxElapsedDays":5
34
30
  }
35
31
 
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
+
36
34
  ## Usage
37
35
 
38
36
  $ gawky [organization name]
data/lib/gawky/runner.rb CHANGED
@@ -4,10 +4,14 @@ module Gawky
4
4
  def initialize
5
5
  @date_now = Date.today
6
6
  end
7
+
7
8
  def run
9
+ @stats = []
8
10
  repos = Gawky.github.repos.list org: Gawky.organization, per_page: 100
9
11
  repos.each do |repo|
10
- if repo.open_issues_count > 0
12
+
13
+ @stats << {:name => repo.name, :watchers => repo.watchers, :forks => repo.forks}
14
+ if ARGV.length == 1 && repo.open_issues_count > 0
11
15
  pulls = Gawky.github.pull_requests.list user: Gawky.organization, repo: repo.name
12
16
  pulls.each do |pull|
13
17
  date = DateTime.parse(pull.created_at)
@@ -19,13 +23,25 @@ module Gawky
19
23
  end
20
24
  end
21
25
  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
+
22
40
  end
23
41
 
24
42
  private
25
-
26
43
  def elapsed_time(date)
27
44
  (@date_now - date).to_i
28
45
  end
29
46
  end
30
47
  end
31
-
data/lib/gawky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gawky
2
- VERSION = "0.0.3.pre2"
2
+ VERSION = "0.0.3.pre3"
3
3
  end
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.pre2
4
+ version: 0.0.3.pre3
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-07-18 00:00:00.000000000 Z
11
+ date: 2014-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github_api
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: 1.3.1
122
122
  requirements: []
123
123
  rubyforge_project:
124
- rubygems_version: 2.1.11
124
+ rubygems_version: 2.2.2
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: A tiny and simple console tool for pull requests