summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog17
-rw-r--r--README127
-rw-r--r--array.c15
-rw-r--r--configure25
-rw-r--r--configure.in25
-rw-r--r--ext/extmk.rb.in2
-rw-r--r--lib/tk.rb2
-rw-r--r--mkconfig.rb2
-rw-r--r--parse.y40
-rw-r--r--struct.c4
-rw-r--r--version.h4
11 files changed, 218 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index a150ab9a90..c868453f81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+Tue Apr 21 12:31:48 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * experimental release 1.1b9_13.
+
+ * configure.in (RUBY_LIB): supports --program-{prefix,suffix}.
+
+ * array.c (ary_rindex): new method.
+
+ * io.c (io_binmode): should return self.
+
+Tue Apr 21 08:23:04 1998 Tadayoshi Funaba <tadf@kt.rim.or.jp>
+
+ * parse.y (here_document): calling parse_string with wrong
+ arguments.
+
+ * struct.c (struct_aset): problem member assignment with name.
+
Mon Apr 20 14:47:49 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
* experimental release 1.1b9_12.
diff --git a/README b/README
index e69de29bb2..d41fb9f79a 100644
--- a/README
+++ b/README
@@ -0,0 +1,127 @@
+* What's Ruby
+
+Ruby is the interpreted scripting language for quick and
+easy object-oriented programming. It has many features to
+process text files and to do system management tasks (as in
+perl). It is simple, straight-forward, and extensible.
+
+* Features of Ruby
+
+ + Simple Syntax
+ + *Normal* Object-Oriented features(ex. class, method calls)
+ + *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
+ + Operator Overloading
+ + Exception Handling
+ + Iterators and Closures
+ + Garbage Collection
+ + Dynamic Loading of Object files(on some architecture)
+ + Highly Portable(works on many UNIX machines)
+
+* How to get Ruby
+
+The Ruby distribution can be found on
+
+ ftp://ftp.netlab.co.jp/pub/lang/ruby/
+
+* How to compile and install
+
+This is what you need to do to compile and install Ruby:
+
+ 1. Run ./configure, which will generate config.h and Makefile.
+
+ 2. Edit defines.h if you need. Probably this step will not need.
+
+ 3. Remove comment mark(#) before the module names from ext/Setup, if
+ you want to link modules statically.
+
+ If you want to link all the extension modules, remove comment
+ mark from the line "#option nodynamic".
+
+ 4. Run make.
+
+ 5. Optionally, run 'make test' to check that the compiled Ruby
+ interpreter works well. If you see the message "test succeeded",
+ your Ruby works as it should (hopefully).
+
+ 6. Run 'make install'
+
+If you fail to compile Ruby, please send the detailed error report with
+the error log and machine/OS type, to help others.
+
+* Copying
+
+Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.co.jp>.
+You can redistribute it and/or modify it under either the terms of the GPL
+(see COPYING file), or the conditions below:
+
+ 1. You may make and give away verbatim copies of the source form of the
+ software without restriction, provided that you duplicate all of the
+ original copyright notices and associated disclaimers.
+
+ 2. You may modify your copy of the software in any way, provided that
+ you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet
+ or an equivalent medium, or by allowing the author to include your
+ modifications in the software.
+
+ b) use the modified software only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided.
+
+ d) make other distribution arrangements with the author.
+
+ 3. You may distribute the software in object code or executable
+ form, provided that you do at least ONE of the following:
+
+ a) distribute the executables and library files of the software,
+ together with instructions (in the manual page or equivalent)
+ on where to get the original distribution.
+
+ b) accompany the distribution with the machine-readable source of
+ the software.
+
+ c) give non-standard executables non-standard names, with
+ instructions on where to get the original software
+ distribution.
+
+ d) make other distribution arrangements with the author.
+
+ 4. You may modify and include the part of the software into any other
+ software (possibly commercial). But some files in the distribution
+ are not written by the author, so that they are not under this terms.
+ They are gc.c(partly), utils.c(partly), regex.[ch], fnmatch.[ch],
+ glob.c, st.[ch] and some files under the ./missing directory. See
+ each files for the copying condition.
+
+ 5. The scripts and library files supplied as input to or produced as
+ output from the software do not automatically fall under the
+ copyright of the software, but belong to whomever generated them,
+ and may be sold commercially, and may be aggregated with this
+ software.
+
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE.
+
+* Ruby home-page
+
+The URL of the Ruby home-page is:
+
+ http://www.netlab.co.jp/ruby/
+
+* The Author
+
+Feel free to send comments and bug reports to the author. Here is the
+author's latest mail address:
+
+ matz@netlab.co.jp
+
+-------------------------------------------------------
+created at: Thu Aug 3 11:57:36 JST 1995
+Local variables:
+mode: indented-text
+end:
diff --git a/array.c b/array.c
index 157ac16558..3b9d0b923d 100644
--- a/array.c
+++ b/array.c
@@ -412,6 +412,20 @@ ary_index(ary, val)
}
static VALUE
+ary_rindex(ary, val)
+ VALUE ary;
+ VALUE val;
+{
+ int i = i<RARRAY(ary)->len;
+
+ while (i--) {
+ if (rb_equal(RARRAY(ary)->ptr[i], val))
+ return INT2FIX(i);
+ }
+ return Qnil;
+}
+
+static VALUE
ary_indexes(argc, argv, ary)
int argc;
VALUE *argv;
@@ -1299,6 +1313,7 @@ Init_Array()
rb_define_alias(cArray, "size", "length");
rb_define_method(cArray, "empty?", ary_empty_p, 0);
rb_define_method(cArray, "index", ary_index, 1);
+ rb_define_method(cArray, "rindex", ary_rindex, 1);
rb_define_method(cArray, "indexes", ary_indexes, -1);
rb_define_method(cArray, "indices", ary_indexes, -1);
rb_define_method(cArray, "clone", ary_clone, 0);
diff --git a/configure b/configure
index 50ce61b202..afd3fac15c 100644
--- a/configure
+++ b/configure
@@ -3756,12 +3756,21 @@ if test "$fat_binary" = yes ; then
CFLAGS="$CFLAGS -pipe $ARCH_FLAG"
fi
+ri_prefix=
+test "$program_prefix" != NONE &&
+ ri_prefix=$program_prefix
+
+ri_suffix=
+test "$program_suffix" != NONE &&
+ ri_suffix=$program_suffix
+
+RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
cat >> confdefs.h <<EOF
-#define RUBY_LIB "${prefix}/lib/ruby"
+#define RUBY_LIB "${prefix}/lib/${RUBY_INSTALL_NAME}"
EOF
cat >> confdefs.h <<EOF
-#define RUBY_SITE_LIB "${prefix}/lib/site_ruby"
+#define RUBY_SITE_LIB "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby"
EOF
@@ -3769,21 +3778,21 @@ if test "$fat_binary" = yes ; then
arch="fat-${host_os}"
cat >> confdefs.h <<EOF
-#define RUBY_THIN_ARCHLIB "${prefix}/lib/ruby/" __ARCHITECTURE__ "-${host_os}"
+#define RUBY_THIN_ARCHLIB "${prefix}/lib/${RUBY_INSTALL_NAME}/" __ARCHITECTURE__ "-${host_os}"
EOF
cat >> confdefs.h <<EOF
-#define RUBY_SITE_THIN_ARCHLIB "${prefix}/lib/ruby/" __ARCHITECTURE__ "-${host_os}"
+#define RUBY_SITE_THIN_ARCHLIB "${prefix}/lib/${RUBY_INSTALL_NAME}/" __ARCHITECTURE__ "-${host_os}"
EOF
cat >> confdefs.h <<EOF
-#define RUBY_ARCHLIB "${prefix}/lib/ruby/${arch}"
+#define RUBY_ARCHLIB "${prefix}/lib/${RUBY_INSTALL_NAME}/${arch}"
EOF
cat >> confdefs.h <<EOF
-#define RUBY_SITE_ARCHLIB "${prefix}/lib/site_ruby/${arch}"
+#define RUBY_SITE_ARCHLIB "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby/${arch}"
EOF
cat >> confdefs.h <<EOF
@@ -3793,11 +3802,11 @@ EOF
else
arch="${host_cpu}-${host_os}"
cat >> confdefs.h <<EOF
-#define RUBY_ARCHLIB "${prefix}/lib/ruby/${arch}"
+#define RUBY_ARCHLIB "${prefix}/lib/${RUBY_INSTALL_NAME}/${arch}"
EOF
cat >> confdefs.h <<EOF
-#define RUBY_SITE_ARCHLIB "${prefix}/lib/site_ruby/${arch}"
+#define RUBY_SITE_ARCHLIB "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby/${arch}"
EOF
cat >> confdefs.h <<EOF
diff --git a/configure.in b/configure.in
index dc561b4d78..6dc56e2b49 100644
--- a/configure.in
+++ b/configure.in
@@ -452,26 +452,35 @@ if test "$fat_binary" = yes ; then
CFLAGS="$CFLAGS -pipe $ARCH_FLAG"
fi
-AC_DEFINE_UNQUOTED(RUBY_LIB, "${prefix}/lib/ruby")
-AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${prefix}/lib/site_ruby")
+ri_prefix=
+test "$program_prefix" != NONE &&
+ ri_prefix=$program_prefix
+
+ri_suffix=
+test "$program_suffix" != NONE &&
+ ri_suffix=$program_suffix
+
+RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
+AC_DEFINE_UNQUOTED(RUBY_LIB, "${prefix}/lib/${RUBY_INSTALL_NAME}")
+AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby")
AC_SUBST(arch)dnl
if test "$fat_binary" = yes ; then
arch="fat-${host_os}"
AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
- "${prefix}/lib/ruby/" __ARCHITECTURE__ "-${host_os}" )
+ "${prefix}/lib/${RUBY_INSTALL_NAME}/" __ARCHITECTURE__ "-${host_os}" )
AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
- "${prefix}/lib/ruby/" __ARCHITECTURE__ "-${host_os}" )
+ "${prefix}/lib/${RUBY_INSTALL_NAME}/" __ARCHITECTURE__ "-${host_os}" )
- AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${arch}")
- AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${prefix}/lib/site_ruby/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby/${arch}")
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${host_os}" )
else
arch="${host_cpu}-${host_os}"
- AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/ruby/${arch}")
- AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${prefix}/lib/site_ruby/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/${arch}")
+ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${prefix}/lib/${RUBY_INSTALL_NAME}/site_ruby/${arch}")
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
fi
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 161eb7b4f4..2ea88ee2dd 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -352,7 +352,7 @@ def extmake(target)
return if $nodynamic and not $static
$objs = nil
- $libs = "-lc"
+ $libs = PLATFORM =~ /cygwin32/ ? nil : "-lc"
$local_libs = nil # to be assigned in extconf.rb
$CFLAGS = nil
$LDFLAGS = nil
diff --git a/lib/tk.rb b/lib/tk.rb
index 1f6d0ef7f5..08a146b8be 100644
--- a/lib/tk.rb
+++ b/lib/tk.rb
@@ -363,7 +363,7 @@ module Tk
tk_call 'wm', 'bitmap', path, *args
end
def iconify
- tk_call 'wm', 'iconify'
+ tk_call 'wm', 'iconify', path
end
def iconmask(*args)
tk_call 'wm', 'iconmask', path, *args
diff --git a/mkconfig.rb b/mkconfig.rb
index 91ce78c856..cf5c1e13d5 100644
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -32,8 +32,6 @@ File.foreach "config.status" do |$_|
name = $1
val = $2 || ""
next if name =~ /^(INSTALL|DEFS|configure_input|srcdir|top_srcdir)$/
- p defined? val
- p val
v = " CONFIG[\"" + name + "\"] = " +
val.sub(/^\s*(.*)\s*$/, '"\1"').gsub(/\$\{?([^}]*)\}?/) {
"\#{CONFIG[\\\"#{$1}\\\"]}"
diff --git a/parse.y b/parse.y
index 6d69b02d69..fb9660d3a5 100644
--- a/parse.y
+++ b/parse.y
@@ -190,7 +190,7 @@ static void top_local_setup();
%token tCMP /* <=> */
%token tEQ /* == */
%token tEQQ /* === */
-%token tNEQ /* != <> */
+%token tNEQ /* != */
%token tGEQ /* >= */
%token tLEQ /* <= */
%token tANDOP tOROP /* && and || */
@@ -342,7 +342,7 @@ stmt : iterator iter_do_block
$$ = NEW_UNTIL(cond($3), $1, 1);
}
}
- | klBEGIN
+ | klBEGIN
{
if (cur_mid || in_single) {
yyerror("BEGIN in method");
@@ -398,7 +398,7 @@ expr : mlhs '=' mrhs
value_expr($2);
$$ = NEW_NOT(cond($2));
}
- | '!' command_call
+ | '!' command_call
{
value_expr($2);
$$ = NEW_NOT(cond($2));
@@ -1024,7 +1024,7 @@ primary : literal
if (!$3 && !$4)
$$ = NEW_BEGIN($2);
else {
- if ($3) $2 = NEW_RESCUE($2, $3);
+ if ($3) $2 = NEW_RESCUE($2, $3);
if ($4) $2 = NEW_ENSURE($2, $4);
$$ = $2;
}
@@ -1168,7 +1168,7 @@ opt_iter_var : /* node */
{
$$ = 0;
}
- | '|' /* none */ '|'
+ | '|' /* none */ '|'
{
$$ = 0;
}
@@ -1194,7 +1194,7 @@ iter_do_block : kDO
dyna_pop($<vars>2);
}
-iter_block : '{'
+iter_block : '{'
{
$<vars>$ = dyna_push();
}
@@ -1269,7 +1269,7 @@ cases : opt_else
rescue : kRESCUE opt_list do
compstmt
- rescue
+ rescue
{
$$ = NEW_RESBODY($2, $4, $5);
fixpos($$, $2?$2:$4);
@@ -1308,7 +1308,7 @@ variable : tIDENTIFIER
| tCONSTANT
| kNIL {$$ = kNIL;}
| kSELF {$$ = kSELF;}
- | kTRUE {$$ = kTRUE;}
+ | kTRUE {$$ = kTRUE;}
| kFALSE {$$ = kFALSE;}
| k__FILE__ {$$ = k__FILE__;}
| k__LINE__ {$$ = k__LINE__;}
@@ -1980,9 +1980,8 @@ parse_string(func, term, paren)
}
strstart = sourceline;
newtok();
-
while ((c = nextc()) != term || nest > 0) {
- if (c == -1) {
+ if (c == -1) {
unterm_str:
sourceline = strstart;
Error("unterminated string meets end of file");
@@ -2044,7 +2043,7 @@ parse_string(func, term, paren)
static int
parse_qstring(term, paren)
- int term;
+ int term, paren;
{
int strstart;
int c;
@@ -2053,7 +2052,7 @@ parse_qstring(term, paren)
strstart = sourceline;
newtok();
while ((c = nextc()) != term || nest > 0) {
- if (c == -1) {
+ if (c == -1) {
sourceline = strstart;
Error("unterminated string meets end of file");
return 0;
@@ -2131,7 +2130,7 @@ here_document(term)
break;
default:
- c = term;
+ c = term;
term = '"';
if (!is_identchar(c)) {
yyerror("illegal here document");
@@ -2169,7 +2168,7 @@ here_document(term)
lex_pbeg = lex_p = RSTRING(line)->ptr;
lex_pend = lex_p + RSTRING(line)->len;
- switch (parse_string(term, '\n')) {
+ switch (parse_string(term, '\n', '\n')) {
case tSTRING:
case tXSTRING:
str_cat(yylval.val, "\n", 1);
@@ -2209,7 +2208,7 @@ here_document(term)
case '\'':
case '"':
if (list) return tDSTRING;
- yylval.val = str;
+ yylval.val = str;
return tSTRING;
case '`':
if (list) return tDXSTRING;
@@ -3106,7 +3105,7 @@ str_extend(list, term)
}
/* through */
- case '@':
+ case '@':
tokadd(c);
c = nextc();
while (is_identchar(c)) {
@@ -3293,7 +3292,7 @@ list_append(head, tail)
while (last->nd_next) {
last = last->nd_next;
}
-
+
last->nd_next = NEW_LIST(tail);
head->nd_alen += 1;
return head;
@@ -3498,7 +3497,7 @@ attrset(recv, id, val)
{
value_expr(recv);
value_expr(val);
-
+
id &= ~ID_SCOPE_MASK;
id |= ID_ATTRSET;
@@ -3993,7 +3992,6 @@ rb_intern(name)
case '@':
id |= ID_INSTANCE;
break;
- /* fall through */
default:
if (name[0] != '_' && !isalpha(name[0]) && !ismbchar(name[0])) {
/* operator */
@@ -4010,7 +4008,7 @@ rb_intern(name)
if (id == 0) NameError("Unknown operator `%s'", name);
break;
}
-
+
last = strlen(name)-1;
if (name[last] == '=') {
/* attribute assignment */
@@ -4072,7 +4070,7 @@ rb_id2name(id)
st_foreach(sym_tbl, id_find, &ok);
if (!ok.name && is_attrset_id(id)) {
char *res;
- ID id2;
+ ID id2;
id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL;
res = rb_id2name(id2);
diff --git a/struct.c b/struct.c
index df35714adf..b6a19e14bb 100644
--- a/struct.c
+++ b/struct.c
@@ -381,7 +381,7 @@ struct_aref(s, idx)
return RSTRUCT(s)->ptr[i];
}
-VALUE
+static VALUE
struct_aset_id(s, id, val)
VALUE s, val;
ID id;
@@ -412,7 +412,7 @@ struct_aset(s, idx, val)
int i;
if (TYPE(idx) == T_STRING) {
- return struct_aref_id(s, rb_to_id(idx));
+ return struct_aset_id(s, rb_to_id(idx), val);
}
i = NUM2INT(idx);
diff --git a/version.h b/version.h
index 1860e401ee..c3989c2096 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
-#define RUBY_VERSION "1.1b9_12"
-#define VERSION_DATE "98/04/20"
+#define RUBY_VERSION "1.1b9_13"
+#define VERSION_DATE "98/04/21"