Reduce warnings.

This commit is contained in:
Akinori MUSHA 2013-03-15 12:31:19 +09:00
parent 4845b0de94
commit 15f960bfbd
3 changed files with 6 additions and 10 deletions

View file

@ -391,16 +391,16 @@ class HTTP::Cookie
if (HTTP::Cookie.normalize_path(origin) + './').path != @path if (HTTP::Cookie.normalize_path(origin) + './').path != @path
string << "; path=#{@path}" string << "; path=#{@path}"
end end
if expires = @expires if @expires
string << "; expires=#{@expires.httpdate}" string << "; expires=#{@expires.httpdate}"
end end
if comment = @comment if @comment
string << "; comment=#{@comment}" string << "; comment=#{@comment}"
end end
if httponly? if @httponly
string << "; HttpOnly" string << "; HttpOnly"
end end
if secure? if @secure
string << "; secure" string << "; secure"
end end
string string

View file

@ -1,5 +1,3 @@
require 'http/cookie_jar'
class HTTP::CookieJar::AbstractSaver class HTTP::CookieJar::AbstractSaver
class << self class << self
@@class_map = {} @@class_map = {}
@ -13,7 +11,7 @@ class HTTP::CookieJar::AbstractSaver
begin begin
require 'http/cookie_jar/%s_saver' % symbol require 'http/cookie_jar/%s_saver' % symbol
@@class_map.fetch(symbol) @@class_map.fetch(symbol)
rescue LoadError, IndexError => e rescue LoadError, IndexError
raise IndexError, 'cookie saver unavailable: %s' % symbol.inspect raise IndexError, 'cookie saver unavailable: %s' % symbol.inspect
end end
end end

View file

@ -1,5 +1,3 @@
require 'http/cookie_jar'
class HTTP::CookieJar::AbstractStore class HTTP::CookieJar::AbstractStore
class << self class << self
@@class_map = {} @@class_map = {}
@ -13,7 +11,7 @@ class HTTP::CookieJar::AbstractStore
begin begin
require 'http/cookie_jar/%s_store' % symbol require 'http/cookie_jar/%s_store' % symbol
@@class_map.fetch(symbol) @@class_map.fetch(symbol)
rescue LoadError, IndexError => e rescue LoadError, IndexError
raise IndexError, 'cookie store unavailable: %s' % symbol.inspect raise IndexError, 'cookie store unavailable: %s' % symbol.inspect
end end
end end