Changeset 6476 for lang/ruby

Show
Ignore:
Timestamp:
02/10/08 14:31:21 (6 years ago)
Author:
cho45
Message:

lang/ruby/chokan/branches/citrus/plugins/http/default.rb,
lang/ruby/chokan/branches/citrus/plugins/http.rb,
lang/ruby/chokan/branches/citrus/lib/paranoid.rb,
lang/ruby/chokan/branches/citrus/spec/paranoid_spec.rb:

use net-http-paranoid.

Location:
lang/ruby/chokan/branches/citrus
Files:
2 removed
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/chokan/branches/citrus/plugins/http.rb

    r6418 r6476  
    154154                        @plugin.on_privmsg(@prefix, "#test", "http://localhost/") 
    155155                        true while @socket.string.empty? 
    156                         @socket.string.should == "NOTICE #test :#<Net::HTTP::Paranoid::NotAllowedHostError: localhost is blocked by Paranoid because it is LAN.>\r\n" 
     156                        @socket.string.should == "NOTICE #test :#<Net::HTTP::Paranoid::NotAllowedHostError: localhost is not allowed host>\r\n" 
    157157                end 
    158158        end 
  • lang/ruby/chokan/branches/citrus/plugins/http/default.rb

    r6398 r6476  
    11#!/usr/bin/env ruby 
    22 
    3 require "paranoid" 
     3require "net/http" 
     4require "net/https" 
     5require "net/http/paranoid" 
    46require "image_size" # gem install imagesize 
    57require "timeout" 
     
    2325                log uri 
    2426                ret = '' 
    25                 http = Net::HTTP::Paranoid.new(uri.host, uri.port) 
     27                http = Net::HTTP.new(uri.host, uri.port) 
    2628                http.use_ssl = (uri.scheme == "https") 
    27                 http.start do |http| 
     29                Net::HTTP::Paranoid.new.wrap(http).start do |http| 
    2830                        r = http.head(uri.request_uri, header) 
    2931                        log r.code.inspect