proxied 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 670ca19a9100f67ddca208cad0c90c729d47f79148739657e7f031f5ce732df1
4
- data.tar.gz: 4adedbbef5ab9765610080ccd34a6df00a6158f37728af7f059c7190b71e68cc
3
+ metadata.gz: 7e005242b58393ef158bf5c9174f37a1a9f8f0bfc28d7e2f6d2efe4dd8b055d9
4
+ data.tar.gz: 3f8eb894ecedf42f9915d1c622430962fd08ae7f0f194b1bf3e813710deec428
5
5
  SHA512:
6
- metadata.gz: 7de2420827e224b1e4d23cc595714a0a15b526d94d68481efb3b008122090cde99f0ef7a1820f14b8fdb70473ab6f0cf1de0c5cf093ac160bc0f3e0c16c68656
7
- data.tar.gz: 2eda880c9e511393a3e0224d6863a31e85bb3eb7804a66623446aa7ae6a171bbe46245e2416786f586c091a009c61a75cf95e2aa18f85774ccfcf0ce8b23811a
6
+ metadata.gz: 8f72c919f4acae7c8dd32ea148f64e0e664de16dff6d2b2fb8050f5111ab32ff85f8ca266eb43459edc317d42abc1e83971aae839561ccc6ac5898870adc75b9
7
+ data.tar.gz: cabff401d31f825a5b909a7a16f3ae9a9ce4e8ee26104c5e3dcc5cf9db1eb3a67e985b781005cbbbd4b4b00534a694447e7af616f650e3585a6e2128a86729bd
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proxied (0.2.0)
4
+ proxied (0.2.3)
5
5
  faraday (>= 0.15.4)
6
- net-ssh (>= 5.1)
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.6.0)
53
- public_suffix (>= 2.0.2, < 4.0)
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.4.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.1)
96
+ mini_mime (1.0.2)
97
97
  mini_portile2 (2.4.0)
98
- minitest (5.11.3)
98
+ minitest (5.12.0)
99
99
  multipart-post (2.1.1)
100
100
  net-ssh (5.2.0)
101
- nio4r (2.3.1)
102
- nokogiri (1.10.3)
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 (3.1.1)
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.4)
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.2)
136
- rdoc (6.1.1)
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.6.0)
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)
@@ -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
- response = ::Faraday.new(url: url) do |builder|
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
- rescue Faraday::Error => e
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.get&.body
127
+ return response
124
128
  end
125
129
 
126
130
  end
@@ -1,3 +1,3 @@
1
1
  module Proxied
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -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
@@ -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.1"
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.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-07-29 00:00:00.000000000 Z
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.1'
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.1'
40
+ version: '5.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement