diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/Makefile ../rdoc-dennou-20060118/Makefile
--- ruby-1.8.4/lib/rdoc/Makefile 1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-dennou-20060118/Makefile 2005-12-19 19:55:42.000000000 +0900
@@ -0,0 +1,46 @@
+all:
+
+doc:
+ rdoc --op doc --title "RDoc-Dennou Documentations" \
+ --charset euc-jp --inline-source --line-numbers \
+ --main README.ja \
+ README README.ja README.org *.rb */*.rb */*/*.rb
+
+clean: clean-doc
+ test "`find . -name '*~'`" = "" || rm `find . -name '*~'`
+
+clean-doc:
+ test ! -d doc || rm -rf -v doc
+
+patch:
+ if [ ! -d patch_dir ] ; then \
+ mkdir patch_dir ;\
+ cd patch_dir ;\
+ cvs -d :pserver:anonymous@cvs.ruby-lang.org:/src login ;\
+ cvs -z4 -d :pserver:anonymous@cvs.ruby-lang.org:/src co ruby ;\
+ fi
+ cd patch_dir/ruby ; cvs update
+ test -L patch_dir/ruby/lib/rdoc-dennou || \
+ eval "cd patch_dir/ruby/lib ; ln -s ../../../ rdoc-dennou"
+ cd patch_dir/ruby ; \
+ diff \
+ --exclude=rdoc \
+ --exclude=parse_c.rb \
+ --exclude=parse_rb.rb \
+ --exclude=install.rb \
+ --exclude=README* \
+ --exclude=Makefile \
+ --exclude=*~ \
+ --exclude=CVS \
+ --exclude=patch_dir \
+ --exclude=rdoc-cvs.patch \
+ --exclude=rdoc-cvs.patch.tmp \
+ -Nur lib/rdoc/ lib/rdoc-dennou/ > ../../rdoc-cvs.patch.tmp \
+ || true
+ sed "s|^diff.*$$|diff -Nur lib/rdoc/ lib/rdoc-`date +%Y-%m-%d`/|" rdoc-cvs.patch.tmp > rdoc-cvs.patch
+ rm rdoc-cvs.patch.tmp
+
+clean-patch:
+ -rm -v rdoc-cvs.patch.tmp rdoc-cvs.patch
+ -rm -v -rf patch_dir/ruby
+ -rmdir patch_dir
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/README ../rdoc-dennou-20060118/README
--- ruby-1.8.4/lib/rdoc/README 2004-12-04 14:38:15.000000000 +0900
+++ ../rdoc-dennou-20060118/README 2005-11-02 17:10:24.000000000 +0900
@@ -1,492 +1,3 @@
-= RDOC - Ruby Documentation System
+= RDOC changed for enhancement of Fortran95 parser (for GFD Dennou Club dcmodel project)
-This package contains Rdoc and SimpleMarkup. Rdoc is an application
-that produces documentation for one or more Ruby source files. We work
-similarly to JavaDoc, parsing the source, and extracting the
-definition for classes, modules, and methods (along with includes and
-requires). We associate with these optional documentation contained
-in the immediately preceding comment block, and then render the result
-using a pluggable output formatter. (Currently, HTML is the only
-supported format. Markup is a library that converts plain text into
-various output formats. The Markup library is used to interpret the
-comment blocks that Rdoc uses to document methods, classes, and so on.
-
-This library contains two packages, rdoc itself and a text markup
-library, 'markup'.
-
-== Roadmap
-
-* If you want to use Rdoc to create documentation for your Ruby source
- files, read on.
-* If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
-* For information on the various markups available in comment
- blocks, see markup/simple_markup.rb.
-* If you want to drive Rdoc programatically, see RDoc::RDoc.
-* If you want to use the library to format text blocks into HTML,
- have a look at SM::SimpleMarkup.
-* If you want to try writing your own HTML output template, see
- RDoc::Page.
-
-== Summary
-
-Once installed, you can create documentation using the 'rdoc' command
-(the command is 'rdoc.bat' under Windows)
-
- % rdoc [options] [names...]
-
-Type "rdoc --help" for an up-to-date option summary.
-
-A typical use might be to generate documentation for a package of Ruby
-source (such as rdoc itself).
-
- % rdoc
-
-This command generates documentation for all the Ruby and C source
-files in and below the current directory. These will be stored in a
-documentation tree starting in the subdirectory 'doc'.
-
-You can make this slightly more useful for your readers by having the
-index page contain the documentation for the primary file. In our
-case, we could type
-
- % rdoc --main rdoc/rdoc.rb
-
-You'll find information on the various formatting tricks you can use
-in comment blocks in the documentation this generates.
-
-RDoc uses file extensions to determine how to process each file. File
-names ending .rb and .rbw are assumed to be Ruby
-source. Files ending .c are parsed as C files. All other
-files are assumed to contain just SimpleMarkup-style markup (with or
-without leading '#' comment markers). If directory names are passed to
-RDoc, they are scanned recursively for C and Ruby source files only.
-
-== Credits
-
-* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
- work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
- parser for irb and the rtags package.
-
-* Code to diagram classes and modules was written by Sergey A Yanovitsky
- (Jah) of Enticla.
-
-* Charset patch from MoonWolf.
-
-* Rich Kilmer wrote the kilmer.rb output template.
-
-* Dan Brickley led the design of the RDF format.
-
-== License
-
-RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It
-is free software, and may be redistributed under the terms specified
-in the README file of the Ruby distribution.
-
-
-----
-
-= Usage
-
-RDoc is invoked from the command line using:
-
- % rdoc [name...]
-
-Files are parsed, and the information they contain collected, before
-any output is produced. This allows cross references between all files
-to be resolved. If a name is a directory, it is traversed. If no
-names are specified, all Ruby files in the current directory (and
-subdirectories) are processed.
-
-Options are:
-
-[--accessorname[,name...]]
- specifies the name(s) of additional methods that should be treated
- as if they were attr_xxx methods. Specifying
- "--accessor db_opt" means lines such as
-
- db_opt :name, :age
-
- will get parsed and displayed in the documentation. Each name may have an
- optional "=flagtext" appended, in which case the given flagtext will appear
- where (for example) the 'rw' appears for attr_accessor.
-
-[--all]
- include protected and private methods in the output (by default
- only public methods are included)
-
-[--charset _charset_]
- Set the character set for the generated HTML.
-
-[--diagram]
- include diagrams showing modules and classes. This is currently
- an experimental feature, and may not be supported by all output
- templates. You need dot V1.8.6 or later to use the --diagram
- option correctly (http://www.research.att.com/sw/tools/graphviz/).
-
-[--excludepattern]
- exclude files and directories matching this pattern from processing
-
-[--extensionnew=old]
- treat files ending .new as if they ended
- .old. Saying '--extension cgi=rb' causes RDoc to treat .cgi
- files as Ruby source.
-
-[fileboxes]
- Classes are put in boxes which represents files, where these
- classes reside. Classes shared between more than one file are
- shown with list of files that sharing them. Silently discarded if
- --diagram is not given Experimental.
-
-[--fmt _fmt_]
- generate output in a particular format.
-
-[--help]
- generate a usage summary.
-
-[--help-output]
- explain the various output options.
-
-[--image-formatgif/png/jpg/jpeg]
- sets output image format for diagrams. Can be png, gif, jpeg,
- jpg. If this option is omitted, png is used. Requires --diagram.
-
-[--includedir,...]
- specify one or more directories to be searched when satisfying
- :+include+: directives. Multiple --include options may be
- given. The directory containing the file currently being processed
- is always searched.
-
-[--inline-source]
- By default, the source code of methods is shown in a popup. With
- this option, it's displayed inline.
-
-[line-numbers]
- include line numbers in the source code
-
-[--main _name_]
- the class of module _name_ will appear on the index page. If you
- want to set a particular file as a main page (a README, for
- example) simply specifiy its name as the first on the command
- line.
-
-[--merge]
- when generating _ri_ output, if classes being processed already
- exist in the destination directory, merge in the current details
- rather than overwrite them.
-
-[--one-file]
- place all the output into a single file
-
-[--op _dir_]
- set the output directory to _dir_ (the default is the directory
- "doc")
-
-[--op-name _name_]
- set the name of the output. Has no effect for HTML.
- "doc")
-
-[--opname _name_]
- set the output name (has no effect for HTML).
-
-[--promiscuous]
- If a module or class is defined in more than one source file, and
- you click on a particular file's name in the top navigation pane,
- RDoc will normally only show you the inner classes and modules of
- that class that are defined in the particular file. Using this
- option makes it show all classes and modules defined in the class,
- regardless of the file they were defined in.
-
-[--quiet]
- do not display progress messages
-
-[--ri, --ri-site, _and_ --ri-system]
- generate output than can be read by the _ri_ command-line tool.
- By default --ri places its output in ~/.rdoc, --ri-site in
- $datadir/ri//site, and --ri-system in
- $datadir/ri//system. All can be overridden with a subsequent
- --op option. All default directories are in ri's default search
- path.
-
-[--show-hash]
- A name of the form #name in a comment is a possible hyperlink to
- an instance method name. When displayed, the '#' is removed unless
- this option is specified
-
-[--stylestylesheet url]
- specifies the URL of an external stylesheet to use (rather than
- generating one of our own)
-
-[tab-width _n_]
- set the width of tab characters (default 8)
-
-[--templatename]
- specify an alternate template to use when generating output (the
- default is 'standard'). This template should be in a directory
- accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
- depends on the output formatter.
-
-[--version]
- display RDoc's version
-
-[--webcvs _url_]
- Specify a URL for linking to a web frontend to CVS. If the URL
- contains a '\%s', the name of the current file will be
- substituted; if the URL doesn't contain a '\%s', the filename will
- be appended to it.
-
-= Example
-
-A typical small Ruby program commented using RDoc might be as follows. You
-can see the formatted result in EXAMPLE.rb and Anagram.
-
- :include: EXAMPLE.rb
-
-= Markup
-
-Comment blocks can be written fairly naturally, either using '#' on
-successive lines of the comment, or by including the comment in
-an =begin/=end block. If you use the latter form, the =begin line
-must be flagged with an RDoc tag:
-
- =begin rdoc
- Documentation to
- be processed by RDoc.
- =end
-
-Paragraphs are lines that share the left margin. Text indented past
-this margin are formatted verbatim.
-
-1. Lists are typed as indented paragraphs with:
- * a '*' or '-' (for bullet lists)
- * a digit followed by a period for
- numbered lists
- * an upper or lower case letter followed
- by a period for alpha lists.
-
- For example, the input that produced the above paragraph looked like
- 1. Lists are typed as indented
- paragraphs with:
- * a '*' or '-' (for bullet lists)
- * a digit followed by a period for
- numbered lists
- * an upper or lower case letter followed
- by a period for alpha lists.
-
-2. Labeled lists (sometimes called description
- lists) are typed using square brackets for the label.
- [cat] small domestic animal
- [+cat+] command to copy standard input
-
-3. Labeled lists may also be produced by putting a double colon
- after the label. This sets the result in tabular form, so the
- descriptions all line up. This was used to create the 'author'
- block at the bottom of this description.
- cat:: small domestic animal
- +cat+:: command to copy standard input
-
- For both kinds of labeled lists, if the body text starts on the same
- line as the label, then the start of that text determines the block
- indent for the rest of the body. The text may also start on the line
- following the label, indented from the start of the label. This is
- often preferable if the label is long. Both the following are
- valid labeled list entries:
-
- --outputname [, name]::
- specify the name of one or more output files. If multiple
- files are present, the first is used as the index.
-
- --quiet::: do not output the names, sizes, byte counts,
- index areas, or bit ratios of units as
- they are processed.
-
-4. Headings are entered using equals signs
-
- = Level One Heading
- == Level Two Heading
- and so on
-
-5. Rules (horizontal lines) are entered using three or
- more hyphens.
-
-6. Non-verbatim text can be marked up:
-
- _italic_:: \_word_ or \text
- *bold*:: \*word* or \text
- +typewriter+:: \+word+ or \text
-
- The first form only works around 'words', where a word is a
- sequence of upper and lower case letters and underscores. Putting a
- backslash before inline markup stops it being interpreted, which is
- how I created the table above:
-
- _italic_:: \_word_ or \text
- *bold*:: \*word* or \text
- +typewriter+:: \+word+ or \text
-
-7. Names of classes, source files, and any method names
- containing an underscore or preceded by a hash
- character are automatically hyperlinked from
- comment text to their description.
-
-8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
- recognized. An HTTP url that references an external image file is
- converted into an inline . Hyperlinks starting 'link:' are
- assumed to refer to local files whose path is relative to the --op
- directory.
-
- Hyperlinks can also be of the form label[url], in which
- case the label is used in the displayed text, and url is
- used as the target. If label contains multiple words,
- put it in braces: {multi word label}[url].
-
-9. Method parameter lists are extracted and displayed with
- the method description. If a method calls +yield+, then
- the parameters passed to yield will also be displayed:
-
- def fred
- ...
- yield line, address
-
- This will get documented as
-
- fred() { |line, address| ... }
-
- You can override this using a comment containing
- ':yields: ...' immediately after the method definition
-
- def fred # :yields: index, position
- ...
- yield line, address
-
- which will get documented as
-
- fred() { |index, position| ... }
-
-
-10. ':yields:' is an example of a documentation modifier. These appear
- immediately after the start of the document element they are modifying.
- Other modifiers include
-
- [:nodoc:[all]]
- don't include this element in the documentation. For classes
- and modules, the methods, aliases, constants, and attributes
- directly within the affected class or module will also be
- omitted. By default, though, modules and classes within that
- class of module _will_ be documented. This is turned off by
- adding the +all+ modifier.
-
- module SM #:nodoc:
- class Input
- end
- end
- module Markup #:nodoc: all
- class Output
- end
- end
-
- In the above code, only class SM::Input will be
- documented.
-
- [:doc:]
- force a method or attribute to be documented even if it
- wouldn't otherwise be. Useful if, for example, you want to
- include documentation of a particular private method.
-
- [:notnew:]
- only applicable to the +initialize+ instance method. Normally
- RDoc assumes that the documentation and parameters for
- #initialize are actually for the ::new method, and so fakes
- out a ::new for the class. THe :notnew: modifier stops
- this. Remember that #initialize is protected, so you won't
- see the documentation unless you use the -a command line
- option.
-
-
-11. RDoc stops processing comments if it finds a comment
- line containing '#--'. This can be used to
- separate external from internal comments, or
- to stop a comment being associated with a method,
- class, or module. Commenting can be turned back on with
- a line that starts '#++'.
-
- # Extract the age and calculate the
- # date-of-birth.
- #--
- # FIXME: fails if the birthday falls on
- # February 29th
- #++
- # The DOB is returned as a Time object.
-
- def get_dob(person)
- ...
-
-12. Comment blocks can contain other directives:
-
- [:section: title]
- Starts a new section in the output. The title following
- :section: is used as the section heading, and the
- remainder of the comment containing the section is used as
- introductory text. Subsequent methods, aliases, attributes,
- and classes will be documented in this section. A :section:
- comment block may have one or more lines before the :section:
- directive. These will be removed, and any identical lines at
- the end of the block are also removed. This allows you to add
- visual cues such as
-
- # ----------------------------------------
- # :section: My Section
- # This is the section that I wrote.
- # See it glisten in the noon-day sun.
- # ----------------------------------------
-
- [call-seq:]
- lines up to the next blank line in the comment are treated as
- the method's calling sequence, overriding the
- default parsing of method parameters and yield arguments.
-
- [:include:filename]
- include the contents of the named file at this point. The
- file will be searched for in the directories listed by
- the --include option, or in the current
- directory by default. The contents of the file will be
- shifted to have the same indentation as the ':' at the
- start of the :include: directive.
-
- [:title:text]
- Sets the title for the document. Equivalent to the --title command
- line parameter. (The command line parameter overrides any :title:
- directive in the source).
-
- [:enddoc:]
- Document nothing further at the current level.
-
- [:main:name]
- Equivalent to the --main command line parameter.
-
- [:stopdoc: / :startdoc:]
- Stop and start adding new documentation elements to the
- current container. For example, if a class has a number of
- constants that you don't want to document, put a
- :stopdoc: before the first, and a
- :startdoc: after the last. If you don't specifiy a
- :startdoc: by the end of the container, disables
- documentation for the entire class or module.
-
-
----
-
-See also markup/simple_markup.rb.
-
-= Other stuff
-
-Author:: Dave Thomas
-Requires:: Ruby 1.8.1 or later
-License:: Copyright (c) 2001-2003 Dave Thomas.
- Released under the same license as Ruby.
-
-== Warranty
-
-This software is provided "as is" and without any express or
-implied warranties, including, without limitation, the implied
-warranties of merchantibility and fitness for a particular
-purpose.
+See README.ja (Sorry, JAPANESE only)
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/README.ja ../rdoc-dennou-20060118/README.ja
--- ruby-1.8.4/lib/rdoc/README.ja 1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-dennou-20060118/README.ja 2006-01-18 03:08:25.000000000 +0900
@@ -0,0 +1,282 @@
+= RDOC Fortran90/95 ソースコード解析機能強化版 (地球流体電脳倶楽部 dcmodel プロジェクト用)
+
+RDOC の Fortran90/95 ソースコード解析機能を強化するためのパッチを
+配布しています. パッチを当てたパッケージも配布しています.
+詳しくは, このページの最下部の「沿革」を参照してください.
+
+== 動作確認
+
+このパッケージは Ruby 1.8.2 での動作を確認しています.
+
+== ダウンロード
+
+最新版 (バージョン $Name: rdoc-dennou-20060118 $)
+
+* {Ruby 1.8.4 用のパッチ}[http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/rdoc-dennou-patch_for_ruby1.8.4]
+
+* {rdoc-dennou tar.gz パッケージ (Ruby 1.8.4 に上記パッチを当てて tar ボールにしたもの)}[http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/rdoc-dennou.tgz]
+
+過去のアーカイブ
+
+* {パッチ ・ TGZ パッケージ ・ ソースツリーのリスト}[http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/arch/SIGEN.htm]
+
+== パッチの利用法
+
+まず, {Ruby のホームページ}[http://www.ruby-lang.org/] から
+ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.4.tar.gz
+をダウンロードし, 展開してください.
+
+ % tar xvfz ruby-1.8.4.tar.gz
+
+このコマンドを実行したディレクトリに上記のパッチファイル
+rdoc-dennou-patch_for_ruby1.8.4 を置き, 以下のコマンドでパッチを
+当ててください.
+
+ % patch -p0 < rdoc-dennou-patch_for_ruby1.8.4
+
+Ruby 自体のインストール方法は{Ruby のホームページ}[http://www.ruby-lang.org/]
+を参照してください.
+
+
+== パッケージのインストール
+
+rdoc-dennou.tgz パッケージをダウンロードした場合は,
+以下のように tar コマンドで展開後,
+install.rb でインストールを行ってください.
+既に rdoc がインストールされている場合, 上書きする可能性があります.
+
+ % tar xvfz rdoc-dennou.tgz
+ % cd rdoc-dennou
+ % ruby install.rb
+
+インストール先のディレクトリや, 変更のためのオプションに関しては,
+以下のコマンドで知ることが出来ます.
+
+ % ruby install.rb --help
+
+== 使用方法
+
+実行プログラムがインストールされた場所を環境変数 *PATH*
+に設定し, ライブラリがインストールされた場所を環境変数 *RUBYLIB*
+に設定してください.
+
+Fortran95 ファイルが置いてあるディレクトリまで移動し, 以下のコマンドを
+実行してください. *doc* ディレクトリ以下にドキュメントが作成されます.
+
+ % rdoc --ignore-case --charset euc-jp --inline-source
+
+複数のディレクトリに置かれているファイルに
+関してドキュメントを作成したい場合は, それらのディレクトリの
+親ディレクトリで上記のコマンドを実行してください.
+拡張子が +rb+, +rbw+ のファイルは Ruby プログラムとして,
+拡張子が +c+, +cc+, +cpp+, +CC+, +cxx+ のファイルは C プログラムとして,
+拡張子が f90, F90, f95, F95
+のファイルは Fortran95 プログラムと判定されて解析されます.
+
+*doc* ディレクトリ以外に出力したい場合は, 以下のように
+--op オプションをつけてください. タイトルなどは
+--title オプションで変更できます.
+また, デフォルトでは Fortran95 の private 属性のサブルーチンや関数
+などはドキュメントに出力されませんが, --all オプションを
+つけることで, 全てがドキュメントに出力されます. 開発者用には
+こちらの方が良いかもしれません. 一部のファイルのみを
+ドキュメント化したい場合は, 引数に src/*.f90 などと
+ファイル名を明示的に指定してください.
+
+ % rdoc --ignore-case --charset euc-jp --inline-source \
+ --op rdoc --title "RDOC documentations" src/*.f90 test/*.f90
+
+詳しいことは
+RDOC オリジナルの
+README[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+を参照ください.
+
+
+=== 電脳サーバでの利用について
+
+電脳サーバにはこのパッケージの最新版がインストールされています.
+インストール先は dcmodel 領域なので,
+以下のようにパスを通して実行してください.
+
+ % RUBYLIB=/GFD_Dennou_Club/ftp/arch/dcmodel/lib/ruby/1.8 \
+ /GFD_Dennou_Club/ftp/arch/dcmodel/bin/rdoc \
+ --ignore-case --charset euc-jp --inline-source
+
+
+== 書法
+
+parsers/parse_f95.rb を参照ください.
+ただし, ここに記述されるのは Fortran95 に特有な部分なので,
+一般的な部分に関しては
+{RDOC のオリジナルの README}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+を参照ください.
+大林さんによる日本語訳が http://www.kmc.gr.jp/~ohai/rdoc.ja.html にあります.
+
+== サンプル
+
+* {惑星大気モデル DCPAM のコードリファレンス (製作中)}[http://www.gfd-dennou.org/library/dcpam/dcpam3/dcpam3_current/doc/code_reference/htm]
+
+== ライセンス
+
+本家 RDOC に準拠します.
+{RDOC オリジナルの README}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+を参照ください.
+
+== 動作保障に関して
+
+本家 RDOC に準拠します.
+{RDOC オリジナルの README}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+を参照ください.
+
+
+== 沿革
+
+ここで配布するパッチまたはパッケージは RDOC を主に
+Fortran95 のパーサとして利用するため
+に改変したものです. 元々 Fortran95 パーサは, RDOC の開発者である
+Dave Thomas 氏によって 2003-12-01 に parse_f95.rb として作成され,
+以降数度の改変がなされました. RDOC は Ruby CVS リポジトリ
+http://www.ruby-lang.org/ja/20020106.html にて開発されており,
+この parse_f95.rb も同様です. 2005/10/05 現在の最新版は revision 1.2
+で 2004-01-02 に最終更新されたものです.
+http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/lib/rdoc/parsers/parse_f95.rb
+で詳しい情報を参照できます.
+なお, Ruby ライブラリのドキュメントは RDOC 形式で
+http://www.ruby-doc.org/stdlib/ に公開されています.
+RDOC に関してはオリジナルの
+README[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+を参照ください.
+
+本パッケージ内の parsers/parse_f95.rb は, 上記の
+revision 1.2 parse_f95.rb を改変したものです. オリジナルに比べ
+Fortran95 ソースの解析機能が大幅に向上しています.
+(きっとバグも増えていますが).
+RDOC 用に Fortran95 のコメントの記述の方法については
+parsers/parse_f95.rb を参照してください.
+
+さらに, parsers/parse_f95.rb 以外のファイルも, Fortran95 ソースから
+マニュアルを自動生成するのに必要となるであろう以下の機能を付加しています.
+これらも, 2005/10/05 時点の最新版を元に改変しています.
+
+--ignore-case オプションの追加 ::
+ Fortran 95 規格では大文字小文字の区別が無いため,
+ モジュール名, サブルーチン名, 関数名, 定数名, 変数名など,
+ 大文字小文字の区別を行う必要がありません.
+ オリジナルの rdoc はクラス名やメソッド名のクロスリファレンスの際に
+ 大文字小文字を区別しますが, このオプションを与えることにより,
+ その区別を行わないようにします.
+
+ファイルのクロスリファレンス ::
+ クラスやモジュール, メソッドと同様に, ファイル名に関しても
+ クロスリファレンスを可能にしました.
+
+--
+# 以降は Fortran とは関係の無い改変
+#
+#Ruby ライブラリ IRB::SLex の読み込みについて ::
+# Ruby 1.8.2 でも動作するよう, 最新の parse_rb.rb を1つ以前の
+# バージョンに戻しています.
+#
+#
+#拡張子cxxも C パーサで解釈 ::
+# これは全く Fortran95 とは関係ありません.
+# この拡張子 cxx は c++ ファイルから
+# SWIG[http://swig.shibu.jp/] によって作成されるファイルの拡張子です.
+++
+
+
+今後, これらの改変は可能な範囲で Ruby CVS リポジトリ へとフィードバック
+しようと考えています.
+(2005/11/15 現在, メンテナの Ryan Davis さんに英語版のパッチを
+送ったところです).
+
+== 連絡先
+
+{数値モデリングプロジェクト dcmodel}[http://www.gfd-dennou.org/library/dcmodel/]
+のページ末尾を参照ください.
+
+== 使用上の注意
+
+RDOC Fortran90/95 ソースコード解析機能強化版のパッチもしくはパッケージ
+(以下, 本パッチもしくはパッケージ) は
+研究・教育の場で用いられることを前提としております. 教育現場においては
+自由に使用・改変・再配布していただいて結構です. 利用する場合には
+{本家 RDOC のライセンス}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+に従って頂くようお願いします.
+
+本パッチもしくはパッケージを利用して得られた科学技術的成果を
+論文や Web 等にて発表する際には, その旨を記し, リファレンスに挙げて
+頂きますようお願いします.
+
+* 引用例 (和文)
+
+ 森川 靖大, 石渡 正樹, 堀之内 武, 小高 正嗣, 林 祥介,
+ 数値モデリングプロジェクト dcmodel, 2005:
+ RDOC Fortran90/95 ソースコード解析機能強化版,
+ http://www.gfd-dennou.org/library/dcmodel/, 地球流体電脳倶楽部.
+
+* 引用例 (英文)
+
+ Morikawa,Y., Ishiwatari,M., Horinouchi,T., Odaka,M., Hayashi,Y.-Y.,
+ dcmodel: Numerical Model Porject, 2005:
+ Enhanced version of RDOC Fortran90/95 parser,
+ http://www.gfd-dennou.org/library/dcmodel/, GFD Dennou Club.
+
+== 履歴
+
+==== 2006/01/18
+* サブルーチン, 関数の引数の情報をコメントとして出力する際の書式を
+ 少しだけ修正.
+
+ * 引数情報をコメントに出力する際, 引数の後ろに空白を挿入した.
+ これにより, メソッドの並び替えを行う際 (メソッドはメソッド名,
+ 引数, コメントの順に大きさを比較し, 並べる順序を決める),
+ "args" が "args(:)" よりも前に来るようになる.
+
+* 本家 Ruby の CVS リポジトリ内の更新を受け, 最新版をこちらの
+ パッケージ版にも移植.
+
+==== 2005/12/28
+* ruby 1.8.4 のリリースに伴い, パッチを 1.8.4 用に変更.
+
+==== 2005/12/17
+
+* 同名の手続き同士で公開・非公開属性を誤って設定してしまうバグを修正.
+* 以下のバグを修正
+ * program, module, subroutine, function の end 文は必ず
+ end program, end module, end subroutine, end function のように
+ 記述しないと, 書法を正しく解析出来ない.
+ * program 〜 end program 文の, 最初と最後の program という文字を
+ 省略した場合, program 文の内部で定義されるものは全て public だと
+ 認識される.
+ * ";" の文字をコメント内でも改行に変換してしまう
+* !-- 〜 !++ によるコメント削除の指定の際に, "!" よりも前に空白を
+ 含んでよいように修正.
+* interface 文で指定される外部手続きの解析を修正.
+* 継続行の扱いを修正.
+
+==== 2005/12/13
+
+* parsers/parse_f95.rb に注意事項と Todo を追加.
+* 「サンプル」を追加.
+* public, private 文を解析する部分のバグを修正.
+
+==== 2005/12/08
+
+* 「使用上の注意」, 「連絡先」を追加.
+* 公開アドレスを
+ http://www.gfd-dennou.org/library/dcmodel/doc/rdoc-dennou/ から
+ http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/ へ変更.
+ (過去の URL もしばらく残しておきます).
+
+==== 2005/11/28
+
+* ":nodoc:" の指定を可能にする.
+* サブルーチンや関数内の "contains" 文の処理方法を修正する.
+* 表題を変更する.
+* 過去のバージョンを公開する.
+
+==== 2005/11/17
+
+* 一通り欲しい機能が揃い, ドキュメントのチェックも行ったので,
+ タグをつけて公開する.
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/README.org ../rdoc-dennou-20060118/README.org
--- ruby-1.8.4/lib/rdoc/README.org 1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-dennou-20060118/README.org 2005-11-28 15:19:21.000000000 +0900
@@ -0,0 +1,502 @@
+= RDOC - Ruby Documentation System
+
+== Annotation
+
+This is copy from RDOC original
+README[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+
+See README.ja (Sorry, JAPANESE only)
+
+== Overview
+
+This package contains Rdoc and SimpleMarkup. Rdoc is an application
+that produces documentation for one or more Ruby source files. We work
+similarly to JavaDoc, parsing the source, and extracting the
+definition for classes, modules, and methods (along with includes and
+requires). We associate with these optional documentation contained
+in the immediately preceding comment block, and then render the result
+using a pluggable output formatter. (Currently, HTML is the only
+supported format. Markup is a library that converts plain text into
+various output formats. The Markup library is used to interpret the
+comment blocks that Rdoc uses to document methods, classes, and so on.
+
+This library contains two packages, rdoc itself and a text markup
+library, 'markup'.
+
+== Roadmap
+
+* If you want to use Rdoc to create documentation for your Ruby source
+ files, read on.
+* If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
+* For information on the various markups available in comment
+ blocks, see markup/simple_markup.rb.
+* If you want to drive Rdoc programatically, see RDoc::RDoc.
+* If you want to use the library to format text blocks into HTML,
+ have a look at SM::SimpleMarkup.
+* If you want to try writing your own HTML output template, see
+ RDoc::Page.
+
+== Summary
+
+Once installed, you can create documentation using the 'rdoc' command
+(the command is 'rdoc.bat' under Windows)
+
+ % rdoc [options] [names...]
+
+Type "rdoc --help" for an up-to-date option summary.
+
+A typical use might be to generate documentation for a package of Ruby
+source (such as rdoc itself).
+
+ % rdoc
+
+This command generates documentation for all the Ruby and C source
+files in and below the current directory. These will be stored in a
+documentation tree starting in the subdirectory 'doc'.
+
+You can make this slightly more useful for your readers by having the
+index page contain the documentation for the primary file. In our
+case, we could type
+
+ % rdoc --main rdoc/rdoc.rb
+
+You'll find information on the various formatting tricks you can use
+in comment blocks in the documentation this generates.
+
+RDoc uses file extensions to determine how to process each file. File
+names ending .rb and .rbw are assumed to be Ruby
+source. Files ending .c are parsed as C files. All other
+files are assumed to contain just SimpleMarkup-style markup (with or
+without leading '#' comment markers). If directory names are passed to
+RDoc, they are scanned recursively for C and Ruby source files only.
+
+== Credits
+
+* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
+ work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
+ parser for irb and the rtags package.
+
+* Code to diagram classes and modules was written by Sergey A Yanovitsky
+ (Jah) of Enticla.
+
+* Charset patch from MoonWolf.
+
+* Rich Kilmer wrote the kilmer.rb output template.
+
+* Dan Brickley led the design of the RDF format.
+
+== License
+
+RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers. It
+is free software, and may be redistributed under the terms specified
+in the README file of the Ruby distribution.
+
+
+= Usage
+
+RDoc is invoked from the command line using:
+
+ % rdoc [name...]
+
+Files are parsed, and the information they contain collected, before
+any output is produced. This allows cross references between all files
+to be resolved. If a name is a directory, it is traversed. If no
+names are specified, all Ruby files in the current directory (and
+subdirectories) are processed.
+
+Options are:
+
+[--accessorname[,name...]]
+ specifies the name(s) of additional methods that should be treated
+ as if they were attr_xxx methods. Specifying
+ "--accessor db_opt" means lines such as
+
+ db_opt :name, :age
+
+ will get parsed and displayed in the documentation. Each name may have an
+ optional "=flagtext" appended, in which case the given flagtext will appear
+ where (for example) the 'rw' appears for attr_accessor.
+
+[--all]
+ include protected and private methods in the output (by default
+ only public methods are included)
+
+[--charset _charset_]
+ Set the character set for the generated HTML.
+
+[--diagram]
+ include diagrams showing modules and classes. This is currently
+ an experimental feature, and may not be supported by all output
+ templates. You need dot V1.8.6 or later to use the --diagram
+ option correctly (http://www.research.att.com/sw/tools/graphviz/).
+
+[--excludepattern]
+ exclude files and directories matching this pattern from processing
+
+[--extensionnew=old]
+ treat files ending .new as if they ended
+ .old. Saying '--extension cgi=rb' causes RDoc to treat .cgi
+ files as Ruby source.
+
+[fileboxes]
+ Classes are put in boxes which represents files, where these
+ classes reside. Classes shared between more than one file are
+ shown with list of files that sharing them. Silently discarded if
+ --diagram is not given Experimental.
+
+[--fmt _fmt_]
+ generate output in a particular format.
+
+[--help]
+ generate a usage summary.
+
+[--help-output]
+ explain the various output options.
+
+[--ignore-case]
+ The case of names of classes or modules or methods are ignored.
+
+[--image-formatgif/png/jpg/jpeg]
+ sets output image format for diagrams. Can be png, gif, jpeg,
+ jpg. If this option is omitted, png is used. Requires --diagram.
+
+[--includedir,...]
+ specify one or more directories to be searched when satisfying
+ :+include+: directives. Multiple --include options may be
+ given. The directory containing the file currently being processed
+ is always searched.
+
+[--inline-source]
+ By default, the source code of methods is shown in a popup. With
+ this option, it's displayed inline.
+
+[line-numbers]
+ include line numbers in the source code
+
+[--main _name_]
+ the class of module _name_ will appear on the index page. If you
+ want to set a particular file as a main page (a README, for
+ example) simply specifiy its name as the first on the command
+ line.
+
+[--merge]
+ when generating _ri_ output, if classes being processed already
+ exist in the destination directory, merge in the current details
+ rather than overwrite them.
+
+[--one-file]
+ place all the output into a single file
+
+[--op _dir_]
+ set the output directory to _dir_ (the default is the directory
+ "doc")
+
+[--op-name _name_]
+ set the name of the output. Has no effect for HTML.
+ "doc")
+
+[--opname _name_]
+ set the output name (has no effect for HTML).
+
+[--promiscuous]
+ If a module or class is defined in more than one source file, and
+ you click on a particular file's name in the top navigation pane,
+ RDoc will normally only show you the inner classes and modules of
+ that class that are defined in the particular file. Using this
+ option makes it show all classes and modules defined in the class,
+ regardless of the file they were defined in.
+
+[--quiet]
+ do not display progress messages
+
+[--ri, --ri-site, _and_ --ri-system]
+ generate output than can be read by the _ri_ command-line tool.
+ By default --ri places its output in ~/.rdoc, --ri-site in
+ $datadir/ri//site, and --ri-system in
+ $datadir/ri//system. All can be overridden with a subsequent
+ --op option. All default directories are in ri's default search
+ path.
+
+[--show-hash]
+ A name of the form #name in a comment is a possible hyperlink to
+ an instance method name. When displayed, the '#' is removed unless
+ this option is specified
+
+[--stylestylesheet url]
+ specifies the URL of an external stylesheet to use (rather than
+ generating one of our own)
+
+[tab-width _n_]
+ set the width of tab characters (default 8)
+
+[--templatename]
+ specify an alternate template to use when generating output (the
+ default is 'standard'). This template should be in a directory
+ accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
+ depends on the output formatter.
+
+[--version]
+ display RDoc's version
+
+[--webcvs _url_]
+ Specify a URL for linking to a web frontend to CVS. If the URL
+ contains a '\%s', the name of the current file will be
+ substituted; if the URL doesn't contain a '\%s', the filename will
+ be appended to it.
+
+= Example
+
+A typical small Ruby program commented using RDoc might be as follows. You
+can see the formatted result in EXAMPLE.rb and Anagram.
+
+ :include: EXAMPLE.rb
+
+= Markup
+
+Comment blocks can be written fairly naturally, either using '#' on
+successive lines of the comment, or by including the comment in
+an =begin/=end block. If you use the latter form, the =begin line
+must be flagged with an RDoc tag:
+
+ =begin rdoc
+ Documentation to
+ be processed by RDoc.
+ =end
+
+Paragraphs are lines that share the left margin. Text indented past
+this margin are formatted verbatim.
+
+1. Lists are typed as indented paragraphs with:
+ * a '*' or '-' (for bullet lists)
+ * a digit followed by a period for
+ numbered lists
+ * an upper or lower case letter followed
+ by a period for alpha lists.
+
+ For example, the input that produced the above paragraph looked like
+ 1. Lists are typed as indented
+ paragraphs with:
+ * a '*' or '-' (for bullet lists)
+ * a digit followed by a period for
+ numbered lists
+ * an upper or lower case letter followed
+ by a period for alpha lists.
+
+2. Labeled lists (sometimes called description
+ lists) are typed using square brackets for the label.
+ [cat] small domestic animal
+ [+cat+] command to copy standard input
+
+3. Labeled lists may also be produced by putting a double colon
+ after the label. This sets the result in tabular form, so the
+ descriptions all line up. This was used to create the 'author'
+ block at the bottom of this description.
+ cat:: small domestic animal
+ +cat+:: command to copy standard input
+
+ For both kinds of labeled lists, if the body text starts on the same
+ line as the label, then the start of that text determines the block
+ indent for the rest of the body. The text may also start on the line
+ following the label, indented from the start of the label. This is
+ often preferable if the label is long. Both the following are
+ valid labeled list entries:
+
+ --outputname [, name]::
+ specify the name of one or more output files. If multiple
+ files are present, the first is used as the index.
+
+ --quiet::: do not output the names, sizes, byte counts,
+ index areas, or bit ratios of units as
+ they are processed.
+
+4. Headings are entered using equals signs
+
+ = Level One Heading
+ == Level Two Heading
+ and so on
+
+5. Rules (horizontal lines) are entered using three or
+ more hyphens.
+
+6. Non-verbatim text can be marked up:
+
+ _italic_:: \_word_ or \text
+ *bold*:: \*word* or \text
+ +typewriter+:: \+word+ or \text
+
+ The first form only works around 'words', where a word is a
+ sequence of upper and lower case letters and underscores. Putting a
+ backslash before inline markup stops it being interpreted, which is
+ how I created the table above:
+
+ _italic_:: \_word_ or \text
+ *bold*:: \*word* or \text
+ +typewriter+:: \+word+ or \text
+
+7. Names of classes, source files, and any method names
+ containing an underscore or preceded by a hash
+ character are automatically hyperlinked from
+ comment text to their description.
+
+8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
+ recognized. An HTTP url that references an external image file is
+ converted into an inline . Hyperlinks starting 'link:' are
+ assumed to refer to local files whose path is relative to the --op
+ directory.
+
+ Hyperlinks can also be of the form label[url], in which
+ case the label is used in the displayed text, and url is
+ used as the target. If label contains multiple words,
+ put it in braces: {multi word label}[url].
+
+9. Method parameter lists are extracted and displayed with
+ the method description. If a method calls +yield+, then
+ the parameters passed to yield will also be displayed:
+
+ def fred
+ ...
+ yield line, address
+
+ This will get documented as
+
+ fred() { |line, address| ... }
+
+ You can override this using a comment containing
+ ':yields: ...' immediately after the method definition
+
+ def fred # :yields: index, position
+ ...
+ yield line, address
+
+ which will get documented as
+
+ fred() { |index, position| ... }
+
+
+10. ':yields:' is an example of a documentation modifier. These appear
+ immediately after the start of the document element they are modifying.
+ Other modifiers include
+
+ [:nodoc:[all]]
+ don't include this element in the documentation. For classes
+ and modules, the methods, aliases, constants, and attributes
+ directly within the affected class or module will also be
+ omitted. By default, though, modules and classes within that
+ class of module _will_ be documented. This is turned off by
+ adding the +all+ modifier.
+
+ module SM #:nodoc:
+ class Input
+ end
+ end
+ module Markup #:nodoc: all
+ class Output
+ end
+ end
+
+ In the above code, only class SM::Input will be
+ documented.
+
+ [:doc:]
+ force a method or attribute to be documented even if it
+ wouldn't otherwise be. Useful if, for example, you want to
+ include documentation of a particular private method.
+
+ [:notnew:]
+ only applicable to the +initialize+ instance method. Normally
+ RDoc assumes that the documentation and parameters for
+ #initialize are actually for the ::new method, and so fakes
+ out a ::new for the class. THe :notnew: modifier stops
+ this. Remember that #initialize is protected, so you won't
+ see the documentation unless you use the -a command line
+ option.
+
+
+11. RDoc stops processing comments if it finds a comment
+ line containing '#--'. This can be used to
+ separate external from internal comments, or
+ to stop a comment being associated with a method,
+ class, or module. Commenting can be turned back on with
+ a line that starts '#++'.
+
+ # Extract the age and calculate the
+ # date-of-birth.
+ #--
+ # FIXME: fails if the birthday falls on
+ # February 29th
+ #++
+ # The DOB is returned as a Time object.
+
+ def get_dob(person)
+ ...
+
+12. Comment blocks can contain other directives:
+
+ [:section: title]
+ Starts a new section in the output. The title following
+ :section: is used as the section heading, and the
+ remainder of the comment containing the section is used as
+ introductory text. Subsequent methods, aliases, attributes,
+ and classes will be documented in this section. A :section:
+ comment block may have one or more lines before the :section:
+ directive. These will be removed, and any identical lines at
+ the end of the block are also removed. This allows you to add
+ visual cues such as
+
+ # ----------------------------------------
+ # :section: My Section
+ # This is the section that I wrote.
+ # See it glisten in the noon-day sun.
+ # ----------------------------------------
+
+ [call-seq:]
+ lines up to the next blank line in the comment are treated as
+ the method's calling sequence, overriding the
+ default parsing of method parameters and yield arguments.
+
+ [:include:filename]
+ include the contents of the named file at this point. The
+ file will be searched for in the directories listed by
+ the --include option, or in the current
+ directory by default. The contents of the file will be
+ shifted to have the same indentation as the ':' at the
+ start of the :include: directive.
+
+ [:title:text]
+ Sets the title for the document. Equivalent to the --title command
+ line parameter. (The command line parameter overrides any :title:
+ directive in the source).
+
+ [:enddoc:]
+ Document nothing further at the current level.
+
+ [:main:name]
+ Equivalent to the --main command line parameter.
+
+ [:stopdoc: / :startdoc:]
+ Stop and start adding new documentation elements to the
+ current container. For example, if a class has a number of
+ constants that you don't want to document, put a
+ :stopdoc: before the first, and a
+ :startdoc: after the last. If you don't specifiy a
+ :startdoc: by the end of the container, disables
+ documentation for the entire class or module.
+
+
+---
+
+See also markup/simple_markup.rb.
+
+= Other stuff
+
+Author:: Dave Thomas
+Requires:: Ruby 1.8.1 or later
+License:: Copyright (c) 2001-2003 Dave Thomas.
+ Released under the same license as Ruby.
+
+== Warranty
+
+This software is provided "as is" and without any express or
+implied warranties, including, without limitation, the implied
+warranties of merchantibility and fitness for a particular
+purpose.
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/code_objects.rb ../rdoc-dennou-20060118/code_objects.rb
--- ruby-1.8.4/lib/rdoc/code_objects.rb 2004-12-04 14:38:15.000000000 +0900
+++ ../rdoc-dennou-20060118/code_objects.rb 2005-12-16 09:29:36.000000000 +0900
@@ -235,8 +235,12 @@
end
def add_method(a_method)
- puts "Adding #@visibility method #{a_method.name} to #@name" if $DEBUG
- a_method.visibility = @visibility
+ if !(a_method.visibility == :public) &&
+ !(a_method.visibility == :private) &&
+ !(a_method.visibility == :protected)
+ a_method.visibility = @visibility
+ end
+ puts "Adding #{a_method.visibility} method #{a_method.name} to #@name" if $DEBUG
add_to(@method_list, a_method)
end
@@ -244,8 +248,8 @@
add_to(@attributes, an_attribute)
end
- def add_alias(an_alias)
- meth = find_instance_method_named(an_alias.old_name)
+ def add_alias(an_alias, ignore_case=nil)
+ meth = find_instance_method_named(an_alias.old_name, ignore_case)
if meth
new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
new_meth.is_alias_for = meth
@@ -325,16 +329,34 @@
end
# Find a named module
- def find_module_named(name)
- return self if self.name == name
- res = @modules[name] || @classes[name]
+ def find_module_named(name, ignore_case=nil)
+ res = nil
+ if !ignore_case
+ return self if self.name == name
+ else
+ return self if self.name.upcase == name.upcase
+ end
+ if !ignore_case
+ res = @modules[name] || @classes[name]
+ else
+ @modules.each{ |n, v|
+ if n.upcase == name.upcase
+ res = v ; break
+ end
+ }
+ @classes.each{ |n, v|
+ if n.upcase == name.upcase
+ res = v ; break
+ end
+ } if !res
+ end
return res if res
- find_enclosing_module_named(name)
+ find_enclosing_module_named(name, ignore_case)
end
# find a module at a higher scope
- def find_enclosing_module_named(name)
- parent && parent.find_module_named(name)
+ def find_enclosing_module_named(name, ignore_case=nil)
+ parent && parent.find_module_named(name, ignore_case)
end
# Iterate over all the classes and modules in
@@ -357,6 +379,10 @@
@constants.each {|c| yield c}
end
+ def each_includes
+ @includes.each {|i| yield i}
+ end
+
# Return the toplevel that owns us
def toplevel
@@ -371,22 +397,27 @@
name <=> other.name
end
+ # Look up the given filename.
+ def find_file(file, method=nil, ignore_case=nil)
+ find_file_named(file, method, ignore_case)
+ end
+
# Look up the given symbol. If method is non-nil, then
# we assume the symbol references a module that
# contains that method
- def find_symbol(symbol, method=nil)
+ def find_symbol(symbol, method=nil, ignore_case=nil)
result = nil
case symbol
when /^::(.*)/
- result = toplevel.find_symbol($1)
+ result = toplevel.find_symbol($1, nil, ignore_case)
when /::/
modules = symbol.split(/::/)
unless modules.empty?
module_name = modules.shift
- result = find_module_named(module_name)
+ result = find_module_named(module_name, ignore_case)
if result
modules.each do |module_name|
- result = result.find_module_named(module_name)
+ result = result.find_module_named(module_name, ignore_case)
break unless result
end
end
@@ -395,11 +426,12 @@
# if a method is specified, then we're definitely looking for
# a module, otherwise it could be any symbol
if method
- result = find_module_named(symbol)
+ result = find_module_named(symbol, ignore_case)
else
- result = find_local_symbol(symbol)
+ result = find_local_symbol(symbol, ignore_case)
if result.nil?
- if symbol =~ /^[A-Z]/
+ if symbol =~ /^[A-Z]/ ||
+ symbol =~ /^[A-Za-z]/ && ignore_case
result = parent
while result && result.name != symbol
result = result.parent
@@ -414,16 +446,40 @@
p method
fail
end
- result = result.find_local_symbol(method)
+ result = result.find_local_symbol(method, ignore_case)
end
result
end
-
- def find_local_symbol(symbol)
- res = find_method_named(symbol) ||
- find_constant_named(symbol) ||
- find_attribute_named(symbol) ||
- find_module_named(symbol)
+
+ def find_local_symbol(symbol, ignore_case=nil)
+ res = find_method_named(symbol, ignore_case) ||
+ find_constant_named(symbol, ignore_case) ||
+ find_attribute_named(symbol, ignore_case) ||
+ find_module_named(symbol, ignore_case)
+ end
+
+ def include_requires?(name, ignore_case=nil)
+ if self.kind_of? TopLevel
+ self.requires.each{|r|
+ if r.name == name ||
+ r.name.upcase == name.upcase && ignore_case
+ return true
+ end
+ }
+ return false
+ else
+ parent.include_requires?(name)
+ end
+ end
+
+ def include_includes?(name, ignore_case=nil)
+ self.includes.each{|i|
+ if i.name == name ||
+ i.name.upcase == name.upcase && ignore_case
+ return true
+ end
+ }
+ return false
end
# Handle sections
@@ -436,25 +492,43 @@
private
# Find a named method, or return nil
- def find_method_named(name)
- @method_list.find {|meth| meth.name == name}
+ def find_method_named(name, ignore_case=nil)
+ if !ignore_case
+ @method_list.find {|meth| meth.name == name}
+ else
+ @method_list.find {|meth| meth.name.upcase == name.upcase}
+ end
end
# Find a named instance method, or return nil
- def find_instance_method_named(name)
- @method_list.find {|meth| meth.name == name && !meth.singleton}
+ def find_instance_method_named(name, ignore_case=nil)
+ if !ignore_case
+ @method_list.find {|meth| meth.name == name && !meth.singleton}
+ else
+ @method_list.find {|meth|
+ meth.name.upcase == name.upcase && !meth.singleton
+ }
+ end
end
# Find a named constant, or return nil
- def find_constant_named(name)
- @constants.find {|m| m.name == name}
+ def find_constant_named(name, ignore_case=nil)
+ if !ignore_case
+ @constants.find {|m| m.name == name}
+ else
+ @constants.find {|m| m.name.upcase == name.upcase}
+ end
end
# Find a named attribute, or return nil
- def find_attribute_named(name)
- @attributes.find {|m| m.name == name}
+ def find_attribute_named(name, ignore_case=nil)
+ if !ignore_case
+ @attributes.find {|m| m.name == name}
+ else
+ @attributes.find {|m| m.name.upcase == name.upcase}
+ end
end
-
+
end
@@ -465,13 +539,15 @@
attr_accessor :file_relative_name
attr_accessor :file_absolute_name
attr_accessor :diagram
-
+
@@all_classes = {}
@@all_modules = {}
+ @@all_files = {}
def TopLevel::reset
@@all_classes = {}
@@all_modules = {}
+ @@all_files = {}
end
def initialize(file_name)
@@ -481,6 +557,7 @@
@file_absolute_name = file_name
@file_stat = File.stat(file_name)
@diagram = nil
+ @@all_files[file_name] = self
end
def full_name
@@ -519,6 +596,10 @@
@@all_classes.values + @@all_modules.values
end
+ def TopLevel.all_files
+ @@all_files
+ end
+
def TopLevel.find_class_named(name)
@@all_classes.each_value do |c|
res = c.find_class_named(name)
@@ -527,21 +608,50 @@
nil
end
- def find_local_symbol(symbol)
- find_class_or_module_named(symbol) || super
+ def find_local_symbol(symbol, ignore_case=nil)
+ find_class_or_module_named(symbol, ignore_case) || super
end
- def find_class_or_module_named(symbol)
- @@all_classes.each_value {|c| return c if c.name == symbol}
- @@all_modules.each_value {|m| return m if m.name == symbol}
+ def find_class_or_module_named(symbol, ignore_case=nil)
+ if !ignore_case
+ @@all_classes.each_value {|c| return c if c.name == symbol}
+ @@all_modules.each_value {|m| return m if m.name == symbol}
+ else
+ @@all_classes.each_value {|c| return c if c.name.upcase == symbol.upcase}
+ @@all_modules.each_value {|m| return m if m.name.upcase == symbol.upcase}
+ end
nil
end
# Find a named module
- def find_module_named(name)
- find_class_or_module_named(name) || find_enclosing_module_named(name)
+ def find_module_named(name, ignore_case=nil)
+ find_class_or_module_named(name, ignore_case) || find_enclosing_module_named(name, ignore_case)
end
+ # Find a named file
+ def find_file_named(name, method=nil, ignore_case=nil)
+ return nil unless name
+ result = nil
+ @@all_files.each{|file_name, toplevel|
+ result = toplevel if file_name == name
+ }
+ dir = File.dirname(@file_relative_name)
+ @@all_files.each{|file_name, toplevel|
+ if /^#{dir}\/(.*)/ =~ file_name
+ result = toplevel if $1 == name
+ end
+ }
+ if result
+ if method
+ result_method = result.find_local_symbol(method, ignore_case)
+ return result_method
+ else
+ return result
+ end
+ else
+ return nil
+ end
+ end
end
@@ -593,6 +703,11 @@
@classes.each_value {|c| return c if c.find_class_named(name) }
nil
end
+
+ def find_file_named(name, method=nil, ignore_case=nil)
+ parent.find_file_named(name, method, ignore_case)
+ end
+
end
# Anonymous classes
@@ -648,7 +763,11 @@
end
def <=>(other)
- @name <=> other.name
+ t = @name <=> other.name
+ return t if t != 0
+ t = @params <=> other.params
+ return t if t != 0
+ t = @comment <=> other.comment
end
def to_s
@@ -689,7 +808,7 @@
# with a particular context
class Alias < CodeObject
attr_accessor :text, :old_name, :new_name, :comment
-
+
def initialize(text, old_name, new_name, comment)
super()
@text = text
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/diagram.rb ../rdoc-dennou-20060118/diagram.rb
--- ruby-1.8.4/lib/rdoc/diagram.rb 2004-07-17 05:27:29.000000000 +0900
+++ ../rdoc-dennou-20060118/diagram.rb 2006-01-18 03:07:08.000000000 +0900
@@ -295,7 +295,7 @@
f << graph.to_s << "\n"
end
- system "dot -T#{op_type} #{src} -o #{dot}"
+ system "dot", "-T#{op_type}", src, "-o", dot
# Now construct the imagemap wrapper around
# that png
@@ -320,13 +320,13 @@
xs, ys = [$1.to_i, $3.to_i], [$2.to_i, $4.to_i]
url, area_name = $5, $6
- res << %{ \n}
+ res << %{ \n}
end
res << "\n"
# map_file = src.sub(/.dot/, '.map')
# system("dot -Timap #{src} -o #{map_file}")
- res << %{}
+ res << %{}
return res
end
end
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/generators/chm_generator.rb ../rdoc-dennou-20060118/generators/chm_generator.rb
--- ruby-1.8.4/lib/rdoc/generators/chm_generator.rb 2003-12-01 16:12:48.000000000 +0900
+++ ../rdoc-dennou-20060118/generators/chm_generator.rb 2005-09-22 16:49:18.000000000 +0900
@@ -4,7 +4,7 @@
class CHMGenerator < HTMLGenerator
- HHC_PATH = "c:\\Program Files\\HTML Help Workshop\\hhc.exe"
+ HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
# Standard generator factory
def CHMGenerator.for(options)
@@ -103,7 +103,7 @@
# Invoke the windows help compiler to compiler the project
def compile_project
- system("\"#{HHC_PATH}\" #@project_name")
+ system(HHC_PATH, @project_name)
end
end
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/generators/html_generator.rb ../rdoc-dennou-20060118/generators/html_generator.rb
--- ruby-1.8.4/lib/rdoc/generators/html_generator.rb 2005-02-12 19:57:20.000000000 +0900
+++ ../rdoc-dennou-20060118/generators/html_generator.rb 2006-01-18 03:07:11.000000000 +0900
@@ -114,7 +114,12 @@
lookup = name
end
- if /([A-Z].*)[.\#](.*)/ =~ lookup
+ # Find class, module, or method in class or module.
+ if /([A-Z]\w*)[.\#](\w+[!?=]?)/ =~ lookup
+ container = $1
+ method = $2
+ ref = @context.find_symbol(container, method)
+ elsif /([A-Za-z]\w*)[.\#](\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?)/ =~ lookup
container = $1
method = $2
ref = @context.find_symbol(container, method)
@@ -129,6 +134,30 @@
end
end
+ #
+ # CROSSREFFILE is similar to CROSSREF. But this pattern is
+ # hit to filenames or methods in files
+ #
+ def handle_special_CROSSREFFILE(special)
+ name = special.text
+
+ # Find file, or method in file
+ if /([\w\/].*\.\w+)[.\#](.*)/ =~ name
+ file_name = $1
+ method = $2
+ ref = @context.find_file(file_name, method)
+ else
+ ref = @context.find_file(name)
+ end
+
+ if ref and ref.document_self
+ "#{name}"
+ else
+ name
+ end
+
+ end
+
# Generate a hyperlink for url, labeled with text. Handle the
# special cases for img: and link: described under handle_special_HYPEDLINK
@@ -153,7 +182,8 @@
if (type == "http" || type == "link") &&
url =~ /\.(gif|png|jpg|jpeg|bmp)$/
- ""
+ ""
+
else
"#{text.sub(%r{^#{type}:/*}, '')}"
end
@@ -206,15 +236,24 @@
unless defined? @markup
@markup = SM::SimpleMarkup.new
- # class names, variable names, file names, or instance variables
+ # class names, variable names, or instance variables
@markup.add_special(/(
- \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth
+ \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))? # A::B.meth(**) (for operator in Fortran95)
+ | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))? # meth(**) (for operator in Fortran95)
+ | \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth
| \b([A-Z]\w+(::\w+)*) # A::B..
| \#\w+[!?=]? # #meth_name
- | \b\w+([_\/\.]+\w+)+[!?=]? # meth_name
+ | \b\w+([_\/\.]+\w+)*[!?=]? # meth_name
)/x,
:CROSSREF)
+ # file names
+ @markup.add_special(/(
+ [\w\/][\w\#\/\.\-\~\:]*[!?=]? # file_name
+ | [\w\/][\w\#\/\.\-\~\:]*(\([\.\w+\*\/\+\-\=\<\>]+\))?
+ )/x,
+ :CROSSREFFILE)
+
# external hyperlinks
@markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
@@ -397,7 +436,8 @@
# end
# end
- ref = @context.find_symbol(i.name)
+ ref = @context.find_symbol(i.name, nil, @options.ignore_case) || \
+ @context.find_file(i.name)
ref = ref.viewer if ref
if !ref && block_given?
@@ -546,7 +586,17 @@
# Find a symbol in ourselves or our parent
def find_symbol(symbol, method=nil)
- res = @context.find_symbol(symbol, method)
+ res = @context.find_symbol(symbol, method, @options.ignore_case)
+ if res
+ res = res.viewer
+ end
+ res
+ end
+
+ # Find a filenames in ourselves or our parent
+ def find_file(file, method=nil)
+ res = @context.find_file(file, method,
+ @options.ignore_case)
if res
res = res.viewer
end
@@ -1110,12 +1160,22 @@
end
def find_symbol(symbol, method=nil)
- res = @context.parent.find_symbol(symbol, method)
+ res = @context.parent.find_symbol(symbol, method, @options.ignore_case)
+ if res
+ res = res.viewer
+ end
+ res
+ end
+
+ # Find a filenames in ourselves or our parent
+ def find_file(file, method=nil)
+ res = @context.parent.find_file(file, method)
if res
res = res.viewer
end
res
end
+
end
#####################################################################
diff -Nur --exclude=doc ruby-1.8.4/lib/rdoc/generators/template/html/hefss.rb ../rdoc-dennou-20060118/generators/template/html/hefss.rb
--- ruby-1.8.4/lib/rdoc/generators/template/html/hefss.rb 2003-12-01 16:12:48.000000000 +0900
+++ ../rdoc-dennou-20060118/generators/template/html/hefss.rb 2006-01-18 03:07:14.000000000 +0900
@@ -114,7 +114,7 @@
%title%
-
+