gigest 3.1.0 → 3.2.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: 1b98cb98ab4f0377f034bc0b50fc9e07499fecf3
4
- data.tar.gz: 92c8f6eaaadec58cf8614f3d197fe0bf2f34f7e9
3
+ metadata.gz: 867fe3f7ede61b0db226f3f6d517f72eb29b0e16
4
+ data.tar.gz: a8106c53c5c6e29de80a3645e0a23611184acb0f
5
5
  SHA512:
6
- metadata.gz: 50594b82649fbe68cb56bb9caa5a6e4af78be3a708194e5f228db208d67921798451464cc787109d7df097b3eff69aa940b2fea365ff99533406adc6dfe15c91
7
- data.tar.gz: 296ed5aa8882b14b4162ae078086cdce0a2e99a957fdbe41dd48def5abbc7080eb6e7bcd9b623e74b04d47e0259de1b600905f3b08695d6fe399b41d477b2ec5
6
+ metadata.gz: e832cf9056408fccd3e3516f3bbd9ebd988624c7440987f338b0fde071b520b4b5f4ea44cd6cb8ad10d36680af867fcb935fd93f2026fbf535a3239290e3d8f3
7
+ data.tar.gz: 1c3e6347fda934799f5f15fc7a262dba484198c4c510dec88aff1db9a8445cbb8b120598692b4594824d46d967431c0df153140f9fdb2097f6a18249b7708656
@@ -15,16 +15,16 @@ module Gigest
15
15
  @repositories = @connection.repositories_for(account)
16
16
  end
17
17
 
18
- def repositories
18
+ def all_repositories
19
19
  @repositories
20
20
  end
21
21
 
22
- def repositories_with_gemfile
23
- repositories.select(&:has_gemfile?)
22
+ def all_repositories_with_gemfile
23
+ all_repositories.select(&:has_gemfile?)
24
24
  end
25
25
 
26
26
  def source_repositories
27
- repositories.reject(&:fork?)
27
+ all_repositories.reject(&:fork?)
28
28
  end
29
29
 
30
30
  def source_repositories_with_gemfile
@@ -32,7 +32,7 @@ module Gigest
32
32
  end
33
33
 
34
34
  def fork_repositories
35
- repositories.select(&:fork?)
35
+ all_repositories.select(&:fork?)
36
36
  end
37
37
 
38
38
  def fork_repositories_with_gemfile
@@ -45,8 +45,8 @@ module Gigest
45
45
  # gem1: [repo1, repo2],
46
46
  # gem2: [repo1, repo2]
47
47
  # }
48
- def summary(type=nil)
49
- raise "Please specify GitHub account to analyse by invoking #process_for(account) method first!" if repositories.nil?
48
+ def summary(type=:all)
49
+ raise "Please specify GitHub account to analyse by invoking #process_for(account) method first!" if all_repositories.nil?
50
50
 
51
51
  get_repositories(type).reduce({}) do |summary, repository|
52
52
  repository.gems.each do |gem|
@@ -63,8 +63,8 @@ module Gigest
63
63
  # {gem_name: gem1, repositories: ["repo1", "repo2"], count: 2, percentage: 100.0},
64
64
  # {gem_name: gem2, repositories: ["repo1"], count: 1, percentage: 50.0}
65
65
  # ]
66
- def statistics(type=nil)
67
- raise "Please specify GitHub account to analyse by invoking #process_for(account) method first!" if repositories.nil?
66
+ def statistics(type=:all)
67
+ raise "Please specify GitHub account to analyse by invoking #process_for(account) method first!" if all_repositories.nil?
68
68
 
69
69
  repos_summary = summary(type)
70
70
  repo_type_count = get_repositories(type).count
@@ -83,7 +83,7 @@ module Gigest
83
83
  private
84
84
 
85
85
  def get_repositories(type)
86
- type.nil? ? repositories_with_gemfile : send("#{type}_repositories_with_gemfile")
86
+ send("#{type}_repositories_with_gemfile")
87
87
  end
88
88
 
89
89
  def percentage(numerator, denominator)
@@ -1,3 +1,3 @@
1
1
  module Gigest
2
- VERSION = "3.1.0"
2
+ VERSION = "3.2.0"
3
3
  end
@@ -39,11 +39,11 @@ describe Gigest::Analytics do
39
39
  end
40
40
 
41
41
  it "inits repositories" do
42
- expect(analytics.repositories).to eq(repositories)
42
+ expect(analytics.all_repositories).to eq(repositories)
43
43
  end
44
44
 
45
45
  it "inits repositories_with_gemfile" do
46
- expect(analytics.repositories_with_gemfile).to eq(expected)
46
+ expect(analytics.all_repositories_with_gemfile).to eq(expected)
47
47
  end
48
48
  end
49
49
 
@@ -53,7 +53,7 @@ describe Gigest::Analytics do
53
53
  let(:repo1) { double(:repo1, fork?: false) }
54
54
  let(:repo2) { double(:repo2, fork?: true) }
55
55
 
56
- before { analytics.stub(:repositories) { repositories } }
56
+ before { analytics.stub(:all_repositories) { repositories } }
57
57
 
58
58
  it { expect(analytics.source_repositories).to eq expected }
59
59
  end
@@ -75,7 +75,7 @@ describe Gigest::Analytics do
75
75
  let(:repo1) { double(:repo1, fork?: false) }
76
76
  let(:repo2) { double(:repo2, fork?: true) }
77
77
 
78
- before { analytics.stub(:repositories) { repositories } }
78
+ before { analytics.stub(:all_repositories) { repositories } }
79
79
 
80
80
  it { expect(analytics.fork_repositories).to eq expected }
81
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gigest
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winston Teo