proxied 0.2.2 → 0.2.3
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/Gemfile.lock +14 -14
- data/lib/proxied/checker.rb +8 -4
- data/lib/proxied/version.rb +1 -1
- data/lib/tasks/tasks.rake +3 -2
- data/proxied.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e005242b58393ef158bf5c9174f37a1a9f8f0bfc28d7e2f6d2efe4dd8b055d9
|
|
4
|
+
data.tar.gz: 3f8eb894ecedf42f9915d1c622430962fd08ae7f0f194b1bf3e813710deec428
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f72c919f4acae7c8dd32ea148f64e0e664de16dff6d2b2fb8050f5111ab32ff85f8ca266eb43459edc317d42abc1e83971aae839561ccc6ac5898870adc75b9
|
|
7
|
+
data.tar.gz: cabff401d31f825a5b909a7a16f3ae9a9ce4e8ee26104c5e3dcc5cf9db1eb3a67e985b781005cbbbd4b4b00534a694447e7af616f650e3585a6e2128a86729bd
|
data/Gemfile.lock
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
proxied (0.2.
|
|
4
|
+
proxied (0.2.3)
|
|
5
5
|
faraday (>= 0.15.4)
|
|
6
|
-
net-ssh (>= 5.
|
|
6
|
+
net-ssh (>= 5.2)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
@@ -49,8 +49,8 @@ GEM
|
|
|
49
49
|
i18n (>= 0.7, < 2)
|
|
50
50
|
minitest (~> 5.1)
|
|
51
51
|
tzinfo (~> 1.1)
|
|
52
|
-
addressable (2.
|
|
53
|
-
public_suffix (>= 2.0.2, <
|
|
52
|
+
addressable (2.7.0)
|
|
53
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
54
54
|
appraisal (2.2.0)
|
|
55
55
|
bundler
|
|
56
56
|
rake
|
|
@@ -80,7 +80,7 @@ GEM
|
|
|
80
80
|
railties (>= 3.0.0)
|
|
81
81
|
globalid (0.4.2)
|
|
82
82
|
activesupport (>= 4.2.0)
|
|
83
|
-
hashdiff (0.
|
|
83
|
+
hashdiff (1.0.0)
|
|
84
84
|
i18n (1.6.0)
|
|
85
85
|
concurrent-ruby (~> 1.0)
|
|
86
86
|
ice_nine (0.11.2)
|
|
@@ -93,18 +93,18 @@ GEM
|
|
|
93
93
|
mimemagic (~> 0.3.2)
|
|
94
94
|
method_source (0.9.2)
|
|
95
95
|
mimemagic (0.3.3)
|
|
96
|
-
mini_mime (1.0.
|
|
96
|
+
mini_mime (1.0.2)
|
|
97
97
|
mini_portile2 (2.4.0)
|
|
98
|
-
minitest (5.
|
|
98
|
+
minitest (5.12.0)
|
|
99
99
|
multipart-post (2.1.1)
|
|
100
100
|
net-ssh (5.2.0)
|
|
101
|
-
nio4r (2.
|
|
102
|
-
nokogiri (1.10.
|
|
101
|
+
nio4r (2.5.2)
|
|
102
|
+
nokogiri (1.10.4)
|
|
103
103
|
mini_portile2 (~> 2.4.0)
|
|
104
104
|
pry (0.12.2)
|
|
105
105
|
coderay (~> 1.1.0)
|
|
106
106
|
method_source (~> 0.9.0)
|
|
107
|
-
public_suffix (
|
|
107
|
+
public_suffix (4.0.1)
|
|
108
108
|
rack (2.0.7)
|
|
109
109
|
rack-test (1.1.0)
|
|
110
110
|
rack (>= 1.0, < 3)
|
|
@@ -124,7 +124,7 @@ GEM
|
|
|
124
124
|
rails-dom-testing (2.0.3)
|
|
125
125
|
activesupport (>= 4.2.0)
|
|
126
126
|
nokogiri (>= 1.6)
|
|
127
|
-
rails-html-sanitizer (1.0
|
|
127
|
+
rails-html-sanitizer (1.2.0)
|
|
128
128
|
loofah (~> 2.2, >= 2.2.2)
|
|
129
129
|
railties (5.2.3)
|
|
130
130
|
actionpack (= 5.2.3)
|
|
@@ -132,8 +132,8 @@ GEM
|
|
|
132
132
|
method_source
|
|
133
133
|
rake (>= 0.8.7)
|
|
134
134
|
thor (>= 0.19.0, < 2.0)
|
|
135
|
-
rake (12.3.
|
|
136
|
-
rdoc (6.
|
|
135
|
+
rake (12.3.3)
|
|
136
|
+
rdoc (6.2.0)
|
|
137
137
|
rspec-core (3.8.2)
|
|
138
138
|
rspec-support (~> 3.8.0)
|
|
139
139
|
rspec-expectations (3.8.4)
|
|
@@ -169,7 +169,7 @@ GEM
|
|
|
169
169
|
coercible (~> 1.0)
|
|
170
170
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
|
171
171
|
equalizer (~> 0.0, >= 0.0.9)
|
|
172
|
-
webmock (3.
|
|
172
|
+
webmock (3.7.5)
|
|
173
173
|
addressable (>= 2.3.6)
|
|
174
174
|
crack (>= 0.3.2)
|
|
175
175
|
hashdiff (>= 0.4.0, < 2.0.0)
|
data/lib/proxied/checker.rb
CHANGED
|
@@ -11,11 +11,12 @@ module Proxied
|
|
|
11
11
|
self.limit = limit
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def check_proxies(protocol: :all, proxy_type: :all, update: true)
|
|
14
|
+
def check_proxies(protocol: :all, proxy_type: :all, category: nil, update: true)
|
|
15
15
|
proxies = ::Proxied.configuration.proxy_class.constantize.should_be_checked(
|
|
16
16
|
mode: self.mode.to_sym,
|
|
17
17
|
protocol: protocol,
|
|
18
18
|
proxy_type: proxy_type,
|
|
19
|
+
category: category,
|
|
19
20
|
date: Time.now,
|
|
20
21
|
limit: self.limit,
|
|
21
22
|
maximum_failed_attempts: self.maximum_failed_attempts
|
|
@@ -109,18 +110,21 @@ module Proxied
|
|
|
109
110
|
timeout = options.fetch(:timeout, ::Proxied.configuration.http_test[:timeout])
|
|
110
111
|
|
|
111
112
|
begin
|
|
112
|
-
|
|
113
|
+
connection = ::Faraday.new(url: url) do |builder|
|
|
113
114
|
builder.headers["User-Agent"] = user_agent if !user_agent.to_s.empty?
|
|
114
115
|
builder.options[:timeout] = timeout if timeout
|
|
115
116
|
builder.proxy = proxy.proxy_options_for_faraday
|
|
116
117
|
builder.response :logger if ::Proxied.configuration.verbose_faraday?
|
|
117
118
|
builder.adapter ::Proxied.configuration.faraday.fetch(:adapter, :net_http)
|
|
118
119
|
end
|
|
119
|
-
|
|
120
|
+
|
|
121
|
+
response = connection.get&.body
|
|
122
|
+
|
|
123
|
+
rescue Faraday::TimeoutError, Faraday::Error => e
|
|
120
124
|
::Proxied::Logger.log "Exception occured while trying to check proxy #{proxy.proxy_address}. Error Class: #{e.class}. Error Message: #{e.message}"
|
|
121
125
|
end
|
|
122
126
|
|
|
123
|
-
return response
|
|
127
|
+
return response
|
|
124
128
|
end
|
|
125
129
|
|
|
126
130
|
end
|
data/lib/proxied/version.rb
CHANGED
data/lib/tasks/tasks.rake
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
namespace :proxied do
|
|
2
|
-
task :check_proxies, [:protocol, :proxy_type, :mode, :maximum_failed_attempts] => :environment do |task, args|
|
|
3
|
-
args.with_defaults(protocol: :http, proxy_type: :public, mode: :synchronous, maximum_failed_attempts: 10)
|
|
2
|
+
task :check_proxies, [:protocol, :proxy_type, :category, :mode, :maximum_failed_attempts] => :environment do |task, args|
|
|
3
|
+
args.with_defaults(protocol: :http, proxy_type: :public, category: nil, mode: :synchronous, maximum_failed_attempts: 10)
|
|
4
4
|
|
|
5
5
|
checker = ::Proxied::Checker.new(mode: args.mode.to_sym, maximum_failed_attempts: args.maximum_failed_attempts.to_i)
|
|
6
6
|
checker.check_proxies(
|
|
7
7
|
protocol: args.protocol.to_sym,
|
|
8
8
|
proxy_type: args.proxy_type.to_sym,
|
|
9
|
+
category: args.category
|
|
9
10
|
)
|
|
10
11
|
end
|
|
11
12
|
end
|
data/proxied.gemspec
CHANGED
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.require_paths = ["lib"]
|
|
25
25
|
|
|
26
26
|
spec.add_dependency "faraday", ">= 0.15.4"
|
|
27
|
-
spec.add_dependency "net-ssh", ">= 5.
|
|
27
|
+
spec.add_dependency "net-ssh", ">= 5.2"
|
|
28
28
|
|
|
29
29
|
spec.add_development_dependency "bundler", ">= 1.17.2"
|
|
30
30
|
spec.add_development_dependency "rake", ">= 12.3.2"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: proxied
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sebastian
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-09-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '5.
|
|
33
|
+
version: '5.2'
|
|
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: '5.
|
|
40
|
+
version: '5.2'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: bundler
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|