From: "Nobuyoshi.Nakada" Date: 2000-07-19T15:56:37+09:00 Subject: [ruby-dev:10349] Re: should prohibit `module_function' for class Class なかだです。 At Wed, 19 Jul 2000 13:36:43 +0900 matz@netlab.co.jp (Yukihiro Matsumoto) wrote: > | OptionParserも動かなくなりました。こっちは逆にほとんどを普通のメソッド > |だけにしましたが、過去の遺物が残ってたような感じ。 > |# でも一部両方定義するものもあったり。 > > Dave&Andyからもレポートが来てます。OptionParserは海外でも使 > われてるんですねえ。アップグレードしてくださいませ。 それはびっくり。家からでないとFTPできないのでとりあえずパッチだけ。 # あの英語ともなんともつかないドキュメント添削してくんないかなぁ(^^; =================================================================== RCS file: RCS/optparse.rb,v retrieving revision 0.7.4.0 diff -u -r0.7.4.0 optparse.rb --- optparse.rb 2000-06-20 00:30:17+09 0.7.4.0 +++ optparse.rb 2000-07-17 23:57:35+09 @@ -35,7 +35,7 @@ class OptionParser Copyright = %$Copyleft: (c) 1999-2000 Nakada.Nobuyoshi $.freeze - RCSID = %w$Id: optparse.rb,v 0.7.4.0 2000-06-20 00:30:17+09 nobu Exp $[1..-1].each {|s| s.freeze}.freeze + RCSID = %w$Id: optparse.rb,v 0.7.4.1 2000-07-17 15:06:35+09 nobu Exp $[1..-1].each {|s| s.freeze}.freeze Version = RCSID[1].split('.').collect {|s| s.to_i}.freeze NoArgument = [NO_ARGUMENT = :NONE, nil].freeze @@ -635,10 +635,11 @@ string pushed back to be first non-option argument =end #'#"#`# def terminate(arg = nil) + type.terminate(arg) + end + def self.terminate(arg = nil) throw :terminate, arg end - module_function :terminate - public :terminate @stack = [DefaultList] def self.top() DefaultList end @@ -656,8 +657,7 @@ receives argument string and should be convert to desired class. =end #'#"#`# def accept(*args, &blk) top.accept(*args, &blk) end - module_function :accept - public :accept + def self.accept(*args, &blk) top.accept(*args, &blk) end =begin --- OptionParser.reject(t) @@ -668,8 +668,7 @@ argument class specifier, any object including Class. =end #'#"#`# def reject(*args, &blk) top.reject(*args, &blk) end - module_function :reject - public :reject + def self.reject(*args, &blk) top.reject(*args, &blk) end =begin private --- OptionParser.yieldproc(*args) {block} @@ -937,7 +936,6 @@ end return s, short, long, nolong end - module_function :switch =begin --- OptionParser#on(*opts) [{...}] @@ -1109,7 +1107,6 @@ end nil end - module_function :visit private :visit =begin private @@ -1132,7 +1129,6 @@ return k unless iterator? yield(k) end - module_function :search private :search =begin private @@ -1160,7 +1156,6 @@ } } end - module_function :complete private :complete =begin undocumented -- そうだ 強気に ちょっと インチキに☆彡 中田 "Bugるくらいがちょうどいいかも;-)" 伸悦