git-trend 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +48 -39
- data/git-trend.gemspec +5 -6
- data/lib/git_trend/version.rb +1 -1
- data/spec/git_trend/scraper_spec.rb +15 -6
- data/spec/spec_helper.rb +0 -1
- metadata +14 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3de2ef516de70662c6b0e2fc26fadb1c474b3b7b
|
4
|
+
data.tar.gz: 23424ba56d2c4d993448d35174dba801d661140c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59767034d3a06bd1a49748a32638db9056b44e31005ee41aaacf50b98f5688a49162e6779850019539f964f594cfd0bbec80963df56889babac94bea72ef92df
|
7
|
+
data.tar.gz: a04ede690fcfd3610a374f1b882a336c936023b1ace92240b1479192bf71439494c82754c186d3a7a2161d09960a3be13457aee9c65a027948f84c87ce56bd99
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -16,12 +16,15 @@ Ruby versions is 2.0 or later.
|
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
Add this line to your application's Gemfile:
|
19
|
+
|
19
20
|
gem 'git-trend'
|
20
21
|
|
21
22
|
And then execute:
|
22
|
-
|
23
|
+
|
24
|
+
$ bundle
|
23
25
|
|
24
26
|
Or install it yourself as:
|
27
|
+
|
25
28
|
$ gem install git-trend
|
26
29
|
|
27
30
|
## Usage Of a gem
|
@@ -32,38 +35,42 @@ Require it if you haven't:
|
|
32
35
|
|
33
36
|
### Fetch trending
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
38
|
+
```ruby
|
39
|
+
repos = GitTrend.get
|
40
|
+
repos.each do |r|
|
41
|
+
puts "#{r.name} (#{r.star_count} stargazers)"
|
42
|
+
puts "--- #{r.description}\n\n"
|
43
|
+
end
|
44
|
+
|
45
|
+
# =>
|
46
|
+
# jayphelps/git-blame-someone-else (625 stargazers)
|
47
|
+
# --- Blame someone else for your bad code.
|
48
|
+
#
|
49
|
+
# FreeCodeCamp/FreeCodeCamp (574 stargazers)
|
50
|
+
# --- The http://FreeCodeCamp.com open source codebase and curriculum. Learn to # code and help nonprofits.
|
51
|
+
#
|
52
|
+
# p-e-w/maybe (519 stargazers)
|
53
|
+
# --- See what a program does before deciding whether you really want it to happen.
|
54
|
+
# ...
|
55
|
+
```
|
51
56
|
|
52
57
|
### Use language and since options
|
53
58
|
|
54
|
-
|
55
|
-
|
56
|
-
|
59
|
+
```ruby
|
60
|
+
# language
|
61
|
+
GitTrend.get('ruby')
|
62
|
+
GitTrend.get(:ruby)
|
57
63
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
# since
|
65
|
+
GitTrend.get(since: :weekly)
|
66
|
+
GitTrend.get(since: :week)
|
67
|
+
GitTrend.get(since: :w)
|
68
|
+
|
69
|
+
# language and since
|
70
|
+
GitTrend.get('ruby', 'weekly')
|
71
|
+
GitTrend.get(:ruby, :weekly)
|
72
|
+
GitTrend.get(language: :ruby, since: :weekly)
|
73
|
+
```
|
67
74
|
|
68
75
|
### Show enable languages
|
69
76
|
|
@@ -150,15 +157,17 @@ No. Name Lang Star Description
|
|
150
157
|
|
151
158
|
### Fetch weekly/monthly trending
|
152
159
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
160
|
+
```ruby
|
161
|
+
git trend -s weekly
|
162
|
+
git trend -s week
|
163
|
+
git trend -s w
|
164
|
+
|
165
|
+
or
|
166
|
+
|
167
|
+
git trend -s monthly
|
168
|
+
git trend -s month
|
169
|
+
git trend -s m
|
170
|
+
```
|
162
171
|
|
163
172
|
e.g.:
|
164
173
|
|
@@ -223,7 +232,7 @@ alias trend='g trend -n 10 && g trend -l ruby -n 5 && g trend -l JavaScript -n 5
|
|
223
232
|
|
224
233
|
## Contributing
|
225
234
|
|
226
|
-
1. Fork it ( https://github.com/
|
235
|
+
1. Fork it ( https://github.com/rochefort/git-trend/fork )
|
227
236
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
228
237
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
229
238
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/git-trend.gemspec
CHANGED
@@ -36,19 +36,18 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.post_install_message = install_message
|
37
37
|
|
38
38
|
spec.add_dependency 'addressable', '~> 2.4.0'
|
39
|
-
spec.add_dependency 'mb_string', '~> 0.1.
|
39
|
+
spec.add_dependency 'mb_string', '~> 0.1.6'
|
40
40
|
spec.add_dependency 'mechanize', '~> 2.7.4'
|
41
41
|
spec.add_dependency 'thor', '~> 0.19.1'
|
42
|
-
spec.add_dependency 'unicode-display_width', '~> 0.3
|
42
|
+
spec.add_dependency 'unicode-display_width', '~> 1.0.3'
|
43
43
|
|
44
44
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
45
|
-
spec.add_development_dependency 'rake'
|
45
|
+
spec.add_development_dependency 'rake', '~> 11.1.2'
|
46
46
|
|
47
47
|
spec.add_development_dependency 'rspec', '~> 3.4.0'
|
48
|
-
spec.add_development_dependency '
|
49
|
-
spec.add_development_dependency 'simplecov', '~> 0.11.1'
|
48
|
+
spec.add_development_dependency 'simplecov', '~> 0.11.2'
|
50
49
|
spec.add_development_dependency 'safe_yaml', '~> 1.0.4' # for Ruby2.2.0
|
51
|
-
spec.add_development_dependency 'webmock', '~> 1.
|
50
|
+
spec.add_development_dependency 'webmock', '~> 1.24.2'
|
52
51
|
|
53
52
|
spec.add_development_dependency 'coveralls'
|
54
53
|
spec.add_development_dependency 'codeclimate-test-reporter'
|
data/lib/git_trend/version.rb
CHANGED
@@ -1,16 +1,25 @@
|
|
1
|
+
include GitTrend
|
1
2
|
RSpec.describe GitTrend::Scraper do
|
2
3
|
let(:scraper) { Scraper.new }
|
3
4
|
|
4
5
|
describe 'settings' do
|
5
6
|
before do
|
6
|
-
allow(ENV).to receive(:[]).with('http_proxy').and_return(
|
7
|
+
allow(ENV).to receive(:[]).with('http_proxy').and_return("http://#{proxy_user}:#{proxy_pass}@#{proxy_addr}:#{proxy_port}")
|
7
8
|
end
|
9
|
+
let(:proxy_addr) { '192.168.1.99' }
|
10
|
+
let(:proxy_port) { 9999 }
|
11
|
+
let(:proxy_user) { 'proxy_user' }
|
12
|
+
let(:proxy_pass) { 'proxy_pass' }
|
8
13
|
subject { scraper.instance_variable_get(:@agent) }
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
it 'should use proxy settings of ENV' do
|
15
|
+
aggregate_failures do
|
16
|
+
expect(subject.proxy_addr).to eq proxy_addr
|
17
|
+
expect(subject.proxy_user).to eq proxy_user
|
18
|
+
expect(subject.proxy_pass).to eq proxy_pass
|
19
|
+
expect(subject.proxy_port).to eq proxy_port
|
20
|
+
expect(subject.user_agent).to eq "git-trend #{VERSION}"
|
21
|
+
end
|
22
|
+
end
|
14
23
|
end
|
15
24
|
|
16
25
|
describe '#get' do
|
data/spec/spec_helper.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rochefort
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.
|
33
|
+
version: 0.1.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1.
|
40
|
+
version: 0.1.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mechanize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.3
|
75
|
+
version: 1.0.3
|
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.3
|
82
|
+
version: 1.0.3
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,16 +98,16 @@ dependencies:
|
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 11.1.2
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 11.1.2
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,34 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 3.4.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rspec-its
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 1.2.0
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 1.2.0
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: simplecov
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.11.
|
131
|
+
version: 0.11.2
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.11.
|
138
|
+
version: 0.11.2
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: safe_yaml
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +156,14 @@ dependencies:
|
|
170
156
|
requirements:
|
171
157
|
- - "~>"
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
159
|
+
version: 1.24.2
|
174
160
|
type: :development
|
175
161
|
prerelease: false
|
176
162
|
version_requirements: !ruby/object:Gem::Requirement
|
177
163
|
requirements:
|
178
164
|
- - "~>"
|
179
165
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
166
|
+
version: 1.24.2
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
168
|
name: coveralls
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|