git-trend 1.2.7 → 1.2.8
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/.travis.yml +3 -3
- data/CHANGELOG.md +4 -0
- data/README.md +3 -4
- data/git-trend.gemspec +3 -2
- data/lib/git_trend/formatters/text_formatter.rb +2 -2
- data/lib/git_trend/scraper.rb +2 -2
- data/lib/git_trend/version.rb +1 -1
- data/spec/fixtures/trending/alloy +6315 -5664
- data/spec/fixtures/trending/index +7697 -6598
- data/spec/fixtures/trending/ruby +7670 -6569
- data/spec/fixtures/trending/ruby?since=weekly +7668 -6576
- data/spec/fixtures/trending?since= +8347 -0
- data/spec/fixtures/trending?since=daily +8347 -0
- data/spec/fixtures/trending?since=monthly +7705 -6503
- data/spec/fixtures/trending?since=monthly.html +8342 -0
- data/spec/fixtures/trending?since=weekly +7709 -6502
- data/spec/git_trend/cli_spec.rb +270 -179
- metadata +12 -10
- data/spec/fixtures/trending?since= +0 -1
- data/spec/fixtures/trending?since=daily +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b30372f0e002b9968b9282bee0b19aabe1228c193c7a2e3a680d7a7d8bb4115
|
|
4
|
+
data.tar.gz: cc5c8be729e2fe42e449f0c4bbdb92900a2a559b375a859b16ca2fdadcfe6519
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84350b86263cb800468a322906051a25e80f833a1c17940ea108c2dd4d181318b45074ec1da1dfe97962c846d6e95a8945848ef4d6dfbaed1528c4171313aeb2
|
|
7
|
+
data.tar.gz: 1b6e8013a787a4f74f7b6e116e4668357c1496761a5bf1cd133bf48b8affe06962489740733c128ecf0ad55f663dbefa317173da0cd5eaff41cbbbffb1b86e91
|
data/.travis.yml
CHANGED
|
@@ -3,9 +3,9 @@ env:
|
|
|
3
3
|
- CC_TEST_REPORTER_ID=2eb7b0f374e08e909106152c788cb32d24d6440cd41c14fe971a40a8ec971ca2
|
|
4
4
|
language: ruby
|
|
5
5
|
rvm:
|
|
6
|
-
- 2.
|
|
7
|
-
- 2.5
|
|
8
|
-
-
|
|
6
|
+
- 2.6.9
|
|
7
|
+
- 2.7.5
|
|
8
|
+
- 3.0.3
|
|
9
9
|
before_script:
|
|
10
10
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
11
11
|
- chmod +x ./cc-test-reporter
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
[](https://travis-ci.com/rochefort/git-trend)
|
|
2
|
+
[](https://coveralls.io/github/rochefort/git-trend?branch=master)
|
|
3
3
|
[](https://codeclimate.com/github/rochefort/git-trend/maintainability)
|
|
4
|
-
[](https://codeclimate.com/github/rochefort/git-trend/test_coverage)
|
|
5
4
|
[](http://badge.fury.io/rb/git-trend)
|
|
6
5
|
|
|
7
6
|
|
|
@@ -21,7 +20,7 @@ And this also work as a command line utility.
|
|
|
21
20
|
|
|
22
21
|
## Requirements
|
|
23
22
|
|
|
24
|
-
Ruby versions is 2.
|
|
23
|
+
Ruby versions is 2.4 or later.
|
|
25
24
|
|
|
26
25
|
## Installation
|
|
27
26
|
Add this line to your application's Gemfile:
|
data/git-trend.gemspec
CHANGED
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.description = spec.summary
|
|
18
18
|
spec.homepage = "https://github.com/rochefort/git-trend"
|
|
19
19
|
spec.license = "MIT"
|
|
20
|
+
spec.required_ruby_version = ">= 2.5.0"
|
|
20
21
|
|
|
21
22
|
spec.files = `git ls-files -z`.split("\x0")
|
|
22
23
|
spec.bindir = "exe"
|
|
@@ -29,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
|
29
30
|
spec.add_dependency "addressable", "~> 2.8"
|
|
30
31
|
spec.add_dependency "mb_string"
|
|
31
32
|
spec.add_dependency "mechanize", ">= 2.7.5", "< 2.9.0"
|
|
32
|
-
spec.add_dependency "thor", ">= 0.20.0", "< 1.
|
|
33
|
+
spec.add_dependency "thor", ">= 0.20.0", "< 1.3.0"
|
|
33
34
|
spec.add_dependency "unicode-display_width"
|
|
34
35
|
|
|
35
36
|
spec.add_development_dependency "bundler"
|
|
@@ -42,7 +43,7 @@ Gem::Specification.new do |spec|
|
|
|
42
43
|
spec.add_development_dependency "pry-byebug"
|
|
43
44
|
spec.add_development_dependency "rspec", "~> 3.10.0"
|
|
44
45
|
spec.add_development_dependency "simplecov", "~>0.16.1"
|
|
45
|
-
spec.add_development_dependency "webmock", "~> 3.
|
|
46
|
+
spec.add_development_dependency "webmock", "~> 3.14.0"
|
|
46
47
|
|
|
47
48
|
spec.add_development_dependency "coveralls", "~> 0.8.23"
|
|
48
49
|
end
|
|
@@ -67,7 +67,7 @@ module GitTrend::Formatters
|
|
|
67
67
|
fmt = "%#{f[0]}s %-#{f[1]}s %-#{f[2]}s %#{f[3]}s"
|
|
68
68
|
fmt << " %-#{f[4]}s" if @enable_description
|
|
69
69
|
|
|
70
|
-
puts fmt % header
|
|
70
|
+
puts (fmt % header).rstrip
|
|
71
71
|
puts fmt % @columns_sizes.map { |column| "-" * column }
|
|
72
72
|
end
|
|
73
73
|
|
|
@@ -84,7 +84,7 @@ module GitTrend::Formatters
|
|
|
84
84
|
description_fmt = " %-#{f.last - mb_char_size}s"
|
|
85
85
|
end
|
|
86
86
|
result = "#{fmt}#{description_fmt}" % data
|
|
87
|
-
puts result
|
|
87
|
+
puts result.rstrip
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
|
data/lib/git_trend/scraper.rb
CHANGED
|
@@ -51,10 +51,10 @@ module GitTrend
|
|
|
51
51
|
|
|
52
52
|
def generate_project(page)
|
|
53
53
|
page.search(".Box-row").map do |content|
|
|
54
|
-
icon_area = content.search(".f6.color-
|
|
54
|
+
icon_area = content.search(".f6.color-fg-muted.mt-2")
|
|
55
55
|
Project.new(
|
|
56
56
|
name: content.search("h1 a").attr("href").to_s.sub(/\A\//, ""),
|
|
57
|
-
description: content.search(".col-9.color-
|
|
57
|
+
description: content.search(".col-9.color-fg-muted.my-1.pr-4").text.strip,
|
|
58
58
|
lang: content.search('span[itemprop="programmingLanguage"]').text.strip,
|
|
59
59
|
all_star_count: comma_to_i(icon_area.search("a:has(svg.octicon-star)").text.strip),
|
|
60
60
|
fork_count: comma_to_i(icon_area.search("a:has(svg.octicon-repo-forked)").text.strip),
|
data/lib/git_trend/version.rb
CHANGED