proxy_fetcher 0.6.4 → 0.6.5

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
  SHA1:
3
- metadata.gz: 72290c2f3d9a544d65874bfd0c6ff98c38938ed0
4
- data.tar.gz: c57b914d49204016231bc565f0ec03a98cf8893b
3
+ metadata.gz: d3914a2ff7553eb5b82a10bafbd442c2047db5e6
4
+ data.tar.gz: 9dbea0fb816d58ad43027e0366078775a648f361
5
5
  SHA512:
6
- metadata.gz: dacd5882b6397ec980ce35040b10ef5c5aa0eca57cb7e708d71fc60de67a5375e351a2021a4e37804a6eab629ae3a792ca4b523d9675c1af1ad5fafb6e21c589
7
- data.tar.gz: a2e0fabc4062f425871751f72af4bafae315d5b4e0f8795b0f6532ca7a2fd4fff8d948d348869dbd9c8f382fcc0dae66b0ae504f0bdac0cb71e729a2ad54568a
6
+ metadata.gz: ad83498d6e5f055326973163daf7719936792c95d641be37322ea5f4756223253ee5576135c507ad61cf9fb7c5518ded3f5e96bcfbd9291298a8731568ad177d
7
+ data.tar.gz: 3b99d216bc66904b2a4bab40359057e7097e6fd9d8e0cd397335ea993fefafebfa921e7fb75faa124dc96a3adfff053f761166a1d5dfeb85d73bbb44a79112a7
data/README.md CHANGED
@@ -401,7 +401,7 @@ Also you can call next instance methods for every Proxy object:
401
401
  * `socks4?`
402
402
  * `socks5?`
403
403
  * `uri` (returns `URI::Generic` object)
404
- * `url` (returns a formatted URL like "_http://IP:PORT_" )
404
+ * `url` (returns a formatted URL like "_IP:PORT_" or "_http://IP:PORT_" if `scheme: true` provided)
405
405
 
406
406
  ## Providers
407
407
 
@@ -91,11 +91,18 @@ module ProxyFetcher
91
91
 
92
92
  # Returns <code>String</code> object with <i>addr:port</i> values of the proxy.
93
93
  #
94
+ # @param scheme [Boolean]
95
+ # Indicates if URL must include proxy type
96
+ #
94
97
  # @return [String]
95
98
  # true if proxy connectable, otherwise false.
96
99
  #
97
- def url
98
- "#{addr}:#{port}"
100
+ def url(scheme: false)
101
+ if scheme
102
+ URI::Generic.build(scheme: type, host: addr, port: port).to_s
103
+ else
104
+ URI::Generic.build(host: addr, port: port).to_s
105
+ end
99
106
  end
100
107
  end
101
108
  end
@@ -15,7 +15,7 @@ module ProxyFetcher
15
15
  # Minor version number
16
16
  MINOR = 6
17
17
  # Smallest version number
18
- TINY = 4
18
+ TINY = 5
19
19
 
20
20
  # Full version number
21
21
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
@@ -68,4 +68,8 @@ describe ProxyFetcher::Proxy do
68
68
  it 'returns URL' do
69
69
  expect(proxy.url).to be_a(String)
70
70
  end
71
+
72
+ it 'returns URL with schema' do
73
+ expect(proxy.url(scheme: true)).to include('://')
74
+ end
71
75
  end
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.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Bulai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec