Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of http://github.com/defunkt/resque

  • Loading branch information...
commit 92fd97bd47e387819c48b367799b6085f258545c 2 parents b569242 + 7055fca
Dave Benvenuti authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 lib/resque/failure/hoptoad.rb
View
16 lib/resque/failure/hoptoad.rb
@@ -26,8 +26,11 @@ class Hoptoad < Base
INPUT_FORMAT = /^([^:]+):(\d+)(?::in `([^']+)')?$/
class << self
- attr_accessor :secure, :api_key, :proxy_host, :proxy_port
+ attr_accessor :secure, :api_key
+ attr_accessor :proxy_host, :proxy_port, :proxy_user, :proxy_pass
attr_accessor :server_environment
+ attr_accessor :host, :port
+ attr_accessor :http_read_timeout, :http_open_timeout
end
def self.count
@@ -43,17 +46,20 @@ def self.configure
def save
http = use_ssl? ? :https : :http
- url = URI.parse("#{http}://hoptoadapp.com/notifier_api/v2/notices")
+ host = self.class.host || 'hoptoadapp.com'
+ port = self.class.port
+ url = URI.parse("#{http}://#{host}:#{port}/notifier_api/v2/notices/")
- request = Net::HTTP::Proxy(self.class.proxy_host, self.class.proxy_port)
+ request = Net::HTTP::Proxy self.class.proxy_host, self.class.proxy_port,
+ self.class.proxy_user, self.class.proxy_pass
http = request.new(url.host, url.port)
headers = {
'Content-type' => 'text/xml',
'Accept' => 'text/xml, application/xml'
}
- http.read_timeout = 5 # seconds
- http.open_timeout = 2 # seconds
+ http.read_timeout = self.class.http_read_timeout || 5 # seconds
+ http.open_timeout = self.class.http_open_timeout || 2 # seconds
http.use_ssl = use_ssl?
Please sign in to comment.
Something went wrong with that request. Please try again.