mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
990918-repack
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
12494013d2
commit
7152df6b9b
11 changed files with 107 additions and 74 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,7 +1,16 @@
|
||||||
Fri Sep 17 01:04:25 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
Sat Sep 18 13:45:43 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
* stable version 1.4.2 released.
|
* stable version 1.4.2 released.
|
||||||
|
|
||||||
|
Fri Sep 17 23:24:17 1999 Katsuyuki Komatsu <komatsu@sarion.co.jp>
|
||||||
|
|
||||||
|
* eval.c (rb_f_missing): dumped core if no argument given.
|
||||||
|
|
||||||
|
Fri Sep 17 23:21:06 1999 Katsuyuki Komatsu <komatsu@sarion.co.jp>
|
||||||
|
|
||||||
|
* win32/win32.c (myselect): translate WSAEINTR, WSAENOTSOCK into
|
||||||
|
UNIX errno constants.
|
||||||
|
|
||||||
Fri Sep 17 00:52:27 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
Fri Sep 17 00:52:27 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
|
||||||
|
|
||||||
* parse.y (arg): assignable() may return 0.
|
* parse.y (arg): assignable() may return 0.
|
||||||
|
|
2
README
2
README
|
@ -36,7 +36,7 @@ You can get it by anonymous CVS. How to check out is:
|
||||||
There is a mailing list to talk about Ruby.
|
There is a mailing list to talk about Ruby.
|
||||||
To subscribe this list, please send the following phrase
|
To subscribe this list, please send the following phrase
|
||||||
|
|
||||||
subscribe Your-Last-Name Your-First-Name
|
subscribe YourFirstName YourFamilyName
|
||||||
e.g.
|
e.g.
|
||||||
subscribe Joseph Smith
|
subscribe Joseph Smith
|
||||||
|
|
||||||
|
|
2
eval.c
2
eval.c
|
@ -3592,6 +3592,8 @@ rb_f_missing(argc, argv, obj)
|
||||||
char *file = ruby_sourcefile;
|
char *file = ruby_sourcefile;
|
||||||
int line = ruby_sourceline;
|
int line = ruby_sourceline;
|
||||||
|
|
||||||
|
if (argc == 0) rb_raise(rb_eArgError, "no id given");
|
||||||
|
|
||||||
id = FIX2INT(argv[0]);
|
id = FIX2INT(argv[0]);
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ module Exception2MessageMapper
|
||||||
def E2MM.e2mm_message(klass, exp)
|
def E2MM.e2mm_message(klass, exp)
|
||||||
for c in klass.ancestors
|
for c in klass.ancestors
|
||||||
if mes = @MessageMap[[c,exp]]
|
if mes = @MessageMap[[c,exp]]
|
||||||
p mes
|
#p mes
|
||||||
m = klass.instance_eval('"' + mes + '"')
|
m = klass.instance_eval('"' + mes + '"')
|
||||||
return m
|
return m
|
||||||
end
|
end
|
||||||
|
|
|
@ -104,7 +104,7 @@ class String
|
||||||
self.gsub!(pattern, last)
|
self.gsub!(pattern, last)
|
||||||
else
|
else
|
||||||
h = HashCache[from + "::" + to] ||= expand_ch_hash(from, to)
|
h = HashCache[from + "::" + to] ||= expand_ch_hash(from, to)
|
||||||
self.gsub!(pattern) do |c| p [c,h[c]]; h[c] end
|
self.gsub!(pattern) do |c| h[c] end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
=begin
|
=begin
|
||||||
$Date: 1999/09/14 23:09:05 $
|
$Date: 1999/09/17 17:41:41 $
|
||||||
|
|
||||||
== SIMPLE TELNET CLIANT LIBRARY
|
== SIMPLE TELNET CLIANT LIBRARY
|
||||||
|
|
||||||
telnet.rb
|
telnet.rb
|
||||||
|
|
||||||
Version 0.30
|
Version 0.40
|
||||||
|
|
||||||
Wakou Aoyama <wakou@fsinet.or.jp>
|
Wakou Aoyama <wakou@fsinet.or.jp>
|
||||||
|
|
||||||
|
@ -154,6 +154,12 @@ of cource, set sync=true or flush is necessary.
|
||||||
|
|
||||||
== HISTORY
|
== HISTORY
|
||||||
|
|
||||||
|
=== Version 0.40
|
||||||
|
|
||||||
|
1999/09/17 17:41:41
|
||||||
|
|
||||||
|
- bug fix: preprocess method
|
||||||
|
|
||||||
=== Version 0.30
|
=== Version 0.30
|
||||||
|
|
||||||
1999/09/14 23:09:05
|
1999/09/14 23:09:05
|
||||||
|
@ -392,8 +398,8 @@ class Telnet < SimpleDelegator
|
||||||
EOL = CR + LF
|
EOL = CR + LF
|
||||||
v = $-v
|
v = $-v
|
||||||
$-v = false
|
$-v = false
|
||||||
VERSION = "0.30"
|
VERSION = "0.40"
|
||||||
RELEASE_DATE = "$Date: 1999/09/14 23:09:05 $"
|
RELEASE_DATE = "$Date: 1999/09/17 17:41:41 $"
|
||||||
$-v = v
|
$-v = v
|
||||||
|
|
||||||
def initialize(options)
|
def initialize(options)
|
||||||
|
@ -488,53 +494,47 @@ $-v = v
|
||||||
# combine EOL into "\n"
|
# combine EOL into "\n"
|
||||||
str.gsub!(/#{EOL}/no, "\n") unless @options["Binmode"]
|
str.gsub!(/#{EOL}/no, "\n") unless @options["Binmode"]
|
||||||
|
|
||||||
# respond to "IAC DO x"
|
str.gsub!(/#{IAC}(
|
||||||
str.gsub!(/([^#{IAC}]?)#{IAC}#{DO}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
|
#{IAC}|
|
||||||
if OPT_BINARY == $2
|
#{AYT}|
|
||||||
@telnet_option["BINARY"] = true
|
[#{DO}#{DONT}#{WILL}#{WONT}]
|
||||||
@sock.write(IAC + WILL + OPT_BINARY)
|
[#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]
|
||||||
else
|
)/xno){
|
||||||
@sock.write(IAC + WONT + $2)
|
if IAC == $1 # handle escaped IAC characters
|
||||||
|
IAC
|
||||||
|
elsif AYT == $1 # respond to "IAC AYT" (are you there)
|
||||||
|
@sock.write("nobody here but us pigeons" + EOL)
|
||||||
|
''
|
||||||
|
elsif DO[0] == $1[0] # respond to "IAC DO x"
|
||||||
|
if OPT_BINARY[0] == $1[1]
|
||||||
|
@telnet_option["BINARY"] = true
|
||||||
|
@sock.write(IAC + WILL + OPT_BINARY)
|
||||||
|
else
|
||||||
|
@sock.write(IAC + WONT + $1[1..1])
|
||||||
|
end
|
||||||
|
''
|
||||||
|
elsif DONT[0] == $1[0] # respond to "IAC DON'T x" with "IAC WON'T x"
|
||||||
|
@sock.write(IAC + WONT + $1[1..1])
|
||||||
|
''
|
||||||
|
elsif WILL[0] == $1[0] # respond to "IAC WILL x"
|
||||||
|
if OPT_ECHO[0] == $1[1]
|
||||||
|
@sock.write(IAC + DO + OPT_ECHO)
|
||||||
|
elsif OPT_SGA[0] == $1[1]
|
||||||
|
@telnet_option["SGA"] = true
|
||||||
|
@sock.write(IAC + DO + OPT_SGA)
|
||||||
|
end
|
||||||
|
''
|
||||||
|
elsif WONT[0] == $1[0] # respond to "IAC WON'T x"
|
||||||
|
if OPT_ECHO[0] == $1[1]
|
||||||
|
@sock.write(IAC + DONT + OPT_ECHO)
|
||||||
|
elsif OPT_SGA[0] == $1[1]
|
||||||
|
@telnet_option["SGA"] = false
|
||||||
|
@sock.write(IAC + DONT + OPT_SGA)
|
||||||
|
end
|
||||||
|
''
|
||||||
end
|
end
|
||||||
$1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# respond to "IAC DON'T x" with "IAC WON'T x"
|
|
||||||
str.gsub!(/([^#{IAC}]?)#{IAC}#{DONT}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
|
|
||||||
@sock.write(IAC + WONT + $2)
|
|
||||||
$1
|
|
||||||
}
|
|
||||||
|
|
||||||
# respond to "IAC WILL x"
|
|
||||||
str.gsub!(/([^#{IAC}]?)#{IAC}#{WILL}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
|
|
||||||
if OPT_ECHO == $2
|
|
||||||
@sock.write(IAC + DO + OPT_ECHO)
|
|
||||||
elsif OPT_SGA == $2
|
|
||||||
@telnet_option["SGA"] = true
|
|
||||||
@sock.write(IAC + DO + OPT_SGA)
|
|
||||||
end
|
|
||||||
$1
|
|
||||||
}
|
|
||||||
|
|
||||||
# respond to "IAC WON'T x"
|
|
||||||
str.gsub!(/([^#{IAC}]?)#{IAC}#{WONT}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
|
|
||||||
if OPT_ECHO == $2
|
|
||||||
@sock.write(IAC + DONT + OPT_ECHO)
|
|
||||||
elsif OPT_SGA == $2
|
|
||||||
@telnet_option["SGA"] = false
|
|
||||||
@sock.write(IAC + DONT + OPT_SGA)
|
|
||||||
end
|
|
||||||
$1
|
|
||||||
}
|
|
||||||
|
|
||||||
# respond to "IAC AYT" (are you there)
|
|
||||||
str.gsub!(/([^#{IAC}]?)#{IAC}#{AYT}/no){
|
|
||||||
@sock.write("nobody here but us pigeons" + EOL)
|
|
||||||
$1
|
|
||||||
}
|
|
||||||
|
|
||||||
str.gsub!(/#{IAC}#{IAC}/no, IAC) # handle escaped IAC characters
|
|
||||||
|
|
||||||
str
|
str
|
||||||
end # preprocess
|
end # preprocess
|
||||||
|
|
||||||
|
|
2
regex.c
2
regex.c
|
@ -2186,7 +2186,7 @@ re_compile_pattern(pattern, size, bufp)
|
||||||
pending_exact = b;
|
pending_exact = b;
|
||||||
BUFPUSH(0);
|
BUFPUSH(0);
|
||||||
}
|
}
|
||||||
if (had_num_literal && current_mbctype) {
|
if (had_num_literal || c == 0xff) {
|
||||||
BUFPUSH(0xff);
|
BUFPUSH(0xff);
|
||||||
(*pending_exact)++;
|
(*pending_exact)++;
|
||||||
had_num_literal = 0;
|
had_num_literal = 0;
|
||||||
|
|
30
ruby.1
30
ruby.1
|
@ -33,14 +33,14 @@ ruby - Interpreted object-oriented scripting language
|
||||||
.BI -e "command"\c
|
.BI -e "command"\c
|
||||||
] [ \c
|
] [ \c
|
||||||
.BI -F "pattern"\c
|
.BI -F "pattern"\c
|
||||||
]
|
]
|
||||||
[ \c
|
[ \c
|
||||||
.BI -i "[extension]"\c
|
.BI -i "[extension]"\c
|
||||||
] [ \c
|
] [ \c
|
||||||
.BI -I "dir"\c
|
.BI -I "dir"\c
|
||||||
] [ \c
|
] [ \c
|
||||||
.BI -r "library"\c
|
.BI -r "library"\c
|
||||||
]
|
]
|
||||||
[ \c
|
[ \c
|
||||||
.BI -S \c
|
.BI -S \c
|
||||||
] [ \c
|
] [ \c
|
||||||
|
@ -49,19 +49,19 @@ ruby - Interpreted object-oriented scripting language
|
||||||
.BI -x "[directory]"\c
|
.BI -x "[directory]"\c
|
||||||
] [ \c
|
] [ \c
|
||||||
.BI -X "directory"\c
|
.BI -X "directory"\c
|
||||||
] [ \c
|
]
|
||||||
.BI -y \c
|
|
||||||
]
|
|
||||||
[ \c
|
[ \c
|
||||||
|
.BI -y \c
|
||||||
|
] [ \c
|
||||||
.BI -- \c
|
.BI -- \c
|
||||||
] [ programfile ] [ argument ] ...
|
] [ programfile ] [ argument ] ...
|
||||||
|
|
||||||
.SH PREFACE
|
.SH PREFACE
|
||||||
Ruby is an interpreted scripting language for quick and easy
|
Ruby is an interpreted scripting language for quick and easy
|
||||||
object-oriented programming. It has many features to process text
|
object-oriented programming. It has many features to process text
|
||||||
files and to do system management tasks (as in Perl). It is simple,
|
files and to do system management tasks (as in Perl). It is simple,
|
||||||
straight-forward, and extensible.
|
straight-forward, and extensible.
|
||||||
.PP
|
.PP
|
||||||
If you want a language for easy object-oriented programming, or you
|
If you want a language for easy object-oriented programming, or you
|
||||||
don't like the Perl ugliness, or you do like the concept of lisp, but
|
don't like the Perl ugliness, or you do like the concept of lisp, but
|
||||||
don't like too much parentheses, Ruby may be the language of your
|
don't like too much parentheses, Ruby may be the language of your
|
||||||
|
@ -136,7 +136,7 @@ interpreter on-the-fly.
|
||||||
.SH COMMAND LINE OPTIONS
|
.SH COMMAND LINE OPTIONS
|
||||||
Ruby interpreter accepts following command-line options (switches).
|
Ruby interpreter accepts following command-line options (switches).
|
||||||
They are quite similar to those of Perl.
|
They are quite similar to those of Perl.
|
||||||
.TP
|
.TP
|
||||||
.B -0[octal]
|
.B -0[octal]
|
||||||
specifies the input record separator ($/) as an octal number. If no
|
specifies the input record separator ($/) as an octal number. If no
|
||||||
digit is given, the null character is taken as the separator. Other
|
digit is given, the null character is taken as the separator. Other
|
||||||
|
@ -149,7 +149,7 @@ turns on auto-split mode when used with -n or -p. In auto-split
|
||||||
mode, Ruby executes
|
mode, Ruby executes
|
||||||
.nf
|
.nf
|
||||||
.ne 1
|
.ne 1
|
||||||
\& $F = $_.split
|
\& $F = $_.split
|
||||||
at beginning of each loop.
|
at beginning of each loop.
|
||||||
.fi
|
.fi
|
||||||
.TP
|
.TP
|
||||||
|
@ -165,7 +165,7 @@ prints the copyright notice.
|
||||||
turns on debug mode. $DEBUG will set true.
|
turns on debug mode. $DEBUG will set true.
|
||||||
.TP
|
.TP
|
||||||
.B -e command
|
.B -e command
|
||||||
specifies script from command-line while telling Ruby to not
|
specifies script from command-line while telling Ruby to not
|
||||||
search argv for script filenames.
|
search argv for script filenames.
|
||||||
.TP
|
.TP
|
||||||
.B -F pattern
|
.B -F pattern
|
||||||
|
@ -206,7 +206,7 @@ causes Ruby to assume the following loop around your script,
|
||||||
which makes it iterate over filename arguments somewhat like
|
which makes it iterate over filename arguments somewhat like
|
||||||
sed -n or awk.
|
sed -n or awk.
|
||||||
.nf
|
.nf
|
||||||
.ne 3
|
.ne 3
|
||||||
\& while gets
|
\& while gets
|
||||||
\& ...
|
\& ...
|
||||||
\& end
|
\& end
|
||||||
|
@ -232,7 +232,7 @@ any filename arguments (or before a --). Any switches found there are
|
||||||
removed from ARGV and set the corresponding variable in the script.
|
removed from ARGV and set the corresponding variable in the script.
|
||||||
example:
|
example:
|
||||||
.nf
|
.nf
|
||||||
.ne 3
|
.ne 3
|
||||||
\& #! /usr/local/bin/ruby -s
|
\& #! /usr/local/bin/ruby -s
|
||||||
\& # prints "true" if invoked with `-xyz' switch.
|
\& # prints "true" if invoked with `-xyz' switch.
|
||||||
\& print "true\en" if $xyz
|
\& print "true\en" if $xyz
|
||||||
|
@ -244,7 +244,7 @@ script, unless if its name begins with a slash. This is used to
|
||||||
emulate #! on machines that don't support it, in the following
|
emulate #! on machines that don't support it, in the following
|
||||||
manner:
|
manner:
|
||||||
.nf
|
.nf
|
||||||
.ne 2
|
.ne 2
|
||||||
\& #! /usr/local/bin/ruby
|
\& #! /usr/local/bin/ruby
|
||||||
\& # This line makes the next one a comment in ruby \e
|
\& # This line makes the next one a comment in ruby \e
|
||||||
\& exec /usr/local/bin/ruby -S $0 $*
|
\& exec /usr/local/bin/ruby -S $0 $*
|
||||||
|
@ -262,7 +262,7 @@ messages if this variable is true. If this switch is given, and no
|
||||||
other switches are present, Ruby quits after printing its version.
|
other switches are present, Ruby quits after printing its version.
|
||||||
.TP
|
.TP
|
||||||
.B -T[level]
|
.B -T[level]
|
||||||
turns on taint checks at the specified level (default 1).
|
turns on taint checks at the specified level (default 1).
|
||||||
.TP
|
.TP
|
||||||
.B --version
|
.B --version
|
||||||
prints the version of Ruby interpreter.
|
prints the version of Ruby interpreter.
|
||||||
|
@ -274,7 +274,7 @@ beginning. It set the `$VERBOSE' variable to true.
|
||||||
.B -x[directory]
|
.B -x[directory]
|
||||||
tells Ruby that the script is embedded in a message. Leading garbage
|
tells Ruby that the script is embedded in a message. Leading garbage
|
||||||
will be discarded until the first that starts with "#!" and contains
|
will be discarded until the first that starts with "#!" and contains
|
||||||
the string, "ruby". Any meaningful switches on that line will applied.
|
the string, "ruby". Any meaningful switches on that line will applied.
|
||||||
The end of script must be specified with either EOF, ^D (control-D),
|
The end of script must be specified with either EOF, ^D (control-D),
|
||||||
^Z (control-Z), or reserved word __END__.If the directory name is
|
^Z (control-Z), or reserved word __END__.If the directory name is
|
||||||
specified, Ruby will switch to that directory before executing script.
|
specified, Ruby will switch to that directory before executing script.
|
||||||
|
|
|
@ -1,12 +1,25 @@
|
||||||
#! /usr/local/bin/ruby
|
#! /usr/local/bin/ruby
|
||||||
|
|
||||||
# goodfriday.rb: Written by Tadayoshi Funaba 1998
|
# goodfriday.rb: Written by Tadayoshi Funaba 1998
|
||||||
# $Id: goodfriday.rb,v 1.3 1999/08/04 14:54:18 tadf Exp $
|
# $Id: goodfriday.rb,v 1.1 1998/03/08 09:44:44 tadf Exp $
|
||||||
|
|
||||||
require 'date2'
|
require 'date2'
|
||||||
require 'holiday'
|
|
||||||
|
|
||||||
es = Date.easter(Date.today.year)
|
def easter(y)
|
||||||
|
g = (y % 19) + 1
|
||||||
|
c = (y / 100) + 1
|
||||||
|
x = (3 * c / 4) - 12
|
||||||
|
z = ((8 * c + 5) / 25) - 5
|
||||||
|
d = (5 * y / 4) - x - 10
|
||||||
|
e = (11 * g + 20 + z - x) % 30
|
||||||
|
e += 1 if e == 25 and g > 11 or e == 24
|
||||||
|
n = 44 - e
|
||||||
|
n += 30 if n < 21
|
||||||
|
n = n + 7 - ((d + n) % 7)
|
||||||
|
if n <= 31 then [y, 3, n] else [y, 4, n - 31] end
|
||||||
|
end
|
||||||
|
|
||||||
|
es = Date.new3(*easter(Time.now.year))
|
||||||
[[-9*7, 'Septuagesima Sunday'],
|
[[-9*7, 'Septuagesima Sunday'],
|
||||||
[-8*7, 'Sexagesima Sunday'],
|
[-8*7, 'Sexagesima Sunday'],
|
||||||
[-7*7, 'Quinquagesima Sunday (Shrove Sunday)'],
|
[-7*7, 'Quinquagesima Sunday (Shrove Sunday)'],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define RUBY_VERSION "1.4.2"
|
#define RUBY_VERSION "1.4.2"
|
||||||
#define RUBY_RELEASE_DATE "1999-09-17"
|
#define RUBY_RELEASE_DATE "1999-09-18"
|
||||||
#define RUBY_VERSION_CODE 142
|
#define RUBY_VERSION_CODE 142
|
||||||
#define RUBY_RELEASE_CODE 19990917
|
#define RUBY_RELEASE_CODE 19990918
|
||||||
|
|
|
@ -1828,8 +1828,17 @@ myselect (int nfds, fd_set *rd, fd_set *wr, fd_set *ex,
|
||||||
if (!NtSocketsInitialized++) {
|
if (!NtSocketsInitialized++) {
|
||||||
StartSockets();
|
StartSockets();
|
||||||
}
|
}
|
||||||
if ((r = select (nfds, rd, wr, ex, timeout)) == SOCKET_ERROR)
|
if ((r = select (nfds, rd, wr, ex, timeout)) == SOCKET_ERROR) {
|
||||||
errno = WSAGetLastError();
|
errno = WSAGetLastError();
|
||||||
|
switch (errno) {
|
||||||
|
case WSAEINTR:
|
||||||
|
errno = EINTR;
|
||||||
|
break;
|
||||||
|
case WSAENOTSOCK:
|
||||||
|
errno = EBADF;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue