repocrawler 0.1.15 → 0.1.16

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: 55b0ab915c03eb421180f841fd526b46108109bd
4
- data.tar.gz: bb91b38e0b2097a720114b574044e8a176bde7e6
3
+ metadata.gz: 37a0377e676e1214a35dbe3c0cb1714a93eb5c24
4
+ data.tar.gz: e7ab2fe71d76c68a1c1d30c19629aa7466b28c7f
5
5
  SHA512:
6
- metadata.gz: 221b027714102c37dc828b362381cd6d5ce99f43ee7abbf8d2cd4b912a2c9ed4128884e58959dc32805564f5616dcba7830eb63266b099f9f01c0f70ee3cbdba
7
- data.tar.gz: 66486d82aba2f209302e7ba22e25d9e4c620df0ff3be3c83d0e6bd3e22b454689710236beb59bcaad5cd822208e65da53950b5273118ab68c6d7137c7447df40
6
+ metadata.gz: 4b0bbd87d110ec64fc13b85a3d4741c3fac7174f192e61f78fcd6d960cb5d7bf786df7fd0dc9d1c3d4c58f2842273565054487a348dcef01294beb3433afec89
7
+ data.tar.gz: 52a0c3d765d91aad5ab547a052d645943ad750c917a2557b82c08fc68731070e800ae9c4890066aaf311106f352f2acbea922a8d9dfb731fd4401717cf745c18
@@ -25,7 +25,12 @@ module Repos
25
25
  "User-Agent" => @user_agent
26
26
  })
27
27
 
28
- last_year_commit_activity.delete_if {|record| record['total'] == 0}
28
+ if last_year_commit_activity['message'] === 'Not Found'
29
+ get_last_year_commit_activity = nil
30
+ else
31
+ last_year_commit_activity.delete_if {|record| record['total'] == 0}
32
+ end
33
+
29
34
  end
30
35
 
31
36
  # Get the contributors
@@ -57,7 +62,12 @@ module Repos
57
62
  repos_meta = HTTParty.get(@GITHUB_API_BASE_URL + "?access_token=#{@access_token}", headers: {
58
63
  "User-Agent" => @user_agent
59
64
  })
60
- forks = repos_meta['forks_count']
65
+
66
+ if repos_meta['message'] === 'Not Found'
67
+ forks = nil
68
+ else
69
+ forks = repos_meta['forks_count']
70
+ end
61
71
 
62
72
  forks
63
73
  end
@@ -66,7 +76,12 @@ module Repos
66
76
  repos_meta = HTTParty.get(@GITHUB_API_BASE_URL + "?access_token=#{@access_token}", headers: {
67
77
  "User-Agent" => @user_agent
68
78
  })
69
- stars = repos_meta['stargazers_count']
79
+
80
+ if repos_meta['message'] === 'Not Found'
81
+ stars = nil
82
+ else
83
+ stars = repos_meta['stargazers_count']
84
+ end
70
85
 
71
86
  stars
72
87
  end
@@ -75,7 +90,12 @@ module Repos
75
90
  repos_meta = HTTParty.get(@GITHUB_API_BASE_URL + "?access_token=#{@access_token}", headers: {
76
91
  "User-Agent" => @user_agent
77
92
  })
78
- issues = repos_meta['open_issues_count']
93
+
94
+ if repos_meta['message'] === 'Not Found'
95
+ issues = nil
96
+ else
97
+ issues = repos_meta['open_issues_count']
98
+ end
79
99
 
80
100
  issues
81
101
  end
@@ -142,8 +162,13 @@ module Repos
142
162
  commits_fetch = HTTParty.get(@GITHUB_API_BASE_URL + "/commits?access_token=#{@access_token}", headers: {
143
163
  "User-Agent" => @user_agent
144
164
  })
145
- last_commit_date = commits_fetch.first['commit']['author']['date']
146
- last_commit = (Date.today - Date.parse(last_commit_date)).to_i
165
+
166
+ if commits_fetch['message'] === 'Not Found'
167
+ last_commit = nil
168
+ else
169
+ last_commit_date = commits_fetch.first['commit']['author']['date']
170
+ last_commit = (Date.today - Date.parse(last_commit_date)).to_i
171
+ end
147
172
 
148
173
  last_commit
149
174
  end
@@ -1,4 +1,4 @@
1
1
  # Versioning
2
2
  module Repos
3
- VERSION = '0.1.15'
3
+ VERSION = '0.1.16'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repocrawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Chen