[#26664] refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

22 messages 2005/08/01
[#26665] Re: refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/01

山本です。

[#26668] Re: refactoring tcltklib.c (deleted ip check) — Hidetoshi NAGAI <nagai@...> 2005/08/01

永井@知能.九工大です.

[#26678] Re: refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/01

山本です。

[#26684] Re: refactoring tcltklib.c (deleted ip check) — Hidetoshi NAGAI <nagai@...> 2005/08/01

永井@知能.九工大です.

[#26686] Re: refactoring tcltklib.c (deleted ip check) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/01

山本です。

[#26817] test/socket/test_tcp.rb freeze on windows — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

12 messages 2005/08/18

[#26829] cannot check EOF of pipe on windows — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

19 messages 2005/08/19
[#26830] Re: cannot check EOF of pipe on windows — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/19

山本です。

[#26831] Re: cannot check EOF of pipe on windows — "U.Nakamura" <usa@...> 2005/08/19

こんにちは、なかむら(う)です。

[#26832] Re: cannot check EOF of pipe on windows — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/19

山本です。

[#26836] Re: cannot check EOF of pipe on windows — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/08/19

なかだです。

[#26872] irb -I/ruby -Iと$LOAD_PATH — akira yamada / やまだあきら <akira@...>

Debianユーザからruby -Iとirb -Iで

17 messages 2005/08/24
[#26873] Re: irb -I/ruby -Iと$LOAD_PATH — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/08/24

なかだです。

[#26875] Re: irb -I/ruby -Iと$LOAD_PATH — akira yamada / やまだあきら <akira@...> 2005/08/24

nobuyoshi nakada wrote:

[#26885] Re: irb -I/ruby -Iと$LOAD_PATH — keiju@... (石塚圭樹) 2005/08/26

けいじゅ@いしつかです.

[#26897] fail on make install — KIMURA Koichi <kimura.koichi@...>

木村です。

28 messages 2005/08/29
[#26898] Re: fail on make install — "U.Nakamura" <usa@...> 2005/08/29

こんにちは、なかむら(う)です。

[#26903] Re: fail on make install — KIMURA Koichi <kbk@...> 2005/08/29

木村です。

[#26922] Re: fail on make install — KIMURA Koichi <kimura.koichi@...> 2005/08/30

木村です。

[#26926] Re: fail on make install — KIMURA Koichi <kimura.koichi@...> 2005/08/31

木村です。

[#26927] Re: fail on make install — "U.Nakamura" <usa@...> 2005/08/31

こんにちは、なかむら(う)です。

[#26928] Re: fail on make install — KIMURA Koichi <kimura.koichi@...> 2005/08/31

木村です。

[#26929] Re: fail on make install — "U.Nakamura" <usa@...> 2005/08/31

こんにちは、なかむら(う)です。

[#26930] Re: fail on make install — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/08/31

なかだです。

[#26931] Re: fail on make install — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/08/31

山本です。

[#26933] Re: fail on make install — nobu@... 2005/08/31

なかだです。

[#26938] Re: fail on make install — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/09/01

なかだです。

[#26939] Re: fail on make install — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/01

山本です。

[#26900] multiplying empty string — nobuyoshi nakada <nobuyoshi.nakada@...>

19 messages 2005/08/29
[#26904] Re: multiplying empty string — Yukihiro Matsumoto <matz@...> 2005/08/29

まつもと ゆきひろです

[#26907] Re: multiplying empty string — Tanaka Akira <akr@...17n.org> 2005/08/29

In article <1125327516.070646.12845.nullmailer@x31.priv.netlab.jp>,

[#26909] Re: multiplying empty string — Yukihiro Matsumoto <matz@...> 2005/08/29

まつもと ゆきひろです

[ruby-dev:26879] Re: rdoc bug ?

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2005-08-25 06:54:28 UTC
List: ruby-dev #26879
山本です。

Windows で ri.bat を実行すると、まだ例外が出るので RDoc.no_comment の nil を "" 
に変える必要があります。

E:\ruby\bin>ri.bat
No ri documentation found in:

Was rdoc run to create documentation?

No usage information available for this program
E:/ruby/lib/ruby/1.8/rdoc/usage.rb:104:in `usage_no_exit': private method `gsub'
 called for nil:NilClass (NoMethodError)
        from E:/ruby/lib/ruby/1.8/rdoc/usage.rb:93:in `usage'
        from E:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:41:in `report_missing_doc
umentation'
        from E:/ruby/lib/ruby/1.8/rdoc/ri/ri_driver.rb:26:in `initialize'
        from E:/ruby/bin/ri.bat:54


しかしこれで例外は出なくなりますが、

No ri documentation found in:

Was rdoc run to create documentation?

No usage information available for this program
Note to developer: requested section(s) [Installing Documentation] not found

となって usage が表示されません。これは lib/rdoc/usage.rb が shebang の前に
何かある場合(ruby -x で実行する場合)に、「コメントなし」と判定するためです。

これを修正する方法が二つ考えられますが、どちらがいいでしょうか。

1. instruby.rb をいじって、ri.bat で ruby -x ri.bat ではなく、ruby ri
   を実行するようにする(ri.bat 以外に ri もインストールされるのでそれを使う)

動作は確認してませんが、こんな感じでしょうか。

Index: instruby.rb
===================================================================
RCS file: /src/ruby/instruby.rb,v
retrieving revision 1.66
diff -u -w -b -p -r1.66 instruby.rb
--- instruby.rb	5 Jul 2005 14:44:56 -0000	1.66
+++ instruby.rb	25 Aug 2005 06:46:25 -0000
@@ -165,18 +165,16 @@ for src in Dir["bin/*"]
   }
 
   if ruby_bin_dosish
-    batfile = File.join(CONFIG["bindir"], name + ".bat")
-    open(with_destdir(batfile), "w") { |b|
-      b.print <<EOH, shebang, body, <<EOF
+    rbfile = File.join(CONFIG["bindir"], name)
+    open(with_destdir(rbfile + ".bat"), "w") { |b|
+      b.print <<EOF
 @echo off
 if not "%~d0" == "~d0" goto WinNT
-#{ruby_bin_dosish} -x "#{batfile}" %1 %2 %3 %4 %5 %6 %7 %8 %9
+#{ruby_bin_dosish} "#{rbfile}" %1 %2 %3 %4 %5 %6 %7 %8 %9
 goto endofruby
 :WinNT
-"%~dp0#{ruby_install_name}" -x "%~f0" %*
+"%~dp0#{ruby_install_name}" "%~dp0#{rbfile}" %*
 goto endofruby
-EOH
-__END__
 :endofruby
 EOF
     }

2. lib/rdoc/usage.rb で、ruby -x で実行するようなスクリプトに対応する。

Index: usage.rb
===================================================================
RCS file: /src/ruby/lib/rdoc/usage.rb,v
retrieving revision 1.5
diff -u -w -b -p -r1.5 usage.rb
--- usage.rb	5 Jan 2005 23:00:08 -0000	1.5
+++ usage.rb	25 Aug 2005 06:37:04 -0000
@@ -128,24 +128,31 @@ module RDoc
 
   # Find the first comment in the file (that isn't a shebang line)
   # If the file doesn't start with a comment, report the fact
-  # and return nil
+  # and return empty string
 
-  def RDoc.find_comment(file)
-    # skip leading blank lines and shebangs
-    while line = file.gets
-      break unless line =~ /^(#!|\s*$)/
+  def RDoc.gets(file)
+    if (line = file.gets) && (line =~ /^#!/) # shebang
+      throw :exit, find_comment(file)
+    else
+      line
+    end
     end
 
-    comment = []
+  def RDoc.find_comment(file)
+    catch (:exit) do
+      # skip leading blank lines
+      0 while (line = gets(file)) && (line =~ /^\s*$/)
 
+      comment = []
     while line && line =~ /^\s*#/
       comment << line
-      line = file.gets
+        line = gets(file)
     end
 
+      0 while line && (line = gets(file))
     return no_comment if comment.empty?
-
-    comment.join
+      return comment.join
+    end
   end
 
 
@@ -167,7 +174,7 @@ module RDoc
           if copy_upto_level && item.level >= copy_upto_level
             copy_upto_level = nil
           else
-            if item.text[0].downcase == name
+            if item.text.downcase == name
               result << item
               copy_upto_level = item.level
             end
@@ -191,7 +198,7 @@ module RDoc
   # Report the fact that no doc comment count be found
   def RDoc.no_comment
     $stderr.puts "No usage information available for this program"
-    nil
+    ""
   end
 end

In This Thread