scrubber-scrubyt 0.4.14 → 0.4.15

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.
@@ -125,24 +125,27 @@ module Scrubyt
125
125
 
126
126
  def self.parse_and_set_proxy(proxy)
127
127
  @@proxy_user = @@proxy_pass = nil
128
- if proxy.downcase == 'localhost'
128
+ if proxy.downcase.include?('localhost')
129
129
  @@host = 'localhost'
130
130
  @@port = proxy.split(':').last
131
131
  else
132
132
  parts = proxy.split(':')
133
133
  if (parts.size > 2)
134
- user_pass = parts[0].split('@')
135
- if (user_pass.size > 1)
136
- @@proxy_user = user_pass[0]
137
- @@proxy_pass = user_pass[1]
138
- else
139
- @@proxy_user = user_pass
140
- end
141
- @@host = parts[1]
142
- @@port = parts[2]
134
+ user_pass = parts[0].split('@')
135
+ @@proxy_user = user_pass[0]
136
+ @@proxy_pass = user_pass[1]
137
+ @@host = parts[1]
138
+ @@port = parts[2]
143
139
  else
144
- @@host = parts[0]
145
- @@port = parts[1]
140
+ if (parts[0].include?('@'))
141
+ user_host = parts[0].split('@')
142
+ @@proxy_user = user_host[0]
143
+ @@host = user_host[1]
144
+ @@port = parts[1]
145
+ else
146
+ @@host = parts[0]
147
+ @@port = parts[1]
148
+ end
146
149
  end
147
150
 
148
151
  if (@@host == nil || @@port == nil)# !@@host =~ /^http/)
@@ -151,7 +154,7 @@ module Scrubyt
151
154
  exit
152
155
  end
153
156
  end
154
- Scrubyt.log :ACTION, "[ACTION] Setting proxy: host=<#{@@host}>, port=<#{@@port}>, username=<#{@@proxy_user}, password=<#{@@proxy_pass}>"
157
+ Scrubyt.log :ACTION, "[ACTION] Setting proxy: host=<#{@@host}>, port=<#{@@port}>, username=<#{@@proxy_user}>, password=<#{@@proxy_pass}>"
155
158
  @@agent.set_proxy(@@host, @@port, @@proxy_user, @@proxy_pass)
156
159
  end
157
160
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrubber-scrubyt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.14
4
+ version: 0.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Szinek