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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d7d6056d338848b20c9fe4e9fe1ad9a85298fe5
4
- data.tar.gz: 74ee4093e0160730e21b7078920f4b81249bfddd
3
+ metadata.gz: 73261d9bfda7162623acfc4de5040c49cadd456a
4
+ data.tar.gz: 5ee77e9f1bb502e88abc7bded2ec7cdfbc9a153f
5
5
  SHA512:
6
- metadata.gz: 38a35e21824b53c209708d72825f479d4a36f2dfb6853d395d7706c8cb8a8a96224bf7a155ba09506a98cff39a5bbe26095ecbe91ff3deab4d1b32b5a2c3fca7
7
- data.tar.gz: 3cd08d846cf726e91799d51d8fe3730eeab7719a7a78b57d00359ca9605c7bb241177e0f0741e923e12b28b507a764b88650e853348405ebb641d7ccbf997b50
6
+ metadata.gz: ac5599f6f4f1234d11e62414aa18f53f6a1edc1bddf84652d09956187f84d38a3c16d1f57f11563120ffcae6157976be1e88a0de8c8c96c1960227ad3eb90f19
7
+ data.tar.gz: 944a0036fba0aec626a34aa1b34c03133cb64cc2118640ca07d915141b602dae2c2ad669b4d0b1afdf64fbe7b6884261256df0e75468a7d0c3a479db8bb838a4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v1.1.4 (Tue Nov 22 2016)
2
+
3
+ - Fix nil could not be considered when converting to integer [6be798a]
4
+
1
5
  ## v1.1.3 (Tue Nov 22 2016)
2
6
  - Fix comma-separated numbers for star count [5b32fa3]
3
7
 
@@ -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: content.search('a[aria-label="Stargazers"]').text.strip.delete(",").to_i,
60
- fork_count: content.search('a[aria-label="Forks"]').text.strip.delete(",").to_i,
61
- star_count: content.search("span.float-right").text.strip.match(/(.+)? stars/).to_a[1].delete(",").to_i
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
@@ -1,3 +1,3 @@
1
1
  module GitTrend
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -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 179
319
- | 2 alexjc/neural-enhance Python 370
320
- | 3 FreeCodeCamp/FreeCodeCamp JavaScript 902
321
- | 4 witheve/Eve JavaScript 894
322
- | 5 Bilibili/flv.js JavaScript 867
323
- | 6 lengstrom/fast-style-transfer Python 652
324
- | 7 VoLuong/Begin-Latex-in-minutes 649
325
- | 8 minoca/os C 613
326
- | 9 sqreen/awesome-nodejs-projects 450
327
- | 10 th0r/webpack-bundle-analyzer JavaScript 419
328
- | 11 blue-yonder/tsfresh Python 338
329
- | 12 zeit/next.js JavaScript 134
330
- | 13 GoogleChrome/lighthouse JavaScript 56
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 179
352
- | 2 alexjc/neural-enhance Python 370
353
- | 3 FreeCodeCamp/FreeCodeCamp JavaScript 902
354
- | 4 witheve/Eve JavaScript 894
355
- | 5 Bilibili/flv.js JavaScript 867
356
- | 6 lengstrom/fast-style-transfer Python 652
357
- | 7 VoLuong/Begin-Latex-in-minutes 649
358
- | 8 minoca/os C 613
359
- | 9 sqreen/awesome-nodejs-projects 450
360
- | 10 th0r/webpack-bundle-analyzer JavaScript 419
361
- | 11 blue-yonder/tsfresh Python 338
362
- | 12 zeit/next.js JavaScript 134
363
- | 13 GoogleChrome/lighthouse JavaScript 56
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-trend
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - rochefort