[#9331] initialize arguments — WATANABE Hirofumi <Hirofumi.Watanabe@...>
わたなべです.
10 messages
2000/03/01
[#9332] Re: initialize arguments
— WATANABE Tetsuya <tetsu@...>
2000/03/01
渡辺哲也です。
[#9377] Hash.new('') — WATANABE Tetsuya <tetsu@...>
渡辺哲也です。
11 messages
2000/03/06
[#9383] rb_call_super() — Yasushi Shoji <yashi@...>
やすしです。
10 messages
2000/03/06
[#9388] Re: rb_call_super()
— Kazuhiro HIWADA <hiwada@...>
2000/03/07
ひわだです。
[#9395] Re: rb_call_super()
— matz@... (Yukihiro Matsumoto)
2000/03/07
まつもと ゆきひろです
[#9398] Re: rb_call_super()
— Yasushi Shoji <yashi@...>
2000/03/07
やすしです。
[#9393] [PATCH] Symbol.new — nobu.nakada@...
なかだです。
13 messages
2000/03/07
[#9396] Re: [PATCH] Symbol.new
— matz@... (Yukihiro Matsumoto)
2000/03/07
まつもと ゆきひろです
[#9424] method_missing(Fixnum) — nobu.nakada@...
なかだです。
5 messages
2000/03/11
[#9430] [BUG] Process.kill :symbol, pid — Koji Arai <JCA02266@...>
新井です。
5 messages
2000/03/12
[#9445] thread.rb — m_seki@...
18 messages
2000/03/16
[#9446] Re: thread.rb
— matz@... (Yukihiro Matsumoto)
2000/03/17
[#9460] Re: thread.rb
— m_seki@...
2000/03/21
[#9462] Re: thread.rb
— matz@... (Yukihiro Matsumoto)
2000/03/21
まつもと ゆきひろです
[#11281] Re: thread.rb
— Masatoshi SEKI <m_seki@...>
2000/10/22
[#11282] Re: thread.rb
— Yasushi Shoji <yashi@...>
2000/10/22
At Mon, 23 Oct 2000 00:14:30 +0900,
[#11283] Re: thread.rb
— Masatoshi SEKI <m_seki@...>
2000/10/22
[#11284] Re: thread.rb
— Yasushi Shoji <yashi@...>
2000/10/22
At Mon, 23 Oct 2000 01:40:14 +0900,
[#11288] sync/async message passing model (was Re: Re: thread.rb)
— kjana@... (YANAGAWA Kazuhisa)
2000/10/23
In message <20001022171627N.yashi@yashi.com>
[#11291] Re: sync/async message passing model (was Re: Re: thread.rb)
— kjana@... (YANAGAWA Kazuhisa)
2000/10/24
追加,追加.
[#9447] ParseDate.parsedate( "2000-03-16T23:45:54+0900" ) — "NAKAMURA, Hiroshi" <nakahiro@...>
なひです.
10 messages
2000/03/17
[#9448] Re: ParseDate.parsedate( "2000-03-16T23:45:54+0900" )
— Tadayoshi Funaba <tadf@...>
2000/03/17
ふなばです。
[#9449] Re: ParseDate.parsedate( "2000-03-16T23:45:54+0900" )
— matz@... (Yukihiro Matsumoto)
2000/03/18
まつもと ゆきひろです
[#9451] Re: ParseDate.parsedate( "2000-03-16T23:45:54+0900" )
— Tadayoshi Funaba <tadf@...>
2000/03/18
ふなばです。
[#9473] Symbol#<=> — Koji Arai <JCA02266@...>
新井です。
12 messages
2000/03/23
[#9477] Re: Symbol#<=>
— matz@... (Yukihiro Matsumoto)
2000/03/24
まつもと ゆきひろです
[#9483] Re: Symbol#<=>
— Koji Arai <JCA02266@...>
2000/03/24
新井です。
[#9489] parsedate2 — Tadayoshi Funaba <tadf@...>
ふなばです。
7 messages
2000/03/25
[#9498] timeout しない timeout — ARIMA Yasuhiro <fit0298@...>
有馬です。
20 messages
2000/03/26
[#9506] Re: timeout しない timeout
— matz@... (Yukihiro Matsumoto)
2000/03/27
まつもと ゆきひろです
[#9509] Re: timeout しない timeout
— gotoken@... (GOTO Kentaro)
2000/03/27
In message "[ruby-dev:9506] Re: timeout しない timeout"
[#9511] Re: timeout しない timeout
— matz@... (Yukihiro Matsumoto)
2000/03/27
まつもと ゆきひろです
[#9512] Re: timeout しない timeout
— ARIMA Yasuhiro <fit0298@...>
2000/03/27
有馬です。
[#9524] Re: timeout しない timeout
— ARIMA Yasuhiro <fit0298@...>
2000/03/29
有馬です。
[#9525] Re: timeout しない timeout
— gotoken@... (GOTO Kentaro)
2000/03/29
ごとけんです
[#9526] Re: timeout しない timeout
— ARIMA Yasuhiro <fit0298@...>
2000/03/29
有馬です。
[#9528] Re: timeout しない timeout
— gotoken@... (GOTO Kentaro)
2000/03/30
ごとけんです
[#9529] Re: timeout しない timeout
— ARIMA Yasuhiro <fit0298@...>
2000/03/30
有馬です。
[ruby-dev:9418] Re: ruby object
From:
Motoyuki Kasahara <m-kasahr@...>
Date:
2000-03-09 08:00:22 UTC
List:
ruby-dev #9418
SRA の笠原です。ごぶさたしております。
すごく遅いフォローで申し訳ないですが、
* From: matz@netlab.co.jp (Yukihiro Matsumoto)
* Date: Thu, 24 Feb 2000 09:44:20 +0900
* Subject: Re: [ruby-dev:9280] Re: ruby object
> |削るのは無理だけど, せめて lib/*.rb で $_ を使ってるのは撲滅したい気分.
> |lib/mailread.rb の f は gets と close さえあれば IO である必
> |要もなく, たとえばすでに読み込んである文字列にも対応できそう
> |なんだけど, gets で $_ を使ってるためだめ. 実に惜しい.
>
> なっとく。mailread.rbとpop3.rbのものは削りましょう。
> getoptlongにも登場してるけど、どうしよう。
ということなので、とりあえず getoptlong.rb から $_ を削ってみま
した。CVS 上の getoptlong.rb revision 1.4 に対するパッチです。
________________________________________________________________
笠原 基之(かさはら もとゆき)
Attachments (1)
getoptlong.diff
(5.87 KB, text/x-diff)
--- getoptlong.rb.orig Thu Mar 9 16:51:14 2000
+++ getoptlong.rb Thu Mar 9 16:15:57 2000
@@ -1,5 +1,5 @@
# -*- Ruby -*-
-# Copyright (C) 1998 Motoyuki Kasahara
+# Copyright (C) 1998, 1999, 2000 Motoyuki Kasahara
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -232,7 +232,7 @@
# Termintate option processing.
#
def terminate
- return if @status == STATUS_TERMINATED
+ return nil if @status == STATUS_TERMINATED
raise RuntimeError, "an error has occured" if @error != nil
@status = STATUS_TERMINATED
@@ -293,12 +293,12 @@
# Get next option name and its argument as an array.
#
def get
- name, argument = nil, ''
+ option_name, option_argument = nil, ''
#
# Check status.
#
- return if @error != nil
+ return nil if @error != nil
case @status
when STATUS_YET
@status = STATUS_STARTED
@@ -310,7 +310,7 @@
# Get next option argument.
#
if 0 < @rest_singles.length
- $_ = '-' + @rest_singles
+ argument = '-' + @rest_singles
elsif (ARGV.length == 0)
terminate
return nil
@@ -322,22 +322,22 @@
terminate
return nil
end
- $_ = ARGV.shift
+ argument = ARGV.shift
elsif @ordering == REQUIRE_ORDER
if (ARGV[0] !~ /^-./)
terminate
return nil
end
- $_ = ARGV.shift
+ argument = ARGV.shift
else
- $_ = ARGV.shift
+ argument = ARGV.shift
end
#
# Check the special argument `--'.
# `--' indicates the end of the option list.
#
- if $_ == '--' && @rest_singles.length == 0
+ if argument == '--' && @rest_singles.length == 0
terminate
return nil
end
@@ -345,87 +345,88 @@
#
# Check for long and short options.
#
- if /^(--[^=]+)/ && @rest_singles.length == 0
+ if argument =~ /^(--[^=]+)/ && @rest_singles.length == 0
#
# This is a long style option, which start with `--'.
#
pattern = $1
if @canonical_names.include?(pattern)
- name = pattern
+ option_name = pattern
else
#
- # The option `name' is not registered in `@canonical_names'.
+ # The option `option_name' is not registered in `@canonical_names'.
# It may be an abbreviated.
#
match_count = 0
@canonical_names.each_key do |key|
if key.index(pattern) == 0
- name = key
+ option_name = key
match_count += 1
end
end
if 2 <= match_count
- set_error(AmbigousOption, "option `#{$_}' is ambiguous")
+ set_error(AmbigousOption, "option `#{argument}' is ambiguous")
elsif match_count == 0
- set_error(InvalidOption, "unrecognized option `#{$_}'")
+ set_error(InvalidOption, "unrecognized option `#{argument}'")
end
end
#
# Check an argument to the option.
#
- if @argument_flags[name] == REQUIRED_ARGUMENT
- if /=(.*)$/
- argument = $1
+ if @argument_flags[option_name] == REQUIRED_ARGUMENT
+ if argument =~ /=(.*)$/
+ option_argument = $1
elsif 0 < ARGV.length
- argument = ARGV.shift
+ option_argument = ARGV.shift
else
- set_error(MissingArgument, "option `#{$_}' requires an argument")
+ set_error(MissingArgument,
+ "option `#{argument}' requires an argument")
end
- elsif @argument_flags[name] == OPTIONAL_ARGUMENT
- if /=(.*)$/
- argument = $1
+ elsif @argument_flags[option_name] == OPTIONAL_ARGUMENT
+ if argument =~ /=(.*)$/
+ option_argument = $1
elsif 0 < ARGV.length && ARGV[0] !~ /^-./
- argument = ARGV.shift
+ option_argument = ARGV.shift
else
- argument = ''
+ option_argument = ''
end
- elsif /=(.*)$/
+ elsif argument =~ /=(.*)$/
set_error(NeedlessArgument,
- "option `#{name}' doesn't allow an argument")
+ "option `#{option_name}' doesn't allow an argument")
end
- elsif /^(-(.))(.*)/
+ elsif argument =~ /^(-(.))(.*)/
#
# This is a short style option, which start with `-' (not `--').
# Short options may be catinated (e.g. `-l -g' is equivalent to
# `-lg').
#
- name, ch, @rest_singles = $1, $2, $3
+ option_name, ch, @rest_singles = $1, $2, $3
- if @canonical_names.include?(name)
+ if @canonical_names.include?(option_name)
#
- # The option `name' is found in `@canonical_names'.
+ # The option `option_name' is found in `@canonical_names'.
# Check its argument.
#
- if @argument_flags[name] == REQUIRED_ARGUMENT
+ if @argument_flags[option_name] == REQUIRED_ARGUMENT
if 0 < @rest_singles.length
- argument = @rest_singles
+ option_argument = @rest_singles
@rest_singles = ''
elsif 0 < ARGV.length
- argument = ARGV.shift
+ option_argument = ARGV.shift
else
# 1003.2 specifies the format of this message.
set_error(MissingArgument, "option requires an argument -- #{ch}")
end
- elsif @argument_flags[name] == OPTIONAL_ARGUMENT
+ elsif @argument_flags[option_name] == OPTIONAL_ARGUMENT
if 0 < @rest_singles.length
- argument = @rest_singles
+ option_argument = @rest_singles
@rest_singles = ''
elsif 0 < ARGV.length && ARGV[0] !~ /^-./
- argument = ARGV.shift
+ option_argument = ARGV.shift
else
- argument = ''
+ option_argument = ''
end
end
else
@@ -444,10 +445,10 @@
# This is a non-option argument.
# Only RETURN_IN_ORDER falled into here.
#
- return '', $_
+ return '', argument
end
- return @canonical_names[name], argument
+ return @canonical_names[option_name], option_argument
end
#
@@ -460,9 +461,9 @@
#
def each
loop do
- name, argument = get_option
- break if name == nil
- yield name, argument
+ option_name, option_argument = get_option
+ break if option_name == nil
+ yield option_name, option_argument
end
end