[#38392] Enumerable#gather_each — Tanaka Akira <akr@...>

ときに、複数行をまとめて扱いたいことがあります。

47 messages 2009/05/09
[#38394] Re: Enumerable#gather_each — ujihisa <ujihisa@...> 2009/05/09

ujihisaと申します。

[#38400] Re: Enumerable#gather_each — Yukihiro Matsumoto <matz@...> 2009/05/09

まつもと ゆきひろです

[#38399] Re: Enumerable#gather_each — "Akinori MUSHA" <knu@...> 2009/05/09

At Sat, 9 May 2009 15:30:20 +0900,

[#38405] Re: Enumerable#gather_each — Tanaka Akira <akr@...> 2009/05/10

In article <86r5yy2nrg.knu@iDaemons.org>,

[#38417] Re: Enumerable#gather_each — "Akinori MUSHA" <knu@...> 2009/05/10

At Sun, 10 May 2009 10:08:47 +0900,

[#38524] [Bug #1503] -Kuをつけた時、/[#{s}]/n と Regexp.new("[#{s}]",nil,"n") で実行結果が異なる — sinnichi eguchi <redmine@...>

Bug #1503: -Kuをつけた時、/[#{s}]/n と Regexp.new("[#{s}]",nil,"n") で実行結果が異なる

8 messages 2009/05/22

[ruby-dev:38381] Re: Marshaling URI between 1.8 and 1.9

From: Yukihiro Matsumoto <matz@...>
Date: 2009-05-07 05:41:55 UTC
List: ruby-dev #38381
まつもと ゆきひろです

In message "Re: [ruby-dev:38377] Marshaling URI between 1.8 and 1.9"
    on Wed, 6 May 2009 14:21:34 +0900, Tanaka Akira <akr@fsij.org> writes:

|気がついたんですが、URI オブジェクトを marshal で 1.9 から
|1.8 に移そうとすると失敗します。
|
|% ruby -v    
|ruby 1.9.2dev (2009-05-02 trunk 23326) [i686-linux]
|% ruby-1.8 -v                                                          
|ruby 1.8.8dev (2009-04-22 revision 23257) [i686-linux]
|
|% ruby -ruri -e 'Marshal.dump(URI("http://example.org"), STDOUT)' > u19
|% ruby-1.8 -ruri -e 'Marshal.load(STDIN)' < u19
|-e:1:in `load': undefined class/module URI::Parser (ArgumentError)
|        from -e:1
|
|理由はエラーメッセージに書いてある通りで、1.9 の URI オブジェ
|クトには URI::Parser オブジェクトが入っているのに、1.8 には
|URI::Parser クラスがないからです。
|
|逆に、1.8 の URI オブジェクトを 1.9 に移すのは、Mashal.load
|までは動きます。

|この理由は @parser がないからです。

|思うのですが、デフォルトのパーザを使うときはインスタンス変数
|には記録しないようにするのはどうでしょうか。
|
|そうすれば、(デフォルトのパーザを使用する URI では) パーザが
|marshal したデータに表れなくなるので、1.8 と 1.9 の間で
|marshal できるようになります。

私はこの変更に賛成です。

In This Thread