http_utilities 1.2.6 → 1.2.6.1

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
  SHA1:
3
- metadata.gz: 603202bdd3f0aa29144ae4759c1d91a942d72f27
4
- data.tar.gz: 754fbfc365ebd109b1a373d60f86aa59b7decebc
3
+ metadata.gz: 341cc773efe23ad3341ea0ee0a02c3c1548a3eb3
4
+ data.tar.gz: 1397aea28cc77b53b450b968d526c9ec4f2bcdbb
5
5
  SHA512:
6
- metadata.gz: fc8ee7dc0a13b26b38715b5974d6e7ce9af332167819df1aea1295855178bd44a7bcf33506ec37051885f294a52d492b3fe5a770e4d9b227365ba34c2ca3beda
7
- data.tar.gz: f01c4b6d6315399edeb9e288c6f4285df327be5464e768da89ab14581ae71f0e1a2e20db6a59acd0e25d6ce78f174db9851c77076580f836a3ca852283962428
6
+ metadata.gz: c2483b4d8c30eb049ec087b9be3c39dc1ae53b08e7daf0a1134931c25d647fae525ad26b35b907cbb6fea1de9d6baf20f90c4c52b356e302c73824c0caea6176
7
+ data.tar.gz: ab895796539ebcf6ef156c8abee82c163cc5304b27c7eb14de2df8d76249779733571470e8c9d4e29dc696befb5384f240f4a0d3a86bafcaa78eed4972611894
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = "http_utilities"
6
- s.version = "1.2.6"
6
+ s.version = "1.2.6.1"
7
7
 
8
8
  s.authors = ["Sebastian Johnsson"]
9
9
  s.description = "Wrapper for Faraday with additional functionality"
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module HttpUtilities
3
- VERSION = "1.2.6"
3
+ VERSION = "1.2.6.1"
4
4
 
5
5
  require File.join(File.dirname(__FILE__), 'http_utilities/railtie') if defined?(Rails)
6
6
 
@@ -22,9 +22,10 @@ module HttpUtilities
22
22
  self.agent = ::Mechanize.new
23
23
  self.agent.log = ::Logger.new(logger) if (verbose)
24
24
 
25
+ self.proxy = {}
25
26
  self.set_proxy_options(options)
26
27
 
27
- if (self.proxy[:host] && self.proxy[:port])
28
+ if self.proxy[:host] && self.proxy[:port]
28
29
  log(:info, "[HttpUtilities::Http::Mechanize::Client] - Will use proxy #{self.proxy[:host]}:#{self.proxy[:port]} for Mechanize.")
29
30
  self.agent.set_proxy(self.proxy[:host], self.proxy[:port], self.proxy[:username], self.proxy[:password])
30
31
  end
@@ -33,7 +34,7 @@ module HttpUtilities
33
34
  (self.user_agent) ? self.agent.user_agent = self.user_agent : self.agent.user_agent_alias = 'Mac Safari'
34
35
 
35
36
  timeout = options.fetch(:timeout, 300)
36
- self.agent.open_timeout = self.agent.read_timeout = timeout if (timeout)
37
+ self.agent.open_timeout = self.agent.read_timeout = timeout if timeout
37
38
  end
38
39
 
39
40
  def reset_agent(options = {})
@@ -50,7 +51,7 @@ module HttpUtilities
50
51
  rescue Net::HTTPNotFound, ::Mechanize::ResponseCodeError => error
51
52
  log(:error, "[HttpUtilities::Http::Mechanize::Client] - Response Code Error occurred for url #{url}. Error class: #{error.class.name}. Error message: #{error.message}")
52
53
 
53
- if (retries > 0)
54
+ if retries > 0
54
55
  reset_agent(options)
55
56
  retries -= 1
56
57
  retry
@@ -59,7 +60,7 @@ module HttpUtilities
59
60
  rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, Errno::ECONNRESET, Timeout::Error, Net::HTTPUnauthorized, Net::HTTPForbidden, StandardError => connection_error
60
61
  log(:error, "[HttpUtilities::Http::Mechanize::Client] - Error occurred. Error class: #{connection_error.class.name}. Message: #{connection_error.message}")
61
62
 
62
- if (retries > 0)
63
+ if retries > 0
63
64
  reset_agent(options)
64
65
  retries -= 1
65
66
  retry
@@ -88,8 +89,8 @@ module HttpUtilities
88
89
  index = form_identifier.delete(:index) { |el| 0 }
89
90
  page = (url_or_page.is_a?(String)) ? get_page(url_or_page, options) : url_or_page
90
91
 
91
- if (page)
92
- if (form_identifier.empty?)
92
+ if page
93
+ if form_identifier.empty?
93
94
  form = page.forms[index]
94
95
  else
95
96
  forms = page.forms_with(form_identifier)
@@ -191,4 +192,4 @@ module HttpUtilities
191
192
 
192
193
  end
193
194
  end
194
- end
195
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_utilities
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Johnsson