lib/bluepill/process_conditions/http.rb in dylanvaughn-bluepill-0.0.39 vs lib/bluepill/process_conditions/http.rb in dylanvaughn-bluepill-0.0.40
- old
+ new
@@ -6,10 +6,10 @@
class Http < ProcessCondition
def initialize(options = {})
@uri = URI.parse(options[:url])
@kind = case options[:kind]
when Fixnum then Net::HTTPResponse::CODE_TO_OBJ[options[:kind].to_s]
- when String, Symbol then "Net::HTTP#{options[:kind].to_s.camelize}".constantize
+ when String, Symbol then Net.const_get("HTTP#{options[:kind].to_s.camelize}")
else
Net::HTTPSuccess
end
@pattern = options[:pattern] || nil
@open_timeout = (options[:open_timeout] || options[:timeout] || 5).to_i
\ No newline at end of file