1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1998-04-20 06:20:35 +00:00
parent 5a1e96b22a
commit 4dd5679cbb
8 changed files with 36 additions and 155 deletions

View file

@ -1,3 +1,12 @@
Mon Apr 20 14:47:49 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
* experimental release 1.1b9_12.
* time.c (time_arg): args may be string (support for reduced
implicit type conversion).
* lib/base64.rb: changed to use pack/unpack with `m' template.
Mon Apr 20 06:23:20 1998 Yukihiro Matsumoto <matz@netlab.co.jp> Mon Apr 20 06:23:20 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
* variable.c (mod_remove_const): new method. * variable.c (mod_remove_const): new method.
@ -10,6 +19,10 @@ Sat Apr 18 03:53:27 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
* class.c (rb_include_module): check for super modules, since * class.c (rb_include_module): check for super modules, since
module's included modules may be changed. module's included modules may be changed.
Fri Apr 17 21:50:47 1998 WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp>
* marshal.c (r_long): r_byte() may return signed byte.
Fri Apr 17 11:58:30 1998 NAGAI Hidetoshi <nagai@dumbo.ai.kyutech.ac.jp> Fri Apr 17 11:58:30 1998 NAGAI Hidetoshi <nagai@dumbo.ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c (lib_mainloop): thread and interrupt check. * ext/tcltklib/tcltklib.c (lib_mainloop): thread and interrupt check.

127
README
View file

@ -1,127 +0,0 @@
* 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:

View file

@ -187,6 +187,7 @@ VALUE rb_inspect _((VALUE));
VALUE obj_is_instance_of _((VALUE, VALUE)); VALUE obj_is_instance_of _((VALUE, VALUE));
VALUE obj_is_kind_of _((VALUE, VALUE)); VALUE obj_is_kind_of _((VALUE, VALUE));
VALUE obj_alloc _((VALUE)); VALUE obj_alloc _((VALUE));
int rb_obj2int _((VALUE));
VALUE rb_Integer _((VALUE)); VALUE rb_Integer _((VALUE));
VALUE rb_Float _((VALUE)); VALUE rb_Float _((VALUE));
VALUE rb_String _((VALUE)); VALUE rb_String _((VALUE));

View file

@ -1,15 +1,7 @@
require "kconv" require "kconv"
def decode64(str) def decode64(str)
string = '' str.unpack("m")[0]
for line in str.split("\n")
line.delete!('^A-Za-z0-9+/') # remove non-base64 chars
line.tr!('A-Za-z0-9+/', ' -_') # convert to uuencoded format
len = ["#{32 + line.length * 3 / 4}"].pack("c")
# compute length byte
string += "#{len}#{line}".unpack("u") # uudecode and concatenate
end
return string
end end
def decode_b(str) def decode_b(str)
@ -27,14 +19,7 @@ def decode_b(str)
end end
def encode64(bin) def encode64(bin)
encode = "" [bin].pack("m")
pad = 0
[bin].pack("u").each do |uu|
len = (2 + (uu[0] - 32)* 4) / 3
encode << uu[1, len].tr('` -_', 'AA-Za-z0-9+/')
pad += uu.length - 2 - len
end
encode + "=" * (pad % 3)
end end
def b64encode(bin, len = 60) def b64encode(bin, len = 60)

View file

@ -494,8 +494,9 @@ static long
r_long(arg) r_long(arg)
struct load_arg *arg; struct load_arg *arg;
{ {
int c = r_byte(arg), i;
register long x; register long x;
int c = (char)r_byte(arg);
int i;
if (c == 0) return 0; if (c == 0) return 0;
if (c > 0) { if (c > 0) {

View file

@ -743,6 +743,14 @@ rb_Integer(val)
return f_integer(Qnil, val); return f_integer(Qnil, val);
} }
int
rb_obj2int(obj)
VALUE obj;
{
VALUE i = f_integer(Qnil, obj);
return NUM2INT(i);
}
static VALUE static VALUE
to_flo(val) to_flo(val)
VALUE val; VALUE val;

16
time.c
View file

@ -171,10 +171,10 @@ time_arg(argc, argv, args)
rb_scan_args(argc, argv, "15", &v[0],&v[1],&v[2],&v[3],&v[4],&v[5]); rb_scan_args(argc, argv, "15", &v[0],&v[1],&v[2],&v[3],&v[4],&v[5]);
} }
args[0] = NUM2INT(v[0]); args[0] = rb_obj2int(v[0]);
if (args[0] < 70) args[0] += 100; if (args[0] < 70) args[0] += 100;
if (args[0] > 1900) args[0] -= 1900; if (args[0] > 1900) args[0] -= 1900;
if (v[1] == Qnil) { if (NIL_P(v[1])) {
args[1] = 0; args[1] = 0;
} }
else if (TYPE(v[1]) == T_STRING) { else if (TYPE(v[1]) == T_STRING) {
@ -189,25 +189,25 @@ time_arg(argc, argv, args)
char c = RSTRING(v[1])->ptr[0]; char c = RSTRING(v[1])->ptr[0];
if ('0' <= c && c <= '9') { if ('0' <= c && c <= '9') {
args[1] = NUM2INT(v[1])-1; args[1] = rb_obj2int(v[1])-1;
} }
} }
} }
else { else {
args[1] = NUM2INT(v[1]) - 1; args[1] = rb_obj2int(v[1]) - 1;
} }
if (v[2] == Qnil) { if (NIL_P(v[2])) {
args[2] = 1; args[2] = 1;
} }
else { else {
args[2] = NUM2INT(v[2]); args[2] = rb_obj2int(v[2]);
} }
for (i=3;i<6;i++) { for (i=3;i<6;i++) {
if (v[i] == Qnil) { if (NIL_P(v[i])) {
args[i] = 0; args[i] = 0;
} }
else { else {
args[i] = NUM2INT(v[i]); args[i] = rb_obj2int(v[i]);
} }
} }

View file

@ -1,2 +1,2 @@
#define RUBY_VERSION "1.1b9_11" #define RUBY_VERSION "1.1b9_12"
#define VERSION_DATE "98/04/16" #define VERSION_DATE "98/04/20"