diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-22 08:09:58 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-22 08:09:58 +0000 |
| commit | ce9aba02a65a2a34f9c682635a4ccb5c3077b862 (patch) | |
| tree | fa6ca2b3d705a9ea9ea67442b20c2e432dc647d6 /lib | |
| parent | b2da7a3f81a5aacb3a2c725aad2b7397ea721cd5 (diff) | |
| download | ruby-ce9aba02a65a2a34f9c682635a4ccb5c3077b862.tar.gz ruby-ce9aba02a65a2a34f9c682635a4ccb5c3077b862.tar.xz ruby-ce9aba02a65a2a34f9c682635a4ccb5c3077b862.zip | |
* enum.c (inject_i): use rb_yield_values.
* enum.c (each_with_index_i): ditto.
* eval.c (rb_yield_splat): new function to call "yield *values".
* string.c (rb_str_scan): use rb_yield_splat().
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/cgi.rb | 6 | ||||
| -rw-r--r-- | lib/singleton.rb | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index ee315cc48..27dd83da0 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -973,7 +973,7 @@ class CGI bufsize = 10 * 1024 # start multipart/form-data - stdinput.binmode + stdinput.binmode if defined? stdinput.binmode boundary_size = boundary.size + EOL.size content_length -= boundary_size status = stdinput.read(boundary_size) @@ -997,7 +997,7 @@ class CGI body = Tempfile.new("CGI") end end - body.binmode + body.binmode if defined? body.binmode until head and /#{boundary}(?:#{EOL}|--)/n.match(buf) @@ -1123,7 +1123,7 @@ class CGI env_table['QUERY_STRING'] or "" end when "POST" - stdinput.binmode + stdinput.binmode if defined? stdinput.binmode stdinput.read(Integer(env_table['CONTENT_LENGTH'])) or '' else read_from_cmdline diff --git a/lib/singleton.rb b/lib/singleton.rb index 30990b79b..2954bfa15 100644 --- a/lib/singleton.rb +++ b/lib/singleton.rb @@ -95,7 +95,10 @@ class << Singleton @__instance__ = new ensure if @__instance__ - def self.instance; @__instance__ end + class <<self + remove_method :instance + def instance; @__instance__ end + end else @__instance__ = nil # failed instance creation end @@ -109,7 +112,10 @@ class << Singleton @__instance__ = new ensure if @__instance__ - def self.instance; @__instance__ end + class <<self + remove_method :instance + def instance; @__instance__ end + end else @__instance__ = nil end |
