mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/cgi/html.rb (element_init): suppress redefine warning.
Don't define methods if they are already defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ead728ca7d
commit
347c554f7e
3 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Jul 25 09:16:26 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/cgi/html.rb (element_init): suppress redefine warning.
|
||||||
|
Don't define methods if they are already defined.
|
||||||
|
|
||||||
Wed Jul 25 09:05:38 2012 Eric Hodel <drbrain@segment7.net>
|
Wed Jul 25 09:05:38 2012 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/net/http.rb: Added SSL session reuse across connections for a
|
* lib/net/http.rb: Added SSL session reuse across connections for a
|
||||||
|
|
|
@ -845,6 +845,7 @@ class CGI
|
||||||
# Initialise the HTML generation methods for this version.
|
# Initialise the HTML generation methods for this version.
|
||||||
def element_init
|
def element_init
|
||||||
extend TagMaker
|
extend TagMaker
|
||||||
|
return if defined?(html)
|
||||||
methods = ""
|
methods = ""
|
||||||
# - -
|
# - -
|
||||||
for element in %w[ A TT I B U STRIKE BIG SMALL SUB SUP EM STRONG
|
for element in %w[ A TT I B U STRIKE BIG SMALL SUB SUP EM STRONG
|
||||||
|
@ -895,6 +896,7 @@ class CGI
|
||||||
# Initialise the HTML generation methods for this version.
|
# Initialise the HTML generation methods for this version.
|
||||||
def element_init
|
def element_init
|
||||||
extend TagMaker
|
extend TagMaker
|
||||||
|
return if defined?(html)
|
||||||
methods = ""
|
methods = ""
|
||||||
# - -
|
# - -
|
||||||
for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD
|
for element in %w[ TT I B BIG SMALL EM STRONG DFN CODE SAMP KBD
|
||||||
|
@ -944,6 +946,7 @@ class CGI
|
||||||
# Initialise the HTML generation methods for this version.
|
# Initialise the HTML generation methods for this version.
|
||||||
def element_init
|
def element_init
|
||||||
extend TagMaker
|
extend TagMaker
|
||||||
|
return if defined?(html)
|
||||||
methods = ""
|
methods = ""
|
||||||
# - -
|
# - -
|
||||||
for element in %w[ TT I B U S STRIKE BIG SMALL EM STRONG DFN
|
for element in %w[ TT I B U S STRIKE BIG SMALL EM STRONG DFN
|
||||||
|
@ -994,6 +997,7 @@ class CGI
|
||||||
|
|
||||||
# Initialise the HTML generation methods for this version.
|
# Initialise the HTML generation methods for this version.
|
||||||
def element_init
|
def element_init
|
||||||
|
return if defined?(frameset)
|
||||||
methods = ""
|
methods = ""
|
||||||
# - -
|
# - -
|
||||||
for element in %w[ FRAMESET ]
|
for element in %w[ FRAMESET ]
|
||||||
|
|
|
@ -183,7 +183,7 @@ class CGICoreTest < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
ENV.update(@environ)
|
ENV.update(@environ)
|
||||||
ex = assert_raise(StandardError) do
|
ex = assert_raise(StandardError) do
|
||||||
cgi = CGI.new
|
CGI.new
|
||||||
end
|
end
|
||||||
assert_equal("too large post data.", ex.message)
|
assert_equal("too large post data.", ex.message)
|
||||||
end if CGI.const_defined?(:MAX_CONTENT_LENGTH)
|
end if CGI.const_defined?(:MAX_CONTENT_LENGTH)
|
||||||
|
@ -304,7 +304,7 @@ class CGICoreTest < Test::Unit::TestCase
|
||||||
HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_FROM HTTP_HOST
|
HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_FROM HTTP_HOST
|
||||||
HTTP_NEGOTIATE HTTP_PRAGMA HTTP_REFERER HTTP_USER_AGENT
|
HTTP_NEGOTIATE HTTP_PRAGMA HTTP_REFERER HTTP_USER_AGENT
|
||||||
]
|
]
|
||||||
list2 = %w[ CONTENT_LENGTH SERVER_PORT ]
|
# list2 = %w[ CONTENT_LENGTH SERVER_PORT ]
|
||||||
## string expected
|
## string expected
|
||||||
list1.each do |name|
|
list1.each do |name|
|
||||||
@environ[name] = "**#{name}**"
|
@environ[name] = "**#{name}**"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue