ghuls 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cf9667cf49fbc619a5208b6bf16380f68b9c332
4
- data.tar.gz: ca53abc3ed35d3b8b4f59cf48eed9907a8e9f0fd
3
+ metadata.gz: 578a5b369b6037f20fe20b57efcc34c635f101c4
4
+ data.tar.gz: 0946055d85925e4da130f344a612a003cd09749a
5
5
  SHA512:
6
- metadata.gz: 419a9742c6733f3fe7158d55a1323b55460c1777fc883bcd420f1eb6ef245bfb157126439e66640dbbe6e44833d1649f01c3957febb932b49fe06209b28b23a9
7
- data.tar.gz: fe911a8c53792cc10ea90561595e26db6dd706b0361e4481c87f32e604c5db5ecb26af17d0a3811452591487c470896931ebf675131f986fe28a7f310ae0d1a0
6
+ metadata.gz: 3a7cb2154f6bef5a6f5e63d4a0624697436efec516ffd47ca459ebc5c91d80f541a7cea8a86f72c355e66a00a2d4579b1f77759c981327847b94460088af23a8
7
+ data.tar.gz: ba36ea02b0ba389d04415e77119ad7021bd8bb5c21cef43da64471454675b5c619f7ba72c0888e7b6b2cc695846be0dcfe4110e384e0083aac2bfd2b6d55cf31
data/cli/CHANGELOG.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # Changelog
2
2
  ## Version 1
3
+ ### Version 1.3.0
4
+ * New -d --debug option to show a progress bar.
5
+
3
6
  ### Version 1.2.0
4
7
  * Fix require_relative statement for utilities.rb, so it now actually works outside of the project root.
5
8
  * Better error handling for authentication error (ProgramFOX)
6
- * You can now get organization data for people other than yourself. It now checks if the user is a contributor to the org repos, rather than a collaborator, which was causing some issues. (#19.)
9
+ * You can now get organization data for people other than yourself. It now checks if the user is a contributor to the org repos, rather than a collaborator, which was causing issues. (#19.)
7
10
 
8
11
  ### Version 1.1.0
9
12
  * Organizations that the -g user contributed to are now supported.
data/cli/lib/ghuls/cli.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'octokit'
2
2
  require 'base64'
3
3
  require 'rainbow'
4
+ require 'progress_bar'
4
5
  require_relative '../../../utils/utilities'
5
6
 
6
7
  module GHULS
@@ -15,10 +16,15 @@ module GHULS
15
16
  when '-pw', '--pass' then @opts[:pass] = Utilities.get_next(arg, args)
16
17
  when '-t', '--token' then @opts[:token] = Utilities.get_next(arg, args)
17
18
  when '-g', '--get' then @opts[:get] = Utilities.get_next(arg, args)
19
+ when '-d', '--debug' then @opts[:debug] = true
18
20
  end
19
21
  end
20
22
  end
21
23
 
24
+ def increment
25
+ @bar.increment! if @opts[:debug]
26
+ end
27
+
22
28
  # Creates a new instance of GHULS::CLI
23
29
  # @param args [Array] The arguments for the CLI.
24
30
  def initialize(args = ARGV)
@@ -27,12 +33,14 @@ module GHULS
27
33
  user: nil,
28
34
  pass: nil,
29
35
  token: nil,
30
- get: nil
36
+ get: nil,
37
+ debug: nil
31
38
  }
32
39
 
33
40
  @usage = 'Usage: ghuls [-h] [-un] username [-pw] password [-t] token ' \
34
41
  '[-g] username'
35
42
  @help = "-h, --help Show helpful information.\n" \
43
+ "-d, --debug Provide debug information.\n" \
36
44
  "-un, --user The username to log in as.\n" \
37
45
  "-pw, --pass The password for that username.\n" \
38
46
  '-t, --token The token to log in as. This will be preferred ' \
@@ -40,7 +48,10 @@ module GHULS
40
48
  '-g, --get The username/organization to analyze.'
41
49
 
42
50
  parse_options(args)
51
+ @bar = ProgressBar.new(5) if @opts[:debug]
52
+ increment
43
53
  config = Utilities.configure_stuff(@opts)
54
+ increment
44
55
  if config == false
45
56
  puts 'Error: authentication failed, check your username/password ' \
46
57
  ' or token'
@@ -81,11 +92,14 @@ module GHULS
81
92
  puts @usage if failed?
82
93
  puts @help if @opts[:help]
83
94
  exit if failed?
84
- puts "Getting language data for #{@opts[:get]}..."
95
+ increment
85
96
  user_percents = Utilities.analyze_user(@opts[:get], @gh)
97
+ increment
86
98
  org_percents = Utilities.analyze_orgs(@opts[:get], @gh)
99
+ increment
87
100
 
88
101
  if user_percents != false
102
+ puts "Getting language data for #{@opts[:get]}..."
89
103
  output(user_percents)
90
104
  if org_percents != false
91
105
  puts 'Getting language data for their organizations...'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghuls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli Foster