From: Masaki Hasegawa Date: 2008-11-18T02:42:04+09:00 Subject: [ruby-list:45645] rdtool cannot handle filter 長谷川 と申します。 Ruby 1.8.7 で rdtool の --with-part=PART が動いていません。 [ruby-list:38917] のパッチでもダメです。 # みなさん使ってないんでしょうか… ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] RDtool -- rd2 0.6.21 # 0.6.22 なんすケド (0.6.20 でも同様) RDtool Framework -- Document Tree 0.6.21 RDtool Framework -- Visitor 0.6.21 とりあえず rd2 への以下のパッチで動きますが、OptionParser を 知りませんので適切なのかどうか分かりません。いかにも不細工ですし。 また、OptionParser#on の挙動が変わってしまったわけですが現状で 良いのでしょうか? # OptionParser#on で klass を省略した pat の指定について、刷新計画の # リファレンスには記述がありますが、従来のリファレンスでは許されて # いないように見えます。でも例示されてるし(最後の例)。 diff -u rd2.orig rd2 --- rd2.orig 2008-11-15 15:02:09.000000000 +0900 +++ rd2 2008-11-15 14:40:49.000000000 +0900 @@ -126,8 +126,10 @@ end # accept "PART:FILTER" and "PART" + class PART ; end + q.accept(PART, /(\w+)(?:\s*:\s*(\w+))?/) {|s, p, f| [s, p, f] } q.on("--with-part=PART", - /(\w+)(?:\s*:\s*(\w+))?/, + PART, "include PART with Filter") do |src, part, filter| with_part.push([part, filter || part]) unless include_path.index(RD::RDTree.tmp_dir)