From: Akinori MUSHA Date: 2007-03-03T15:32:09+09:00 Subject: [ruby-dev:30468] Re: fail to autoload at $SAFE==4 --pgp-sign-Multipart_Sat_Mar__3_15:32:09_2007-1 Content-Type: text/plain; charset=ISO-2022-JP At Thu, 1 Mar 2007 00:57:53 +0900, Hidetoshi NAGAI wrote: > From: "Nobuyoshi Nakada" > Subject: [ruby-dev:30437] Re: fail to autoload at $SAFE==4 > Date: Tue, 27 Feb 2007 15:02:33 +0900 > Message-ID: > > 今気づきましたが、動的にスクリプトを$LOAD_PATHに作るという可能性 > > を考えるなら、ロード済みの.soの有無をロード中の.rbの有無よりも優 > > 先させてはまずいので、最後のif文はこうですね。 > > > > if (rb_feature_p(feature, feature + strlen(feature), Qtrue)) > > すみません.きちんとチェックしていませんでした. > この if 文の形で commit されてしまいましたが, > これだと更にまずいみたいで, > ----------------------------------------------------------------------- > ruby -r tk -e 'TkButton.new' > /usr/local/lib/ruby/1.8/tk/label.rb:6: uninitialized constant TkLabel > (NameError) > from /usr/local/lib/ruby/1.8/tk/button.rb:5:in `require' > from /usr/local/lib/ruby/1.8/tk/button.rb:5 > from -e:1 > ----------------------------------------------------------------------- > なんてことになってしまいます. > > TkButton に対する autoload で tk/button.rb を load した際に > "require 'tk/label'" が実行され,tk/label.rb の上の > "class TkLabel > 上記の if 文の部分が "if (rb_feature_p(feature, 0, Qfalse) == 'r')" > であれば,このようにはなりません.  この件はどうしましょうか。 -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Different eyes see different things, Different hearts beat on different strings -- But there are times for you and me when all such things agree" --pgp-sign-Multipart_Sat_Mar__3_15:32:09_2007-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQBF6RZpkgvvx5/Z4e4RAuyiAJwOIElNdbzMZpIgBrIUQ+4kAvG83wCfQQyp cFlFdJfoEyS9gSUfeYQkzMg= =fUZ0 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sat_Mar__3_15:32:09_2007-1--