gitget 0.4.2 → 0.5.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: 024ea2a2798cfd48bcd62714c34616a64b99878d
4
- data.tar.gz: 8a84aa181cd93aafc4ad5e72a45f6f8046f3e702
3
+ metadata.gz: 05c7cb62dc47c6e65c8779f792e0b9c561d1fc24
4
+ data.tar.gz: 40ce817b14d4c5484b00a05603b8af063e2734ab
5
5
  SHA512:
6
- metadata.gz: 01c8b9b40f4d0cd8a5b4aa6ef896ba98d91c835e04cf8090db6eade53a046c4bf69c1c367cbe1eb80a58d2ca6de913a4d3372b1aefc498aacf7e736c6d79dbbf
7
- data.tar.gz: 5c3a4d9e066dbd38b109a6479182917b0905735ac8f38dfc85072aef63f559390c02f00953ed5434642e084085c5f5da508cea774c489894cbc2114610d6d8ec
6
+ metadata.gz: 72a3e43e0c9ec2b40d24fadc6e7058d0bf5ee6a0fc2dfde68d8fe0df06d6e85e202924811cb9efdd0700bc4a8daed8b434b0aeaff14746cdd49293a545d108d3
7
+ data.tar.gz: 9900bc85f75a024ec13a7707087cc35ba96dbc443a97df6248f69a6a9b0064633f620c4dc018eef3f8def99735af29dcc5a71c07deb26bc11313b343e5e89504
data/.gitignore CHANGED
@@ -5,4 +5,3 @@ results.yml
5
5
  github_response.yml
6
6
  coverage/
7
7
  *.gem
8
- Gemfile.lock
@@ -0,0 +1,93 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ gitget (0.5.0)
5
+ concurrent-ruby (~> 1.0)
6
+ http (~> 2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.5.0)
12
+ public_suffix (~> 2.0, >= 2.0.2)
13
+ ast (2.3.0)
14
+ concurrent-ruby (1.0.4)
15
+ crack (0.4.3)
16
+ safe_yaml (~> 1.0.0)
17
+ docile (1.1.5)
18
+ domain_name (0.5.20161129)
19
+ unf (>= 0.0.5, < 1.0.0)
20
+ erubis (2.7.0)
21
+ flay (2.8.1)
22
+ erubis (~> 2.7.0)
23
+ path_expander (~> 1.0)
24
+ ruby_parser (~> 3.0)
25
+ sexp_processor (~> 4.0)
26
+ flog (4.4.0)
27
+ path_expander (~> 1.0)
28
+ ruby_parser (~> 3.1, > 3.1.0)
29
+ sexp_processor (~> 4.4)
30
+ hashdiff (0.3.2)
31
+ http (2.1.0)
32
+ addressable (~> 2.3)
33
+ http-cookie (~> 1.0)
34
+ http-form_data (~> 1.0.1)
35
+ http_parser.rb (~> 0.6.0)
36
+ http-cookie (1.0.3)
37
+ domain_name (~> 0.5)
38
+ http-form_data (1.0.1)
39
+ http_parser.rb (0.6.0)
40
+ json (2.0.2)
41
+ minitest (5.10.1)
42
+ minitest-rg (5.2.0)
43
+ minitest (~> 5.0)
44
+ parser (2.3.3.1)
45
+ ast (~> 2.2)
46
+ path_expander (1.0.1)
47
+ powerpack (0.1.1)
48
+ public_suffix (2.0.4)
49
+ rainbow (2.2.1)
50
+ rake (11.3.0)
51
+ rubocop (0.46.0)
52
+ parser (>= 2.3.1.1, < 3.0)
53
+ powerpack (~> 0.1)
54
+ rainbow (>= 1.99.1, < 3.0)
55
+ ruby-progressbar (~> 1.7)
56
+ unicode-display_width (~> 1.0, >= 1.0.1)
57
+ ruby-progressbar (1.8.1)
58
+ ruby_parser (3.8.3)
59
+ sexp_processor (~> 4.1)
60
+ safe_yaml (1.0.4)
61
+ sexp_processor (4.7.0)
62
+ simplecov (0.12.0)
63
+ docile (~> 1.1.0)
64
+ json (>= 1.8, < 3)
65
+ simplecov-html (~> 0.10.0)
66
+ simplecov-html (0.10.0)
67
+ unf (0.1.4)
68
+ unf_ext
69
+ unf_ext (0.0.7.2)
70
+ unicode-display_width (1.1.2)
71
+ vcr (3.0.3)
72
+ webmock (2.3.1)
73
+ addressable (>= 2.3.6)
74
+ crack (>= 0.3.2)
75
+ hashdiff
76
+
77
+ PLATFORMS
78
+ ruby
79
+
80
+ DEPENDENCIES
81
+ flay (~> 2.8)
82
+ flog (~> 4.4)
83
+ gitget!
84
+ minitest (~> 5.9)
85
+ minitest-rg (~> 5.2)
86
+ rake (~> 11.3)
87
+ rubocop (~> 0.42)
88
+ simplecov (~> 0.12)
89
+ vcr (~> 3.0)
90
+ webmock (~> 2.1)
91
+
92
+ BUNDLED WITH
93
+ 1.13.6
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.executables << 'gitget'
21
21
 
22
22
  s.add_runtime_dependency 'http', '~> 2.0'
23
+ s.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
23
24
 
24
25
  s.add_development_dependency 'minitest', '~> 5.9'
25
26
  s.add_development_dependency 'minitest-rg', '~> 5.2'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require 'concurrent'
2
3
 
3
4
  files = Dir.glob(File.join(File.dirname(__FILE__), 'gitget/*.rb'))
4
5
  files.each { |lib| require_relative lib }
@@ -13,9 +13,13 @@ module Github
13
13
  def repos
14
14
  return @repos if @repos
15
15
 
16
- @repos = Github::API.user_repos(@username).map do |repo_data|
17
- Github::Repository.new(data: repo_data)
16
+ repos_promise = Github::API.user_repos(@username).map do |repo_data|
17
+ Concurrent::Promise.execute {
18
+ Github::Repository.new(data: repo_data)
19
+ }
18
20
  end
21
+ @repos = repos_promise.map(&:value)
22
+
19
23
  end
20
24
 
21
25
  def followers
@@ -17,11 +17,25 @@ module Github
17
17
  return @stats if @stats
18
18
 
19
19
  @stats = {}
20
- %w(
21
- contributors commit_activity code_frequency participation punch_card
22
- ).each do |stat|
23
- @stats[stat] = Github::API.repo_stat(@full_name, stat)
20
+ stats_promise = {}
21
+
22
+ stats_array = [
23
+ 'contributors',
24
+ 'commit_activity',
25
+ 'code_frequency',
26
+ 'participation',
27
+ 'punch_card']
28
+
29
+ stats_array.each do |stat|
30
+ stats_promise[stat] = Concurrent::Promise.execute {
31
+ Github::API.repo_stat(@full_name, stat)
32
+ }
33
+ end
34
+
35
+ stats_promise.each do |stat_name, stat_value|
36
+ @stats[stat_name] = stat_value.value
24
37
  end
38
+ @stats
25
39
  end
26
40
 
27
41
  def load_data(repo_data)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Github
4
- VERSION = '0.4.2'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renaud Jollet
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-12-16 00:00:00.000000000 Z
13
+ date: 2016-12-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -26,6 +26,20 @@ dependencies:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '2.0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: concurrent-ruby
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '1.0'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.0'
29
43
  - !ruby/object:Gem::Dependency
30
44
  name: minitest
31
45
  requirement: !ruby/object:Gem::Requirement
@@ -166,6 +180,7 @@ files:
166
180
  - ".rubocop.yml"
167
181
  - ".travis.yml"
168
182
  - Gemfile
183
+ - Gemfile.lock
169
184
  - LICENSE
170
185
  - README.md
171
186
  - Rakefile