mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* variable.c (rb_set_class_path): do not set path if
* lib/cgi.rb (CGI::QueryExtension): give extended string, not a delegater object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8e877fc517
commit
22c005569b
11 changed files with 196 additions and 115 deletions
195
ChangeLog
195
ChangeLog
|
@ -24,6 +24,13 @@ Mon Jan 19 06:49:07 2004 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* sample/cal.rb: added a class, anyway.
|
* sample/cal.rb: added a class, anyway.
|
||||||
|
|
||||||
|
Mon Jan 19 01:08:39 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* variable.c (rb_set_class_path): do not set path if
|
||||||
|
|
||||||
|
* lib/cgi.rb (CGI::QueryExtension): give extended string, not a
|
||||||
|
delegater object.
|
||||||
|
|
||||||
Sun Jan 18 23:59:44 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Jan 18 23:59:44 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/iconv/charset_alias.rb: prefer us_EN locale encodings or
|
* ext/iconv/charset_alias.rb: prefer us_EN locale encodings or
|
||||||
|
@ -119,6 +126,17 @@ Wed Jan 14 09:32:02 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* MANIFEST: add test/net/test_httpheader.rb. (commit miss?)
|
* MANIFEST: add test/net/test_httpheader.rb. (commit miss?)
|
||||||
|
|
||||||
|
Wed Jan 14 00:58:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* eval.c (Init_Proc): move SystemStackError from under
|
||||||
|
StandardError to Exception. [ruby-talk:89782]
|
||||||
|
|
||||||
|
Tue Jan 13 18:03:02 2004 Ian Macdonald <ian@caliban.org>
|
||||||
|
|
||||||
|
* file.c (rb_stat_wr, rb_stat_ww): New functions
|
||||||
|
implementing new methods (File::Stat#world_readable?,
|
||||||
|
File::Stat#world_writable?).
|
||||||
|
|
||||||
Tue Jan 13 16:53:25 2004 why the lucky stiff <why@ruby-lang.org>
|
Tue Jan 13 16:53:25 2004 why the lucky stiff <why@ruby-lang.org>
|
||||||
|
|
||||||
* ext/syck/rubyext.c: omission of Date library code caused
|
* ext/syck/rubyext.c: omission of Date library code caused
|
||||||
|
@ -128,6 +146,11 @@ Tue Jan 13 16:50:03 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tk.rb: use $0 as the default application class name.
|
* ext/tk/lib/tk.rb: use $0 as the default application class name.
|
||||||
|
|
||||||
|
Tue Jan 13 14:48:00 2004 Ian Macdonald <ian@caliban.org>
|
||||||
|
|
||||||
|
* lib/pathname.rb: New methods (Pathname#world_readable?,
|
||||||
|
Pathname#world_writable?).
|
||||||
|
|
||||||
Tue Jan 13 14:48:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Jan 13 14:48:01 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (primary): allow no "when" case. [ruby-dev:22578]
|
* parse.y (primary): allow no "when" case. [ruby-dev:22578]
|
||||||
|
@ -3410,6 +3433,92 @@ Thu Oct 9 06:43:33 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
* eval.c (rb_thread_start_0, rb_thread_raise, rb_callcc): save
|
* eval.c (rb_thread_start_0, rb_thread_raise, rb_callcc): save
|
||||||
variables across THREAD_SAVE_CONTEXT.
|
variables across THREAD_SAVE_CONTEXT.
|
||||||
|
|
||||||
|
Thu Oct 9 12:05:46 2003 Eric Sunshine <sunshine@sunshineco.com>
|
||||||
|
|
||||||
|
* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
|
||||||
|
had become unbuildable; enhanced --enable-fat-binary option so that
|
||||||
|
it accepts a list of desired architectures (rather than assuming a
|
||||||
|
fixed list), or defaults to a platform-appropriate list if user does
|
||||||
|
not provide an explicit list; made the default list of architectures
|
||||||
|
for MAB (fat binary) more comprehensive; now uses -fno-common even
|
||||||
|
when building the interpreter (in addition to using it for
|
||||||
|
extensions), thus allowing the interpreter to be embedded into a
|
||||||
|
plugin module of an external project (in addition to allowing
|
||||||
|
embedding directly into an application); added checks for
|
||||||
|
<netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
|
||||||
|
ensures that -I/usr/local/include is employed when extensions'
|
||||||
|
extconf.rb scripts invoke have_header() since extension checks on
|
||||||
|
NextStep and OpenStep will fail without it if the desired resource
|
||||||
|
resides in the /usr/local tree; fixed formatting of --help message.
|
||||||
|
|
||||||
|
* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
|
||||||
|
invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
|
||||||
|
(see configure's --enable-fat-binary option); added rule for new
|
||||||
|
missing/getcwd.c.
|
||||||
|
|
||||||
|
* defines.h: fixed endian handling during MAB build (see configure's
|
||||||
|
--enable-fat-binary option) to ensure that all portions of the
|
||||||
|
project see the correct WORDS_BIGENDIAN value (some extension modules
|
||||||
|
were getting the wrong endian setting); added missing constants
|
||||||
|
GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
|
||||||
|
and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
|
||||||
|
define in NeXT section.
|
||||||
|
|
||||||
|
* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
|
||||||
|
NextStep since, on some installations, this value always resolves
|
||||||
|
uselessly to zero.
|
||||||
|
|
||||||
|
* dln.c: added error reporting to NextStep extension loader since the
|
||||||
|
previous behavior of failing silently was not useful; now ensures
|
||||||
|
that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
|
||||||
|
for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
|
||||||
|
on Rhapsody since this header lacks multiple-include protection,
|
||||||
|
which resulted in "redefinition" compilation errors.
|
||||||
|
|
||||||
|
* main.c: also create hard reference to objc_msgSend() on NeXT
|
||||||
|
platforms (in addition to Apple platforms).
|
||||||
|
|
||||||
|
* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
|
||||||
|
makefiles so that extensions can be built MAB (see configure's
|
||||||
|
--enable-fat-binary option); also utilize XCFLAGS in cc_command()
|
||||||
|
(but not cpp_command() because MAB flags are incompatible with
|
||||||
|
direct invocation of `cpp').
|
||||||
|
|
||||||
|
* ext/curses/extconf.rb: now additionally checks for presence of these
|
||||||
|
curses functions which are not present on NextStep or Openstep:
|
||||||
|
bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
|
||||||
|
setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
|
||||||
|
wscrl(), wsetscrreg()
|
||||||
|
|
||||||
|
* ext/curses/curses.c: added appropriate #ifdef's for additional set of
|
||||||
|
curses functions now checked by extconf.rb; fixed curses_bkgd() and
|
||||||
|
window_bkgd() to correctly return boolean result rather than numeric
|
||||||
|
result; fixed window_getbkgd() to correctly signal an error by
|
||||||
|
returning nil rather than -1.
|
||||||
|
|
||||||
|
* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
|
||||||
|
pointers before invoking rb_tainted_str_new2() upon fields extracted
|
||||||
|
from `struct passwd' and `struct group' since null pointers in some
|
||||||
|
fields are common on NextStep/OpenStep (especially so for the
|
||||||
|
`pw_comment' field) and rb_tainted_str_new2() throws an exception
|
||||||
|
when it receives a null pointer.
|
||||||
|
|
||||||
|
* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
|
||||||
|
platforms such as NextStep and OpenStep which lack strdup().
|
||||||
|
|
||||||
|
* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
|
||||||
|
gethostbyaddr(), and gethostbyname() from (const char*) to non-const
|
||||||
|
(char*) for older platforms such as NextStep and OpenStep.
|
||||||
|
|
||||||
|
* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
|
||||||
|
platforms such as NextStep and OpenStep which lack strdup(); include
|
||||||
|
<netinet/in_systm.h> if present for NextStep and OpenStep; cast first
|
||||||
|
argument of gethostbyaddr() and getservbyname() from (const char*) to
|
||||||
|
non-const (char*) for older platforms.
|
||||||
|
|
||||||
|
* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
|
||||||
|
platforms such as NextStep and OpenStep which lack strdup().
|
||||||
|
|
||||||
Wed Oct 8 22:19:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
|
Wed Oct 8 22:19:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
|
||||||
|
|
||||||
* lib/test/unit.rb: removed installation instructions.
|
* lib/test/unit.rb: removed installation instructions.
|
||||||
|
@ -4404,92 +4513,6 @@ Wed Sep 10 22:41:54 2003 Tietew <tietew@tietew.net>
|
||||||
* eval.c (win32_get_exception_list): avoid VC7 warning.
|
* eval.c (win32_get_exception_list): avoid VC7 warning.
|
||||||
[ruby-win32:577]
|
[ruby-win32:577]
|
||||||
|
|
||||||
Thu Oct 9 12:05:46 2003 Eric Sunshine <sunshine@sunshineco.com>
|
|
||||||
|
|
||||||
* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
|
|
||||||
had become unbuildable; enhanced --enable-fat-binary option so that
|
|
||||||
it accepts a list of desired architectures (rather than assuming a
|
|
||||||
fixed list), or defaults to a platform-appropriate list if user does
|
|
||||||
not provide an explicit list; made the default list of architectures
|
|
||||||
for MAB (fat binary) more comprehensive; now uses -fno-common even
|
|
||||||
when building the interpreter (in addition to using it for
|
|
||||||
extensions), thus allowing the interpreter to be embedded into a
|
|
||||||
plugin module of an external project (in addition to allowing
|
|
||||||
embedding directly into an application); added checks for
|
|
||||||
<netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
|
|
||||||
ensures that -I/usr/local/include is employed when extensions'
|
|
||||||
extconf.rb scripts invoke have_header() since extension checks on
|
|
||||||
NextStep and OpenStep will fail without it if the desired resource
|
|
||||||
resides in the /usr/local tree; fixed formatting of --help message.
|
|
||||||
|
|
||||||
* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
|
|
||||||
invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
|
|
||||||
(see configure's --enable-fat-binary option); added rule for new
|
|
||||||
missing/getcwd.c.
|
|
||||||
|
|
||||||
* defines.h: fixed endian handling during MAB build (see configure's
|
|
||||||
--enable-fat-binary option) to ensure that all portions of the
|
|
||||||
project see the correct WORDS_BIGENDIAN value (some extension modules
|
|
||||||
were getting the wrong endian setting); added missing constants
|
|
||||||
GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
|
|
||||||
and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
|
|
||||||
define in NeXT section.
|
|
||||||
|
|
||||||
* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
|
|
||||||
NextStep since, on some installations, this value always resolves
|
|
||||||
uselessly to zero.
|
|
||||||
|
|
||||||
* dln.c: added error reporting to NextStep extension loader since the
|
|
||||||
previous behavior of failing silently was not useful; now ensures
|
|
||||||
that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
|
|
||||||
for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
|
|
||||||
on Rhapsody since this header lacks multiple-include protection,
|
|
||||||
which resulted in "redefinition" compilation errors.
|
|
||||||
|
|
||||||
* main.c: also create hard reference to objc_msgSend() on NeXT
|
|
||||||
platforms (in addition to Apple platforms).
|
|
||||||
|
|
||||||
* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
|
|
||||||
makefiles so that extensions can be built MAB (see configure's
|
|
||||||
--enable-fat-binary option); also utilize XCFLAGS in cc_command()
|
|
||||||
(but not cpp_command() because MAB flags are incompatible with
|
|
||||||
direct invocation of `cpp').
|
|
||||||
|
|
||||||
* ext/curses/extconf.rb: now additionally checks for presence of these
|
|
||||||
curses functions which are not present on NextStep or Openstep:
|
|
||||||
bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
|
|
||||||
setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
|
|
||||||
wscrl(), wsetscrreg()
|
|
||||||
|
|
||||||
* ext/curses/curses.c: added appropriate #ifdef's for additional set of
|
|
||||||
curses functions now checked by extconf.rb; fixed curses_bkgd() and
|
|
||||||
window_bkgd() to correctly return boolean result rather than numeric
|
|
||||||
result; fixed window_getbkgd() to correctly signal an error by
|
|
||||||
returning nil rather than -1.
|
|
||||||
|
|
||||||
* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
|
|
||||||
pointers before invoking rb_tainted_str_new2() upon fields extracted
|
|
||||||
from `struct passwd' and `struct group' since null pointers in some
|
|
||||||
fields are common on NextStep/OpenStep (especially so for the
|
|
||||||
`pw_comment' field) and rb_tainted_str_new2() throws an exception
|
|
||||||
when it receives a null pointer.
|
|
||||||
|
|
||||||
* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
|
|
||||||
platforms such as NextStep and OpenStep which lack strdup().
|
|
||||||
|
|
||||||
* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
|
|
||||||
gethostbyaddr(), and gethostbyname() from (const char*) to non-const
|
|
||||||
(char*) for older platforms such as NextStep and OpenStep.
|
|
||||||
|
|
||||||
* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
|
|
||||||
platforms such as NextStep and OpenStep which lack strdup(); include
|
|
||||||
<netinet/in_systm.h> if present for NextStep and OpenStep; cast first
|
|
||||||
argument of gethostbyaddr() and getservbyname() from (const char*) to
|
|
||||||
non-const (char*) for older platforms.
|
|
||||||
|
|
||||||
* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
|
|
||||||
platforms such as NextStep and OpenStep which lack strdup().
|
|
||||||
|
|
||||||
Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Sep 9 10:39:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (struct tag): dst should be VALUE.
|
* eval.c (struct tag): dst should be VALUE.
|
||||||
|
|
2
class.c
2
class.c
|
@ -177,7 +177,6 @@ rb_define_class_id(id, super)
|
||||||
|
|
||||||
if (!super) super = rb_cObject;
|
if (!super) super = rb_cObject;
|
||||||
klass = rb_class_new(super);
|
klass = rb_class_new(super);
|
||||||
rb_name_class(klass, id);
|
|
||||||
rb_make_metaclass(klass, RBASIC(super)->klass);
|
rb_make_metaclass(klass, RBASIC(super)->klass);
|
||||||
|
|
||||||
return klass;
|
return klass;
|
||||||
|
@ -228,6 +227,7 @@ rb_define_class(name, super)
|
||||||
}
|
}
|
||||||
klass = rb_define_class_id(id, super);
|
klass = rb_define_class_id(id, super);
|
||||||
st_add_direct(rb_class_tbl, id, klass);
|
st_add_direct(rb_class_tbl, id, klass);
|
||||||
|
rb_name_class(klass, id);
|
||||||
rb_const_set(rb_cObject, id, klass);
|
rb_const_set(rb_cObject, id, klass);
|
||||||
rb_class_inherited(super, klass);
|
rb_class_inherited(super, klass);
|
||||||
|
|
||||||
|
|
8
error.c
8
error.c
|
@ -396,7 +396,7 @@ exc_to_s(exc)
|
||||||
{
|
{
|
||||||
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
|
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
|
||||||
|
|
||||||
if (NIL_P(mesg)) return rb_class_path(CLASS_OF(exc));
|
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
|
||||||
if (OBJ_TAINTED(exc)) OBJ_TAINT(mesg);
|
if (OBJ_TAINTED(exc)) OBJ_TAINT(mesg);
|
||||||
return mesg;
|
return mesg;
|
||||||
}
|
}
|
||||||
|
@ -435,11 +435,11 @@ exc_inspect(exc)
|
||||||
klass = CLASS_OF(exc);
|
klass = CLASS_OF(exc);
|
||||||
exc = rb_obj_as_string(exc);
|
exc = rb_obj_as_string(exc);
|
||||||
if (RSTRING(exc)->len == 0) {
|
if (RSTRING(exc)->len == 0) {
|
||||||
return rb_str_dup(rb_class_path(klass));
|
return rb_str_dup(rb_class_name(klass));
|
||||||
}
|
}
|
||||||
|
|
||||||
str = rb_str_buf_new2("#<");
|
str = rb_str_buf_new2("#<");
|
||||||
klass = rb_class_path(klass);
|
klass = rb_class_name(klass);
|
||||||
rb_str_buf_append(str, klass);
|
rb_str_buf_append(str, klass);
|
||||||
rb_str_buf_cat(str, ": ", 2);
|
rb_str_buf_cat(str, ": ", 2);
|
||||||
rb_str_buf_append(str, exc);
|
rb_str_buf_append(str, exc);
|
||||||
|
@ -641,7 +641,7 @@ name_err_to_s(exc)
|
||||||
{
|
{
|
||||||
VALUE mesg = rb_attr_get(exc, rb_intern("mesg")), str = mesg;
|
VALUE mesg = rb_attr_get(exc, rb_intern("mesg")), str = mesg;
|
||||||
|
|
||||||
if (NIL_P(mesg)) return rb_class_path(CLASS_OF(exc));
|
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
|
||||||
StringValue(str);
|
StringValue(str);
|
||||||
if (str != mesg) {
|
if (str != mesg) {
|
||||||
rb_iv_set(exc, "mesg", mesg = str);
|
rb_iv_set(exc, "mesg", mesg = str);
|
||||||
|
|
4
eval.c
4
eval.c
|
@ -1131,7 +1131,7 @@ error_print()
|
||||||
else {
|
else {
|
||||||
VALUE epath;
|
VALUE epath;
|
||||||
|
|
||||||
epath = rb_class_path(eclass);
|
epath = rb_class_name(eclass);
|
||||||
if (elen == 0) {
|
if (elen == 0) {
|
||||||
warn_print(": ");
|
warn_print(": ");
|
||||||
warn_print2(RSTRING(epath)->ptr, RSTRING(epath)->len);
|
warn_print2(RSTRING(epath)->ptr, RSTRING(epath)->len);
|
||||||
|
@ -9060,7 +9060,7 @@ Init_Proc()
|
||||||
exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
|
exception_error = rb_exc_new2(rb_eFatal, "exception reentered");
|
||||||
rb_global_variable(&exception_error);
|
rb_global_variable(&exception_error);
|
||||||
|
|
||||||
rb_eSysStackError = rb_define_class("SystemStackError", rb_eStandardError);
|
rb_eSysStackError = rb_define_class("SystemStackError", rb_eException);
|
||||||
sysstack_error = rb_exc_new2(rb_eSysStackError, "stack level too deep");
|
sysstack_error = rb_exc_new2(rb_eSysStackError, "stack level too deep");
|
||||||
OBJ_TAINT(sysstack_error);
|
OBJ_TAINT(sysstack_error);
|
||||||
rb_global_variable(&sysstack_error);
|
rb_global_variable(&sysstack_error);
|
||||||
|
|
66
file.c
66
file.c
|
@ -1046,12 +1046,7 @@ test_wr(obj, fname)
|
||||||
|
|
||||||
if (rb_stat(fname, &st) < 0) return Qnil;
|
if (rb_stat(fname, &st) < 0) return Qnil;
|
||||||
if ((st.st_mode & (S_IROTH)) == S_IROTH) {
|
if ((st.st_mode & (S_IROTH)) == S_IROTH) {
|
||||||
#ifdef __BORLANDC__
|
|
||||||
return UINT2NUM((unsigned short)(st.st_mode &
|
|
||||||
(S_IRUGO|S_IWUGO|S_IXUGO)));
|
|
||||||
#else
|
|
||||||
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
@ -1114,12 +1109,7 @@ test_ww(obj, fname)
|
||||||
|
|
||||||
if (rb_stat(fname, &st) < 0) return Qfalse;
|
if (rb_stat(fname, &st) < 0) return Qfalse;
|
||||||
if ((st.st_mode & (S_IWOTH)) == S_IWOTH) {
|
if ((st.st_mode & (S_IWOTH)) == S_IWOTH) {
|
||||||
#ifdef __BORLANDC__
|
|
||||||
return UINT2NUM((unsigned short)(st.st_mode &
|
|
||||||
(S_IRUGO|S_IWUGO|S_IXUGO)));
|
|
||||||
#else
|
|
||||||
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
return UINT2NUM(st.st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
@ -3576,6 +3566,33 @@ rb_stat_R(obj)
|
||||||
return Qtrue;
|
return Qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* call-seq:
|
||||||
|
* stat.world_readable? => fixnum or nil
|
||||||
|
*
|
||||||
|
* If <i>stat</i> is readable by others, returns an integer
|
||||||
|
* representing the file permission bits of <i>stat</i>. Returns
|
||||||
|
* <code>nil</code> otherwise. The meaning of the bits is platform
|
||||||
|
* dependent; on Unix systems, see <code>stat(2)</code>.
|
||||||
|
*
|
||||||
|
* m = File.stat("/etc/passwd").world_readable? # => 420
|
||||||
|
* sprintf("%o", m) # => "644"
|
||||||
|
*/
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
rb_stat_wr(obj)
|
||||||
|
VALUE obj;
|
||||||
|
{
|
||||||
|
#ifdef S_IROTH
|
||||||
|
if ((get_stat(obj)->st_mode & (S_IROTH)) == S_IROTH) {
|
||||||
|
return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Qnil;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* stat.writable? -> true or false
|
* stat.writable? -> true or false
|
||||||
|
@ -3638,6 +3655,33 @@ rb_stat_W(obj)
|
||||||
return Qtrue;
|
return Qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* call-seq:
|
||||||
|
* stat.world_writable? => fixnum or nil
|
||||||
|
*
|
||||||
|
* If <i>stat</i> is writable by others, returns an integer
|
||||||
|
* representing the file permission bits of <i>stat</i>. Returns
|
||||||
|
* <code>nil</code> otherwise. The meaning of the bits is platform
|
||||||
|
* dependent; on Unix systems, see <code>stat(2)</code>.
|
||||||
|
*
|
||||||
|
* m = File.stat("/tmp").world_writable? # => 511
|
||||||
|
* sprintf("%o", m) # => "777"
|
||||||
|
*/
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
rb_stat_ww(obj)
|
||||||
|
VALUE obj;
|
||||||
|
{
|
||||||
|
#ifdef S_IROTH
|
||||||
|
if ((get_stat(obj)->st_mode & (S_IWOTH)) == S_IWOTH) {
|
||||||
|
return UINT2NUM(get_stat(obj)->st_mode & (S_IRUGO|S_IWUGO|S_IXUGO));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Qnil;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* stat.executable? => true or false
|
* stat.executable? => true or false
|
||||||
|
@ -4248,8 +4292,10 @@ Init_File()
|
||||||
rb_define_method(rb_cStat, "directory?", rb_stat_d, 0);
|
rb_define_method(rb_cStat, "directory?", rb_stat_d, 0);
|
||||||
rb_define_method(rb_cStat, "readable?", rb_stat_r, 0);
|
rb_define_method(rb_cStat, "readable?", rb_stat_r, 0);
|
||||||
rb_define_method(rb_cStat, "readable_real?", rb_stat_R, 0);
|
rb_define_method(rb_cStat, "readable_real?", rb_stat_R, 0);
|
||||||
|
rb_define_method(rb_cStat, "world_readable?", rb_stat_wr, 0);
|
||||||
rb_define_method(rb_cStat, "writable?", rb_stat_w, 0);
|
rb_define_method(rb_cStat, "writable?", rb_stat_w, 0);
|
||||||
rb_define_method(rb_cStat, "writable_real?", rb_stat_W, 0);
|
rb_define_method(rb_cStat, "writable_real?", rb_stat_W, 0);
|
||||||
|
rb_define_method(rb_cStat, "world_writable?", rb_stat_ww, 0);
|
||||||
rb_define_method(rb_cStat, "executable?", rb_stat_x, 0);
|
rb_define_method(rb_cStat, "executable?", rb_stat_x, 0);
|
||||||
rb_define_method(rb_cStat, "executable_real?", rb_stat_X, 0);
|
rb_define_method(rb_cStat, "executable_real?", rb_stat_X, 0);
|
||||||
rb_define_method(rb_cStat, "file?", rb_stat_f, 0);
|
rb_define_method(rb_cStat, "file?", rb_stat_f, 0);
|
||||||
|
|
1
intern.h
1
intern.h
|
@ -437,6 +437,7 @@ VALUE rb_class_path _((VALUE));
|
||||||
void rb_set_class_path _((VALUE, VALUE, const char*));
|
void rb_set_class_path _((VALUE, VALUE, const char*));
|
||||||
VALUE rb_path2class _((const char*));
|
VALUE rb_path2class _((const char*));
|
||||||
void rb_name_class _((VALUE, ID));
|
void rb_name_class _((VALUE, ID));
|
||||||
|
VALUE rb_class_name _((VALUE));
|
||||||
void rb_autoload _((VALUE, ID, const char*));
|
void rb_autoload _((VALUE, ID, const char*));
|
||||||
void rb_autoload_load _((VALUE, ID));
|
void rb_autoload_load _((VALUE, ID));
|
||||||
VALUE rb_autoload_p _((VALUE, ID));
|
VALUE rb_autoload_p _((VALUE, ID));
|
||||||
|
|
14
lib/cgi.rb
14
lib/cgi.rb
|
@ -1125,17 +1125,16 @@ class CGI
|
||||||
@multipart
|
@multipart
|
||||||
end
|
end
|
||||||
|
|
||||||
class Value < DelegateClass(String) # :nodoc:
|
module Value # :nodoc:
|
||||||
def initialize(str, params)
|
def set_params(params)
|
||||||
@params = params
|
@params = params
|
||||||
super(str)
|
|
||||||
end
|
end
|
||||||
def [](idx, *args)
|
def [](idx, *args)
|
||||||
if args.size == 0
|
if args.size == 0
|
||||||
warn "#{caller(1)[0]}:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']"
|
warn "#{caller(1)[0]}:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']"
|
||||||
self
|
@params[idx]
|
||||||
else
|
else
|
||||||
self.to_s[idx,*args]
|
super[idx,*args]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def first
|
def first
|
||||||
|
@ -1165,7 +1164,10 @@ class CGI
|
||||||
Tempfile.new("CGI")
|
Tempfile.new("CGI")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Value.new(value || "", params)
|
str = if value then value.dup else "" end
|
||||||
|
str.extend(Value)
|
||||||
|
str.set_params(params)
|
||||||
|
str
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -720,7 +720,7 @@ class Pathname # * FileTest *
|
||||||
def readable?() FileTest.readable?(@path) end
|
def readable?() FileTest.readable?(@path) end
|
||||||
|
|
||||||
# See <tt>FileTest.readable_world?</tt>.
|
# See <tt>FileTest.readable_world?</tt>.
|
||||||
def readable_world?() FileTest.readable_world?(@path) end
|
def world_readable?() FileTest.world_readable?(@path) end
|
||||||
|
|
||||||
# See <tt>FileTest.readable_real?</tt>.
|
# See <tt>FileTest.readable_real?</tt>.
|
||||||
def readable_real?() FileTest.readable_real?(@path) end
|
def readable_real?() FileTest.readable_real?(@path) end
|
||||||
|
@ -747,7 +747,7 @@ class Pathname # * FileTest *
|
||||||
def writable?() FileTest.writable?(@path) end
|
def writable?() FileTest.writable?(@path) end
|
||||||
|
|
||||||
# See <tt>FileTest.writable_world?</tt>.
|
# See <tt>FileTest.writable_world?</tt>.
|
||||||
def writable_world?() FileTest.writable_world?(@path) end
|
def world_writable?() FileTest.world_writable?(@path) end
|
||||||
|
|
||||||
# See <tt>FileTest.writable_real?</tt>.
|
# See <tt>FileTest.writable_real?</tt>.
|
||||||
def writable_real?() FileTest.writable_real?(@path) end
|
def writable_real?() FileTest.writable_real?(@path) end
|
||||||
|
|
2
object.c
2
object.c
|
@ -1229,7 +1229,7 @@ rb_mod_to_s(klass)
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
return rb_str_dup(rb_class_path(klass));
|
return rb_str_dup(rb_class_name(klass));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
3
regex.c
3
regex.c
|
@ -2181,6 +2181,7 @@ re_compile_pattern(pattern, size, bufp)
|
||||||
|
|
||||||
unfetch_interval:
|
unfetch_interval:
|
||||||
/* If an invalid interval, match the characters as literals. */
|
/* If an invalid interval, match the characters as literals. */
|
||||||
|
re_warning("regexp has invalid interval");
|
||||||
p = beg_interval;
|
p = beg_interval;
|
||||||
beg_interval = 0;
|
beg_interval = 0;
|
||||||
|
|
||||||
|
@ -2363,6 +2364,8 @@ re_compile_pattern(pattern, size, bufp)
|
||||||
default:
|
default:
|
||||||
if (c == ']')
|
if (c == ']')
|
||||||
re_warning("regexp has `]' without escape");
|
re_warning("regexp has `]' without escape");
|
||||||
|
else if (c == '}')
|
||||||
|
re_warning("regexp has `}' without escape");
|
||||||
normal_char: /* Expects the character in `c'. */
|
normal_char: /* Expects the character in `c'. */
|
||||||
had_mbchar = 0;
|
had_mbchar = 0;
|
||||||
if (ismbchar(c)) {
|
if (ismbchar(c)) {
|
||||||
|
|
12
variable.c
12
variable.c
|
@ -146,7 +146,6 @@ classname(klass)
|
||||||
{
|
{
|
||||||
VALUE path = Qnil;
|
VALUE path = Qnil;
|
||||||
|
|
||||||
klass = rb_class_real(klass);
|
|
||||||
if (!klass) klass = rb_cObject;
|
if (!klass) klass = rb_cObject;
|
||||||
if (ROBJECT(klass)->iv_tbl) {
|
if (ROBJECT(klass)->iv_tbl) {
|
||||||
if (!st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) {
|
if (!st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) {
|
||||||
|
@ -281,11 +280,18 @@ rb_name_class(klass, id)
|
||||||
rb_iv_set(klass, "__classid__", ID2SYM(id));
|
rb_iv_set(klass, "__classid__", ID2SYM(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_class_name(klass)
|
||||||
|
VALUE klass;
|
||||||
|
{
|
||||||
|
return rb_class_path(rb_class_real(klass));
|
||||||
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
rb_class2name(klass)
|
rb_class2name(klass)
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
{
|
{
|
||||||
return RSTRING(rb_class_path(klass))->ptr;
|
return RSTRING(rb_class_name(klass))->ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -1193,7 +1199,7 @@ uninitialized_constant(klass, id)
|
||||||
{
|
{
|
||||||
if (klass && klass != rb_cObject)
|
if (klass && klass != rb_cObject)
|
||||||
rb_name_error(id, "uninitialized constant %s::%s",
|
rb_name_error(id, "uninitialized constant %s::%s",
|
||||||
RSTRING(rb_class_path(klass))->ptr,
|
rb_class2name(klass),
|
||||||
rb_id2name(id));
|
rb_id2name(id));
|
||||||
else {
|
else {
|
||||||
rb_name_error(id, "uninitialized constant %s", rb_id2name(id));
|
rb_name_error(id, "uninitialized constant %s", rb_id2name(id));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue