git-trend 0.2.0 → 0.2.1
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/CHANGELOG.md +4 -0
- data/git-trend.gemspec +2 -2
- data/lib/git_trend/rendering.rb +9 -6
- data/lib/git_trend/version.rb +1 -1
- data/spec/fixtures/trending_including_multibyte_characters +3027 -0
- data/spec/git_trend/cli_spec.rb +49 -2
- metadata +8 -6
data/spec/git_trend/cli_spec.rb
CHANGED
@@ -297,6 +297,19 @@ RSpec.describe GitTrend::CLI do
|
|
297
297
|
end
|
298
298
|
end
|
299
299
|
end
|
300
|
+
|
301
|
+
describe 'without options' do
|
302
|
+
context 'with multibyte chracters' do
|
303
|
+
before do
|
304
|
+
ENV['COLUMNS'] = '140'
|
305
|
+
ENV['LINES'] = '40'
|
306
|
+
stub_request_get('trending', 'trending_including_multibyte_characters')
|
307
|
+
end
|
308
|
+
it 'display daily ranking' do
|
309
|
+
expect { @cli.invoke(:list, []) }.to output(dummy_result_no_options_with_multibyte_characters).to_stdout
|
310
|
+
end
|
311
|
+
end
|
312
|
+
end
|
300
313
|
end
|
301
314
|
|
302
315
|
describe '#languages' do
|
@@ -523,16 +536,17 @@ RSpec.describe GitTrend::CLI do
|
|
523
536
|
|
524
537
|
private
|
525
538
|
|
526
|
-
def stub_request_get(stub_url)
|
539
|
+
def stub_request_get(stub_url, stub_file_name = nil)
|
527
540
|
url = Scraper::BASE_HOST.dup
|
528
541
|
url << "/#{stub_url}" if stub_url
|
529
542
|
uri = URI.parse(url)
|
530
543
|
|
544
|
+
stub_file = stub_file_name || stub_url
|
531
545
|
stub_request(:get, uri)
|
532
546
|
.to_return(
|
533
547
|
status: 200,
|
534
548
|
headers: { content_type: 'text/html' },
|
535
|
-
body: load_http_stub(
|
549
|
+
body: load_http_stub(stub_file))
|
536
550
|
end
|
537
551
|
|
538
552
|
def dummy_result_without_description
|
@@ -600,4 +614,37 @@ RSpec.describe GitTrend::CLI do
|
|
600
614
|
|
601
615
|
EOS
|
602
616
|
end
|
617
|
+
|
618
|
+
def dummy_result_no_options_with_multibyte_characters
|
619
|
+
<<-'EOS'.unindent
|
620
|
+
|No. Name Lang Star Description
|
621
|
+
|--- ---------------------------------------- ---------- ------ -----------------------------------------------------------------------------
|
622
|
+
| 1 apple/swift C++ 1487 The Swift Programming Language
|
623
|
+
| 2 hashcat/hashcat C 383 Advanced CPU-based password recovery utility
|
624
|
+
| 3 airbnb/reagent JavaScript 416 JavaScript Testing utilities for React
|
625
|
+
| 4 FreeCodeCamp/FreeCodeCamp JavaScript 381 The http://FreeCodeCamp.com open source codebase and curriculum. Learn to ...
|
626
|
+
| 5 diafygi/acme-tiny Python 311 A tiny script to issue and renew TLS certs from Let's Encrypt
|
627
|
+
| 6 letsencrypt/letsencrypt Python 300 This Let's Encrypt repo is an ACME client that can obtain certs and extens...
|
628
|
+
| 7 twitter/labella.js JavaScript 248 Placing labels on a timeline without overlap.
|
629
|
+
| 8 LeaVerou/bliss HTML 228 Blissful JavaScript
|
630
|
+
| 9 nathancahill/Split.js JavaScript 217 Lightweight, unopinionated utility for adjustable split views
|
631
|
+
| 10 hashcat/oclHashcat C 194 World's fastest and most advanced GPGPU-based password recovery utility
|
632
|
+
| 11 apple/swift-package-manager Swift 190 The Package Manager for the Swift Programming Language
|
633
|
+
| 12 documentationjs/documentation JavaScript 177 beautiful, flexible, powerful js docs
|
634
|
+
| 13 HospitalRun/hospitalrun-frontend JavaScript 167 Ember front end for HospitalRun
|
635
|
+
| 14 NARKOZ/hacker-scripts JavaScript 139 Based on a true story
|
636
|
+
| 15 apple/swift-evolution 140
|
637
|
+
| 16 MaximAbramchuck/awesome-interviews 139 A curated awesome list of lists of interview questions. Feel free to contr...
|
638
|
+
| 17 adleroliveira/dreamjs JavaScript 136 A lightweight json data generator.
|
639
|
+
| 18 huytd/swift-http Swift 125 HTTP Implementation for Swift on Linux and Mac OS X
|
640
|
+
| 19 diafygi/gethttpsforfree JavaScript 118 Source code for https://gethttpsforfree.com/
|
641
|
+
| 20 apple/swift-corelibs-foundation C 93 The Foundation Project, providing core utilities, internationalization, an...
|
642
|
+
| 21 xenolf/lego Go 100 Let's Encrypt client and ACME library written in Go
|
643
|
+
| 22 fengyuanchen/cropperjs JavaScript 95 JavaScript image cropper.
|
644
|
+
| 23 proflin/CoolplaySpark 85 酷玩 Spark
|
645
|
+
| 24 incrediblesound/story-graph JavaScript 87 The Graph that Generates Stories
|
646
|
+
| 25 geeeeeeeeek/WeChatLuckyMoney Java 75 微信抢红包插件, an Android app that helps you snatch virtual red envelopes...
|
647
|
+
|
648
|
+
EOS
|
649
|
+
end
|
603
650
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-trend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rochefort
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.3.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.3.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.11.
|
145
|
+
version: 0.11.1
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.11.
|
152
|
+
version: 0.11.1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: safe_yaml
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- spec/fixtures/trending?since=daily
|
240
240
|
- spec/fixtures/trending?since=monthly
|
241
241
|
- spec/fixtures/trending?since=weekly
|
242
|
+
- spec/fixtures/trending_including_multibyte_characters
|
242
243
|
- spec/git_trend/cli_spec.rb
|
243
244
|
- spec/git_trend/scraper_spec.rb
|
244
245
|
- spec/spec_helper.rb
|
@@ -275,6 +276,7 @@ test_files:
|
|
275
276
|
- spec/fixtures/trending?since=daily
|
276
277
|
- spec/fixtures/trending?since=monthly
|
277
278
|
- spec/fixtures/trending?since=weekly
|
279
|
+
- spec/fixtures/trending_including_multibyte_characters
|
278
280
|
- spec/git_trend/cli_spec.rb
|
279
281
|
- spec/git_trend/scraper_spec.rb
|
280
282
|
- spec/spec_helper.rb
|