proxy_fetcher 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/CHANGELOG.md +4 -0
- data/bin/proxy_fetcher +1 -1
- data/lib/proxy_fetcher/version.rb +1 -1
- data/proxy_fetcher.gemspec +2 -2
- data/spec/proxy_fetcher/client_spec.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb17af3b54c59182794340dd9e07351e3107c380
|
4
|
+
data.tar.gz: f86f209533d12f4a536ac4a5ae07d48a8afc9e90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ecf1b6ee299550228ea651a220bcc9d85f3e383844974416862d567634a35d41d3650499ee6a8695af9b26c53fea3bba35a57336b1cfc795996df10c301751b
|
7
|
+
data.tar.gz: dcb39302fa9b2b43869be96484794d273a579546f92c27d5103f535d2fe8768220ab3a781d8373a58e11ebe5a2abe9efb13c772c32b088aa393bf890ca66c385
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/bin/proxy_fetcher
CHANGED
@@ -41,7 +41,7 @@ OptionParser.new do |opts|
|
|
41
41
|
end.parse!
|
42
42
|
|
43
43
|
ProxyFetcher.config.providers = options[:providers] if options[:providers]
|
44
|
-
ProxyFetcher.config.
|
44
|
+
ProxyFetcher.config.timeout = options[:timeout] if options[:timeout]
|
45
45
|
|
46
46
|
manager = ProxyFetcher::Manager.new(filters: options[:filters])
|
47
47
|
manager.validate! if options[:validate]
|
data/proxy_fetcher.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'proxy_fetcher/version'
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = 'proxy_fetcher'
|
7
7
|
gem.version = ProxyFetcher.gem_version
|
8
|
-
gem.date = '2017-
|
8
|
+
gem.date = '2017-11-13'
|
9
9
|
gem.summary = 'Ruby gem for dealing with proxy lists from different providers'
|
10
10
|
gem.description = 'This gem can help your Ruby application to make HTTP(S) requests ' \
|
11
11
|
'from proxy server by fetching and validating proxy lists from the different providers.'
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
18
18
|
gem.homepage = 'http://github.com/nbulaj/proxy_fetcher'
|
19
19
|
gem.license = 'MIT'
|
20
|
-
gem.required_ruby_version = '>= 2.
|
20
|
+
gem.required_ruby_version = '>= 2.0.0'
|
21
21
|
|
22
22
|
gem.add_runtime_dependency 'nokogiri', '~> 1.6', '>= 1.6'
|
23
23
|
|
@@ -108,6 +108,18 @@ describe ProxyFetcher::Client do
|
|
108
108
|
|
109
109
|
expect { ProxyFetcher::Client.get('http://httpbin.org') }.to raise_error(ProxyFetcher::Exceptions::MaximumRetriesReached)
|
110
110
|
end
|
111
|
+
|
112
|
+
it 'raises an error when http request returns an error' do
|
113
|
+
allow_any_instance_of(Net::HTTP).to receive(:request).and_return(Net::HTTPBadRequest.new('', '', ''))
|
114
|
+
|
115
|
+
expect { ProxyFetcher::Client.get('http://httpbin.org') }.to raise_error(ProxyFetcher::Exceptions::MaximumRetriesReached)
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'refreshes proxy lists if no proxy found' do
|
119
|
+
ProxyFetcher::Client::ProxiesRegistry.manager.instance_variable_set(:'@proxies', [])
|
120
|
+
|
121
|
+
expect { ProxyFetcher::Client.get('http://httpbin.org') }.not_to raise_error(ProxyFetcher::Exceptions::MaximumRetriesReached)
|
122
|
+
end
|
111
123
|
end
|
112
124
|
|
113
125
|
context 'redirects' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxy_fetcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Bulai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
111
|
requirements:
|
112
112
|
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: 2.
|
114
|
+
version: 2.0.0
|
115
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
117
|
- - ">="
|