git-trend 0.1.1 → 0.1.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 +6 -0
- data/lib/git_trend/scraper.rb +2 -0
- data/lib/git_trend/version.rb +1 -1
- data/spec/git_trend/scraper_spec.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 061a2e4cffbd2cfa25529a5765d458215102ce53
|
4
|
+
data.tar.gz: f49d4d8ac30608e28e838e9bf5f2c585aea587c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d43d894c47c36d228c030c64c681a84b1467aa750f3632e606d336aad4a86604835cb2a3ef296019ce801d7536ec463827821fd9b8394f82037e6f4135b8659f
|
7
|
+
data.tar.gz: 2bd04010ac17bc8b5e55e8b221553d231d9a8baee8faf9c902d13c3449b35ee38b5584b22262c2067a38e75d979c9c76f8591c0c6b00110f52b487f9ba203234
|
data/CHANGELOG.md
CHANGED
data/lib/git_trend/scraper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
require 'mechanize'
|
2
3
|
require 'addressable/uri'
|
3
4
|
|
@@ -8,6 +9,7 @@ module GitTrend
|
|
8
9
|
|
9
10
|
def initialize
|
10
11
|
@agent = Mechanize.new
|
12
|
+
@agent.user_agent = "git-trend #{VERSION}"
|
11
13
|
proxy = URI.parse(ENV['http_proxy']) if ENV['http_proxy']
|
12
14
|
@agent.set_proxy(proxy.host, proxy.port, proxy.user, proxy.password) if proxy
|
13
15
|
end
|
data/lib/git_trend/version.rb
CHANGED
@@ -3,12 +3,13 @@ require 'spec_helper'
|
|
3
3
|
include GitTrend
|
4
4
|
RSpec.describe GitTrend::Scraper do
|
5
5
|
|
6
|
-
describe '
|
6
|
+
describe 'settings' do
|
7
7
|
before do
|
8
8
|
allow(ENV).to receive(:[]).with('http_proxy').and_return('http://proxy_user:proxy_pass@192.168.1.99:9999')
|
9
9
|
@scraper = Scraper.new
|
10
10
|
end
|
11
11
|
subject { @scraper.instance_variable_get(:@agent) }
|
12
|
+
its(:user_agent) { should eq "git-trend #{VERSION}" }
|
12
13
|
its(:proxy_addr) { should eq '192.168.1.99' }
|
13
14
|
its(:proxy_user) { should eq 'proxy_user' }
|
14
15
|
its(:proxy_pass) { should eq 'proxy_pass' }
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rochefort
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|