git-trend 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/git_trend/scraper.rb +10 -3
- data/lib/git_trend/version.rb +1 -1
- data/spec/git_trend/cli_spec.rb +26 -26
- 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: 73261d9bfda7162623acfc4de5040c49cadd456a
|
4
|
+
data.tar.gz: 5ee77e9f1bb502e88abc7bded2ec7cdfbc9a153f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac5599f6f4f1234d11e62414aa18f53f6a1edc1bddf84652d09956187f84d38a3c16d1f57f11563120ffcae6157976be1e88a0de8c8c96c1960227ad3eb90f19
|
7
|
+
data.tar.gz: 944a0036fba0aec626a34aa1b34c03133cb64cc2118640ca07d915141b602dae2c2ad669b4d0b1afdf64fbe7b6884261256df0e75468a7d0c3a479db8bb838a4
|
data/CHANGELOG.md
CHANGED
data/lib/git_trend/scraper.rb
CHANGED
@@ -52,15 +52,22 @@ module GitTrend
|
|
52
52
|
|
53
53
|
def generate_project(page)
|
54
54
|
content = page.search(".repo-list li").map do |content|
|
55
|
+
all_star_count = comma_to_i(content.search('a[aria-label="Stargazers"]').text.strip)
|
56
|
+
fork_count = comma_to_i(content.search('a[aria-label="Forks"]').text.strip)
|
57
|
+
star_count = comma_to_i(content.search("span.float-right").text.strip.match(/(.+)? stars/).to_a[1])
|
55
58
|
Project.new(
|
56
59
|
name: content.search("h3 a").attr("href").to_s.sub(/\A\//, ""),
|
57
60
|
description: content.search(".py-1").text.strip,
|
58
61
|
lang: content.search('span[itemprop="programmingLanguage"]').text.strip,
|
59
|
-
all_star_count:
|
60
|
-
fork_count:
|
61
|
-
star_count:
|
62
|
+
all_star_count: all_star_count,
|
63
|
+
fork_count: fork_count,
|
64
|
+
star_count: star_count
|
62
65
|
)
|
63
66
|
end
|
64
67
|
end
|
68
|
+
|
69
|
+
def comma_to_i(obj)
|
70
|
+
obj.to_s.delete(",").to_i
|
71
|
+
end
|
65
72
|
end
|
66
73
|
end
|
data/lib/git_trend/version.rb
CHANGED
data/spec/git_trend/cli_spec.rb
CHANGED
@@ -315,19 +315,19 @@ RSpec.describe GitTrend::CLI do
|
|
315
315
|
<<-'EOS'.unindent
|
316
316
|
|No. Name Lang Star
|
317
317
|
|--- ---------------------------------------------- ---------- ------
|
318
|
-
| 1 verekia/js-stack-from-scratch JavaScript
|
319
|
-
| 2 alexjc/neural-enhance Python
|
320
|
-
| 3 FreeCodeCamp/FreeCodeCamp JavaScript
|
321
|
-
| 4 witheve/Eve JavaScript
|
322
|
-
| 5 Bilibili/flv.js JavaScript
|
323
|
-
| 6 lengstrom/fast-style-transfer Python
|
324
|
-
| 7 VoLuong/Begin-Latex-in-minutes
|
325
|
-
| 8 minoca/os C
|
326
|
-
| 9 sqreen/awesome-nodejs-projects
|
327
|
-
| 10 th0r/webpack-bundle-analyzer JavaScript
|
328
|
-
| 11 blue-yonder/tsfresh Python
|
329
|
-
| 12 zeit/next.js JavaScript
|
330
|
-
| 13 GoogleChrome/lighthouse JavaScript
|
318
|
+
| 1 verekia/js-stack-from-scratch JavaScript 5179
|
319
|
+
| 2 alexjc/neural-enhance Python 4370
|
320
|
+
| 3 FreeCodeCamp/FreeCodeCamp JavaScript 2902
|
321
|
+
| 4 witheve/Eve JavaScript 2894
|
322
|
+
| 5 Bilibili/flv.js JavaScript 1867
|
323
|
+
| 6 lengstrom/fast-style-transfer Python 1652
|
324
|
+
| 7 VoLuong/Begin-Latex-in-minutes 1649
|
325
|
+
| 8 minoca/os C 1613
|
326
|
+
| 9 sqreen/awesome-nodejs-projects 1450
|
327
|
+
| 10 th0r/webpack-bundle-analyzer JavaScript 1419
|
328
|
+
| 11 blue-yonder/tsfresh Python 1338
|
329
|
+
| 12 zeit/next.js JavaScript 1134
|
330
|
+
| 13 GoogleChrome/lighthouse JavaScript 1056
|
331
331
|
| 14 jwasham/google-interview-university 867
|
332
332
|
| 15 mas-cli/mas Swift 926
|
333
333
|
| 16 mattrajca/sudo-touchid C 880
|
@@ -348,19 +348,19 @@ RSpec.describe GitTrend::CLI do
|
|
348
348
|
<<-'EOS'.unindent
|
349
349
|
|No. Name Lang Star
|
350
350
|
|--- ---------------------------------------------- ---------- ------
|
351
|
-
| 1 verekia/js-stack-from-scratch JavaScript
|
352
|
-
| 2 alexjc/neural-enhance Python
|
353
|
-
| 3 FreeCodeCamp/FreeCodeCamp JavaScript
|
354
|
-
| 4 witheve/Eve JavaScript
|
355
|
-
| 5 Bilibili/flv.js JavaScript
|
356
|
-
| 6 lengstrom/fast-style-transfer Python
|
357
|
-
| 7 VoLuong/Begin-Latex-in-minutes
|
358
|
-
| 8 minoca/os C
|
359
|
-
| 9 sqreen/awesome-nodejs-projects
|
360
|
-
| 10 th0r/webpack-bundle-analyzer JavaScript
|
361
|
-
| 11 blue-yonder/tsfresh Python
|
362
|
-
| 12 zeit/next.js JavaScript
|
363
|
-
| 13 GoogleChrome/lighthouse JavaScript
|
351
|
+
| 1 verekia/js-stack-from-scratch JavaScript 5179
|
352
|
+
| 2 alexjc/neural-enhance Python 4370
|
353
|
+
| 3 FreeCodeCamp/FreeCodeCamp JavaScript 2902
|
354
|
+
| 4 witheve/Eve JavaScript 2894
|
355
|
+
| 5 Bilibili/flv.js JavaScript 1867
|
356
|
+
| 6 lengstrom/fast-style-transfer Python 1652
|
357
|
+
| 7 VoLuong/Begin-Latex-in-minutes 1649
|
358
|
+
| 8 minoca/os C 1613
|
359
|
+
| 9 sqreen/awesome-nodejs-projects 1450
|
360
|
+
| 10 th0r/webpack-bundle-analyzer JavaScript 1419
|
361
|
+
| 11 blue-yonder/tsfresh Python 1338
|
362
|
+
| 12 zeit/next.js JavaScript 1134
|
363
|
+
| 13 GoogleChrome/lighthouse JavaScript 1056
|
364
364
|
| 14 jwasham/google-interview-university 867
|
365
365
|
| 15 mas-cli/mas Swift 926
|
366
366
|
| 16 mattrajca/sudo-touchid C 880
|