From 1de4203c5150088bd795d04e0f6fc4dd75ac00f3 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 23 Apr 2003 06:31:29 +0000 Subject: * lib/cgi.rb (CGI::QueryExtension::[]): always return Value object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 +++++++- lib/cgi.rb | 4 +++- lib/complex.rb | 4 ++-- lib/singleton.rb | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f27e4ed558..0d8eb949d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Apr 23 13:31:10 2003 Yukihiro Matsumoto + + * lib/cgi.rb (CGI::QueryExtension::[]): always return Value + object. + Wed Apr 23 08:39:27 2003 Nobuyoshi Nakada * ext/zlib/extconf.rb: bccwin32 is win32 too. @@ -5,7 +10,7 @@ Wed Apr 23 08:39:27 2003 Nobuyoshi Nakada Tue Apr 22 20:58:00 2003 Takaaki Uematsu * ruby.c: don't call VirtualQuery in ruby_init_loadpath() - on mswince. + on mswince. Tue Apr 22 19:08:53 2003 Nobuyoshi Nakada @@ -17,6 +22,7 @@ Tue Apr 22 09:20:40 2003 Yukihiro Matsumoto * parse.y (arg_ambiguous): hopefully better message. * lib/cgi.rb (CGI::QueryExtension::initialize_query): to_ary + removed. Tue Apr 22 06:06:22 2003 Tanaka Akira diff --git a/lib/cgi.rb b/lib/cgi.rb index 7dffdd9a33..dfeea5fc47 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -957,7 +957,9 @@ END end def [](key) - Value.new(@params[key][0]) + value = @params[key][0] + value ||= "" + Value.new(value) end def keys(*args) diff --git a/lib/complex.rb b/lib/complex.rb index dda2ad2006..90916d125e 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -13,7 +13,6 @@ # # Complex numbers can be created in the following manner: # - Complex(a, b) -# - Complex.new(a, b) # - Complex.polar(radius, theta) # # Additionally, note the following: @@ -66,7 +65,8 @@ class Complex < Numeric def Complex.polar(r, theta) Complex(r*Math.cos(theta), r*Math.sin(theta)) end - + + private_class_method :new # # Creates a +Complex+ number a+bi. # diff --git a/lib/singleton.rb b/lib/singleton.rb index 147b04187c..939159496b 100644 --- a/lib/singleton.rb +++ b/lib/singleton.rb @@ -142,7 +142,7 @@ module Singleton @__instance__ = new ensure if @__instance__ - def self.instance() @__instance__ end + define_method(:instance) {@__instance__} else @__instance__ = nil # failed instance creation end -- cgit v1.2.3