[#31320] Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

124 messages 2007/08/01
[#31321] Re: Import RubyGems to Ruby 1.9 — Nobuyoshi Nakada <nobu@...> 2007/08/01

なかだです。

[#31329] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/08/01

-----BEGIN PGP SIGNED MESSAGE-----

[#31918] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/09/30

-----BEGIN PGP SIGNED MESSAGE-----

[#31970] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/10/08

-----BEGIN PGP SIGNED MESSAGE-----

[#32023] Re: Import RubyGems to Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/10/11

まつもと ゆきひろです

[#32062] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/10/15

-----BEGIN PGP SIGNED MESSAGE-----

[#32066] Re: Import RubyGems to Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/10/15

まつもと ゆきひろです

[#32068] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/10/15

-----BEGIN PGP SIGNED MESSAGE-----

[#32069] Re: Import RubyGems to Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/10/15

まつもと ゆきひろです

[#32070] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/10/15

-----BEGIN PGP SIGNED MESSAGE-----

[#32073] Re: Import RubyGems to Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/10/15

まつもと ゆきひろです

[#32079] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/10/16

-----BEGIN PGP SIGNED MESSAGE-----

[#32080] Re: Import RubyGems to Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/10/16

まつもと ゆきひろです

[#32132] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/10/23

-----BEGIN PGP SIGNED MESSAGE-----

[#32081] Re: Import RubyGems to Ruby 1.9 — Takahiro Kambe <taca@...> 2007/10/16

In message <471447D5.5050902@sarion.co.jp>

[#32087] Re: Import RubyGems to Ruby 1.9 — "Akinori MUSHA" <knu@...> 2007/10/17

 Rubygems は、基本的に他のパッケージシステムから包みやすい作り

[#32104] Re: Import RubyGems to Ruby 1.9 — akira yamada <akira@...> 2007/10/20

Tuesday 16 October 2007 14:09:13 に NAKAMURA, Hiroshi さんは書きました:

[#32109] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/10/20

-----BEGIN PGP SIGNED MESSAGE-----

[#31332] Re: Import RubyGems to Ruby 1.9 — Tadayoshi Funaba <tadf@...> 2007/08/01

> ちなみに「ruby/1.9.1の標準添付からどのライブラリを外すか?」という議論も

[#31858] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/09/25

-----BEGIN PGP SIGNED MESSAGE-----

[#31872] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/09/27

-----BEGIN PGP SIGNED MESSAGE-----

[#31905] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/09/29

-----BEGIN PGP SIGNED MESSAGE-----

[#31906] Re: Import RubyGems to Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/09/29

まつもと ゆきひろです

[#31910] Re: Import RubyGems to Ruby 1.9 — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/09/30

-----BEGIN PGP SIGNED MESSAGE-----

[#31920] Re: Import RubyGems to Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/09/30

まつもと ゆきひろです

[#31323] Bignum#to_s の Karatsuba 基数変換による高速化 — "Kenta Murata" <muraken@...>

むらけんです.

16 messages 2007/08/01
[#31326] Re: Bignum#to_s の Karatsuba 基数変換による高速化 — Yukihiro Matsumoto <matz@...> 2007/08/01

まつもと ゆきひろです

[#31327] Re: Bignum#to_s の Karatsuba 基数変換による高速化 — "Kenta Murata" <muraken@...> 2007/08/01

むらけんです.

[#31328] Re: Bignum#to_s の Karatsuba 基数変換による高速化 — Yukihiro Matsumoto <matz@...> 2007/08/01

まつもと ゆきひろです

[#31525] いくつかのバグ報告と提案(5点) — eklerni <eklerni@...>

From:eklerni

13 messages 2007/08/20

[#31539] strtod の精度 — Satoshi Nakagawa <snakagawa@...>

中川といいます。

27 messages 2007/08/20
[#31542] Re: strtod の精度 — Yukihiro Matsumoto <matz@...> 2007/08/20

まつもと ゆきひろです

[ruby-dev:31345] RDoc i18n化パッチ

From: KURODA Hiraku <hiraku@...>
Date: 2007-08-04 10:09:46 UTC
List: ruby-dev #31345
黒田 拓 と言います。

個人的な必要にかられて、RDocをi18n化してみました。パッチは1.8.6-p36に対
するものです。

Rubyのソースに次の要領で複数の言語で記述したコメントを書いておいて、

----
  # Print out `hoge'
  # lang: ja
  # 「ほげ」を出力
  def hoge
     puts "hoge"
  end
----

これからドキュメントを生成するときに

*日本語のみ
*英語のみ
*日本語と英語両方

から選べるようになります。

詳細は http://www.hinet.mydns.jp/~hiraku/hiki/hiki.cgi?RDoci18n に書いて
おきました。


もし取り込んでいただければ光栄です。

Attachments (1)

rdoc_i18n_1.8.6-p36.patch (2.29 KB, text/x-diff)
diff -ur ruby-1.8.6-p36.orig/lib/rdoc/options.rb ruby-1.8.6-p36/lib/rdoc/options.rb
--- ruby-1.8.6-p36.orig/lib/rdoc/options.rb	2007-02-13 08:01:19.000000000 +0900
+++ ruby-1.8.6-p36/lib/rdoc/options.rb	2007-08-04 18:18:37.000000000 +0900
@@ -94,6 +94,10 @@
   # scan newer sources than the flag file if true.
   attr_reader :force_update
 
+  # Language of Document
+  attr_reader :lang
+  attr_reader :lang_strict
+
   module OptionList
 
     OPTION_LIST = [
@@ -238,6 +242,10 @@
         "name of the current file will be substituted;\n" +
         "if the URL doesn't contain a '\%s', the\n" +
         "filename will be appended to it." ],
+      [ "--lang",          "-l",   "language",
+        "Set language of document."],
+      [ "--lang-strict",   "-L",  nil,
+        "Use ONLY language-specified(or not specified) document."],
     ]
 
     def OptionList.options
@@ -409,6 +417,8 @@
         when "--template"      then @template      = arg
         when "--title"         then @title         = arg
         when "--webcvs"        then @webcvs        = arg
+        when "--lang"          then @lang          = arg
+        when "--lang-strict"   then @lang_strict   = true
 
         when "--accessor" 
           arg.split(/,/).each do |accessor|
diff -ur ruby-1.8.6-p36.orig/lib/rdoc/parsers/parse_rb.rb ruby-1.8.6-p36/lib/rdoc/parsers/parse_rb.rb
--- ruby-1.8.6-p36.orig/lib/rdoc/parsers/parse_rb.rb	2007-02-13 08:01:19.000000000 +0900
+++ ruby-1.8.6-p36/lib/rdoc/parsers/parse_rb.rb	2007-08-04 18:18:37.000000000 +0900
@@ -2343,6 +2343,7 @@
       end
 
       remove_private_comments(comment)
+      remove_unwanted_lang(comment)
     end
 
     def remove_private_comments(comment)
@@ -2350,6 +2351,25 @@
       comment.sub!(/^#--.*/m, '')
     end
 
+    def remove_unwanted_lang(comment)
+      dl = @options.lang || "" # Document Language
+      strict = @options.lang_strict
+      sl = "" # Section Language
+      r = ""
+      comment.each_line do |l|
+        if l=~/^\s*\#?\s*lang:/
+          sl = l[/lang:\s*([a-z]{2})/, 1] || ""
+          r << l[/(^.*?)lang/, 1] << "\n"
+        else
+          if strict
+            r << l if sl==dl
+          else
+            r << l if dl.empty? || sl.empty? || sl==dl
+          end
+        end
+      end
+      comment.replace(r)
+    end
 
 
     def get_symbol_or_name

In This Thread

Prev Next