proxy_pool 0.1.2 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5df2dcb6b28092b782f2776fa189916c74e33b675fe9a63f527e1300686d6336
4
- data.tar.gz: b2bb0c3eee1091c3e768d89cc3a3de34be31d5042a7df4d95e4768dbac869c79
3
+ metadata.gz: 91b8f68f49e945f8138a4b44898cabec2e0c547d266c8f1fa3bee4f812834123
4
+ data.tar.gz: a140daaf608931a1f02c003ff95c2a39b634a1bd90e23d0f785c9dd51a8a5f43
5
5
  SHA512:
6
- metadata.gz: b02af548b629fd004984bf536609cdd30b164e6f3c430cbd659fd5aeca589c977c86fd711f49db69798ab7958f751f38801d0cd09587ff900754d7552066e414
7
- data.tar.gz: 9795bd28b5fdae004f1747c8b48c55bfab0f90f034eede05d88abdb272577e48d3670bbb7cf8f1abafd64789545e493da572668c6bf14548a10c97a245eafd93
6
+ metadata.gz: 85e6ddfacd502eebf0b9c75538e621342f447f222e13915228bfc073aa0a5cced67d0aeac4ad2ed3799c3c5b892bdb19f0907ee4ef6aef259ff8e29413b4932b
7
+ data.tar.gz: cbc1f7cd40f2d368bb0eeab63a9749ae896fa1895d8f09ffa0c01dbea570b4ebc774f384d39d0016717bb7bdfabb39baac9db9974f9979ad3adbb7e5202ef2ba
@@ -46,10 +46,10 @@ module ProxyPool
46
46
  #
47
47
  # @param anonymous [Boolean] Return high anonymous proxy if true
48
48
  # @param filter [Hash] Filter
49
- # @param update [Boolean] Update pool before select proxy server
49
+ # @param force_update [Boolean] Update pool before select proxy server
50
50
  # @return [Hash] Proxy
51
- def get(anonymous=true, filter={}, update=false)
52
- update if update || (@transparent_pools.nil? && @anonymous_pools.nil?)
51
+ def get(anonymous=true, filter={}, force_update=false)
52
+ update if force_update || (@transparent_pools.nil? && @anonymous_pools.nil?)
53
53
 
54
54
  target_pools = if anonymous
55
55
  @anonymous_pools
@@ -1,3 +1,3 @@
1
1
  module ProxyPool
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.1.3".freeze
3
3
  end
data/lib/proxy_pool.rb CHANGED
@@ -19,6 +19,14 @@ module ProxyPool
19
19
  ProxyPool::Dealer.instance.get(true, filter)
20
20
  end
21
21
 
22
+ # Update and get anonymous proxy from pool randomly
23
+ #
24
+ # @param filter [Hash] Filter
25
+ # @return [Hash] Proxy
26
+ def get_anonymous_proxy!(filter={})
27
+ ProxyPool::Dealer.instance.get(true, filter, true)
28
+ end
29
+
22
30
  # Get transparent proxy from pool randomly
23
31
  #
24
32
  # @param filter [Hash] Filter
@@ -26,6 +34,14 @@ module ProxyPool
26
34
  def get_transparent_proxy(filter={})
27
35
  ProxyPool::Dealer.instance.get(false, filter)
28
36
  end
37
+
38
+ # Update and get transparent proxy from pool randomly
39
+ #
40
+ # @param filter [Hash] Filter
41
+ # @return [Hash] Proxy
42
+ def get_transparent_proxy!(filter={})
43
+ ProxyPool::Dealer.instance.get(false, filter, true)
44
+ end
29
45
  end
30
46
 
31
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxy_pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - hi_ztz