proxied 0.1.4 → 0.1.5

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: fb6b1d839edb6a86acc7e15c72ae74e4e94e61d6302fe12d11378c18edadea36
4
- data.tar.gz: ee71b159f7d46d703a9c819c6d52a79060262ae984999d3083b6fa72d2581371
3
+ metadata.gz: 29b91a7c5c377492b4ef67eaca0b0cc0b2a6eb153829fd9853e4fd4ec1d87a9f
4
+ data.tar.gz: c776549b3460abf6abd40a91d9f5cb96c09d99c03cbaa7939c5da70cf5720ea7
5
5
  SHA512:
6
- metadata.gz: 7115524c83549e66f528dc1764a029e79ea43c9c38f006657b17ae5ef8ba24fc6eaff7abd33756a1122c1d0cd6bb11947ad5322d215032cdab437c2c56d18648
7
- data.tar.gz: 1ec14f18413f2168f3e437c544d6389171ab5567c0c74375f96bf110b4a41408aa957f84ff3c11cd122c572e2eddab7ca8fb21daaa51c9ec6dad2c3c0ddede96
6
+ metadata.gz: d17828c85d020f52a43b4734eeda29d78a59733f7085e2350ced4922ccd4c418d96c8f7230d9fd480c19400a1618ba173f7a58fb7ec19a6ca961349093656a00
7
+ data.tar.gz: 5cfb8dc968ae33409c6bcdb3b7a14ef060032a54c8210b52b765bbf43ee6ee134e8a0bf2a8fc22459b688df2df85c7944905f8b40c94d38c4fcb4d7a6e17557c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proxied (0.1.3)
4
+ proxied (0.1.4)
5
5
  faraday (>= 0.14)
6
6
  net-ssh (>= 4.0)
7
7
 
@@ -36,6 +36,10 @@ module Proxied
36
36
  def proxy_options_for_faraday
37
37
  ::Proxied::Utilities.proxy_options_for_faraday(host: self.host, port: self.port, username: self.username, password: self.password)
38
38
  end
39
+
40
+ def proxy_switcher_address
41
+ ::Proxied::Utilities.format_proxy_switcher_address(host: self.host, port: self.port, username: self.username, password: self.password)
42
+ end
39
43
  end
40
44
 
41
45
  end
@@ -4,7 +4,7 @@ module Proxied
4
4
  class << self
5
5
 
6
6
  def format_proxy_address(host:, port: 80, include_http: false)
7
- address = "#{host}:#{port}"
7
+ address = "#{host.strip}:#{port}"
8
8
  address = "http://#{address}" if include_http && !address.start_with?("http://")
9
9
 
10
10
  return address
@@ -23,7 +23,7 @@ module Proxied
23
23
  return credentials
24
24
  end
25
25
 
26
- def proxy_options_for_faraday(host:, port:, username: nil, password: nil)
26
+ def proxy_options_for_faraday(host:, port: 80, username: nil, password: nil)
27
27
  proxy_options = {}
28
28
 
29
29
  proxy_options[:uri] = format_proxy_address(host: host, port: port, include_http: true)
@@ -33,6 +33,16 @@ module Proxied
33
33
  return proxy_options
34
34
  end
35
35
 
36
+ def format_proxy_switcher_address(host:, port: 80, username: nil, password: nil)
37
+ address = ""
38
+
39
+ if !username.to_s.empty? && !password.to_s.empty?
40
+ address += "#{username}:#{password}@"
41
+ end
42
+
43
+ address += "#{host}:#{port}"
44
+ end
45
+
36
46
  end
37
47
 
38
48
  end
@@ -1,3 +1,3 @@
1
1
  module Proxied
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-04 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday