ghuls 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/ghuls/cli.rb +15 -19
  4. metadata +10 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0682abc8e68f58c6c51e8ea6c1871330d028be16
4
- data.tar.gz: f1bcc058c722548b5a76e976a340e472538ffbdd
3
+ metadata.gz: e4f02949862605287aeecff20058850ff5df3953
4
+ data.tar.gz: a6355a8600c6688917efe2bfe43f805b24ace8f9
5
5
  SHA512:
6
- metadata.gz: ff779511554ce94bc88ef840afa9b4635ab6f931bc15d1241a305680ac7e28b1ab14053a8ae4540909ce1a21f9de07780d20b3ef0ed717b0e26b81e2f144a8ca
7
- data.tar.gz: b0600c9d57a8c9e529d80de360fe246b1c10e15eea8371d8d4442100886f1955b20760bbd681e6204b0511a1b01246e1b389a8054aba76bae1b09fbb27717b59
6
+ metadata.gz: 81cb3bfbb5267f3f85a4d89269e88ca1fbdf304897c6bc78cccd67ad6e5a268013f17877f96b5a7f5095371aae052ad599fc59d42f5789d64d81a18f9fb6f660
7
+ data.tar.gz: 2fe5aea1b6f27c85f9937a2fdc5413ad59583223705d04985f0756fa324a4d013c3ab3d1f58aba003fbe1158f86eeb33038e3e9f5d248b1e05c0e5d5380f8f5a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
  ## Version 1
3
+ ### Version 1.6.0
4
+ * Update dependency versions.
5
+ * ruby: 2.2.3 -> 2.3.0
6
+ * ghuls-lib: 2.2.3 -> 2.3.1
7
+ * array_utility: 1.0.0 -> 1.1.0
8
+ * Remove unneeded dependencies, string-utility and octokit, as they are required by ghuls-lib.
9
+ * Replace Rainbow usage with Paint, because it is arguably simpler, and certainly faster.
10
+ * Clean up some code style issues.
11
+
3
12
  ### Version 1.5.0
4
13
  * Data about issues, pulls, forks, stargazers, watchers, followers, following, and repository category totals is now available (#2).
5
14
  * Now uses GHULS::Lib 2.2.0 and StringUtility 2.6.0, which provide a lot of performance improvements.
data/lib/ghuls/cli.rb CHANGED
@@ -1,6 +1,4 @@
1
- require 'octokit'
2
- require 'base64'
3
- require 'rainbow'
1
+ require 'paint'
4
2
  require 'progress_bar'
5
3
  require 'ghuls/lib'
6
4
  require 'array_utility'
@@ -8,6 +6,7 @@ require 'array_utility'
8
6
  module GHULS
9
7
  class CLI
10
8
  using ArrayUtility
9
+
11
10
  # Parses the arguments (typically ARGV) into a usable hash.
12
11
  # @param args [Array] The arguments to parse.
13
12
  def parse_options(args)
@@ -20,6 +19,7 @@ module GHULS
20
19
  when '-g', '--get' then @opts[:get] = args.next(arg)
21
20
  when '-d', '--debug' then @opts[:debug] = true
22
21
  when '-r', '--random' then @opts[:get] = nil
22
+ else next
23
23
  end
24
24
  end
25
25
  end
@@ -57,8 +57,7 @@ module GHULS
57
57
  config = GHULS::Lib.configure_stuff(@opts)
58
58
  increment
59
59
  if config == false
60
- puts 'Error: authentication failed, check your username/password ' \
61
- ' or token'
60
+ puts 'Error: authentication failed, check your username/password or token'
62
61
  exit
63
62
  end
64
63
  @gh = config[:git]
@@ -77,7 +76,7 @@ module GHULS
77
76
  def output(percents)
78
77
  percents.each do |l, p|
79
78
  color = GHULS::Lib.get_color_for_language(l.to_s, @colors)
80
- puts Rainbow("#{l}: #{p}%").color(color)
79
+ puts Paint["#{l}: #{p}%", color]
81
80
  end
82
81
  end
83
82
 
@@ -123,15 +122,14 @@ module GHULS
123
122
  repos[:public].each do |r|
124
123
  next if repos[:forks].include? r
125
124
  fsw = GHULS::Lib.get_forks_stars_watchers(r, @gh)
126
- puts "#{r}: #{fsw[:forks]} forks, #{fsw[:stars]} stars, and " \
127
- "#{fsw[:watchers]} watchers"
125
+ puts "#{r}: #{fsw[:forks]} forks, #{fsw[:stars]} stars, and #{fsw[:watchers]} watchers"
128
126
  end
129
127
  end
130
128
 
131
129
  def follower_data(username)
132
130
  follows = GHULS::Lib.get_followers_following(@opts[:get], @gh)
133
- followers = Rainbow("#{follows[:followers]} followers").green
134
- following = Rainbow("following #{follows[:following]}").color('#FFA500')
131
+ followers = Paint["#{follows[:followers]} followers", :green]
132
+ following = Paint["following #{follows[:following]}", '#FFA500']
135
133
  puts "#{username} has #{followers} and is #{following} people"
136
134
  end
137
135
 
@@ -140,14 +138,13 @@ module GHULS
140
138
  repos[:public].each do |r|
141
139
  next if repos[:forks].include? r
142
140
  things = GHULS::Lib.get_issues_pulls(r, @gh)
143
- open_issues = Rainbow("#{things[:issues][:open]} open").green
144
- closed_issues = Rainbow("#{things[:issues][:closed]} closed").red
145
- open_pulls = Rainbow("#{things[:pulls][:open]} open").green
146
- closed_pulls = Rainbow("#{things[:pulls][:closed]} closed").red
147
- merged_pulls = Rainbow("#{things[:pulls][:merged]} merged").magenta
141
+ open_issues = Paint["#{things[:issues][:open]} open", :green]
142
+ closed_issues = Paint["#{things[:issues][:closed]} closed", :red]
143
+ open_pulls = Paint["#{things[:pulls][:open]} open", :green]
144
+ closed_pulls = Paint["#{things[:pulls][:closed]} closed", :red]
145
+ merged_pulls = Paint["#{things[:pulls][:merged]} merged", :magenta]
148
146
  puts "Issue data for #{r}: #{open_issues} and #{closed_issues}"
149
- puts "Pull data for #{r}: #{open_pulls}, #{merged_pulls}, " \
150
- "and #{closed_pulls}"
147
+ puts "Pull data for #{r}: #{open_pulls}, #{merged_pulls}, and #{closed_pulls}"
151
148
  end
152
149
  end
153
150
 
@@ -170,8 +167,7 @@ module GHULS
170
167
  language_data(user[:username])
171
168
  puts 'Getting forks, stars, and watchers of user repositories...'
172
169
  fork_data(@repos)
173
- puts 'Getting forks, stars, and watchers of ' \
174
- 'organization repositories...'
170
+ puts 'Getting forks, stars, and watchers of organization repositories...'
175
171
  fork_data(@org_repos)
176
172
  follower_data(user[:username])
177
173
  issue_data(@repos)
metadata CHANGED
@@ -1,71 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghuls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli Foster
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: octokit
14
+ name: paint
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.1
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 4.0.1
27
- - !ruby/object:Gem::Dependency
28
- name: rainbow
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.0.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 2.0.0
41
- - !ruby/object:Gem::Dependency
42
- name: string-utility
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 2.6.0
19
+ version: 1.0.0
48
20
  type: :runtime
49
21
  prerelease: false
50
22
  version_requirements: !ruby/object:Gem::Requirement
51
23
  requirements:
52
24
  - - ">="
53
25
  - !ruby/object:Gem::Version
54
- version: 2.6.0
26
+ version: 1.0.0
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: ghuls-lib
57
29
  requirement: !ruby/object:Gem::Requirement
58
30
  requirements:
59
31
  - - ">="
60
32
  - !ruby/object:Gem::Version
61
- version: 2.2.0
33
+ version: 2.3.1
62
34
  type: :runtime
63
35
  prerelease: false
64
36
  version_requirements: !ruby/object:Gem::Requirement
65
37
  requirements:
66
38
  - - ">="
67
39
  - !ruby/object:Gem::Version
68
- version: 2.2.0
40
+ version: 2.3.1
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: progress_bar
71
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +58,14 @@ dependencies:
86
58
  requirements:
87
59
  - - ">="
88
60
  - !ruby/object:Gem::Version
89
- version: 1.0.0
61
+ version: 1.1.0
90
62
  type: :runtime
91
63
  prerelease: false
92
64
  version_requirements: !ruby/object:Gem::Requirement
93
65
  requirements:
94
66
  - - ">="
95
67
  - !ruby/object:Gem::Version
96
- version: 1.0.0
68
+ version: 1.1.0
97
69
  description: Getting GitHub repository language data by user! It also has a web alternative
98
70
  at http://ghuls.herokuapp.com
99
71
  email: elifosterwy@gmail.com
@@ -125,9 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
97
  version: '0'
126
98
  requirements: []
127
99
  rubyforge_project:
128
- rubygems_version: 2.4.5.1
100
+ rubygems_version: 2.5.1
129
101
  signing_key:
130
102
  specification_version: 4
131
103
  summary: 'GHULS: GitHub User Language Statistics'
132
104
  test_files: []
133
- has_rdoc: