summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-25 00:19:09 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-25 00:19:09 +0000
commit347c554f7ee503f06b59dbe1bd3a6ae818a33efb (patch)
treeed9217d7d811bec95407bb6e8511ee686faeac9d
parentead728ca7d7a42a3c1658d00102732947b514dea (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--lib/cgi/html.rb4
-rw-r--r--test/cgi/test_cgi_core.rb4
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d5a17804ae..bea9c83013 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* lib/net/http.rb: Added SSL session reuse across connections for a
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb
index 9b9db93bae..b81ee787e8 100644
--- a/lib/cgi/html.rb
+++ b/lib/cgi/html.rb
@@ -845,6 +845,7 @@ class CGI
# Initialise the HTML generation methods for this version.
def element_init
extend TagMaker
+ return if defined?(html)
methods = ""
# - -
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.
def element_init
extend TagMaker
+ return if defined?(html)
methods = ""
# - -
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.
def element_init
extend TagMaker
+ return if defined?(html)
methods = ""
# - -
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.
def element_init
+ return if defined?(frameset)
methods = ""
# - -
for element in %w[ FRAMESET ]
diff --git a/test/cgi/test_cgi_core.rb b/test/cgi/test_cgi_core.rb
index 0efba195cd..dab22d3114 100644
--- a/test/cgi/test_cgi_core.rb
+++ b/test/cgi/test_cgi_core.rb
@@ -183,7 +183,7 @@ class CGICoreTest < Test::Unit::TestCase
}
ENV.update(@environ)
ex = assert_raise(StandardError) do
- cgi = CGI.new
+ CGI.new
end
assert_equal("too large post data.", ex.message)
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_NEGOTIATE HTTP_PRAGMA HTTP_REFERER HTTP_USER_AGENT
]
- list2 = %w[ CONTENT_LENGTH SERVER_PORT ]
+ # list2 = %w[ CONTENT_LENGTH SERVER_PORT ]
## string expected
list1.each do |name|
@environ[name] = "**#{name}**"