diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/cgi/html.rb | 4 | ||||
-rw-r--r-- | test/cgi/test_cgi_core.rb | 4 |
3 files changed, 11 insertions, 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> * 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}**" |