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 +4 -4
- data/lib/repocrawler/crawler.rb +31 -6
- data/lib/repocrawler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37a0377e676e1214a35dbe3c0cb1714a93eb5c24
|
|
4
|
+
data.tar.gz: e7ab2fe71d76c68a1c1d30c19629aa7466b28c7f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b0bbd87d110ec64fc13b85a3d4741c3fac7174f192e61f78fcd6d960cb5d7bf786df7fd0dc9d1c3d4c58f2842273565054487a348dcef01294beb3433afec89
|
|
7
|
+
data.tar.gz: 52a0c3d765d91aad5ab547a052d645943ad750c917a2557b82c08fc68731070e800ae9c4890066aaf311106f352f2acbea922a8d9dfb731fd4401717cf745c18
|
data/lib/repocrawler/crawler.rb
CHANGED
|
@@ -25,7 +25,12 @@ module Repos
|
|
|
25
25
|
"User-Agent" => @user_agent
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
last_year_commit_activity
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
146
|
-
|
|
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
|
data/lib/repocrawler/version.rb
CHANGED