Ruby on Rails 3.0.7 を使用していますが、アプリケーションを文書化するために (デフォルトではなく) 新しい RDoc テンプレートをインストールして使用したいと考えています。
次のいずれかを選択したいと思います。
- http://api.rubyonrails.org/
- http://www.ruby-doc.org/core/
- ...あなたがアドバイスする他の人
そう、
- 上記のテンプレートはどこで入手できますか?
- どうすればそれをインストールできますか?
.rake
選択したテンプレートでドキュメントを生成するには、ファイルにどのコードを配置すればよいですか?
一言で言えば、私はこの問題の初心者です。
この時点で、Gemfile で次のように述べています。
gem "rdoc", "~> 3.6.1"
コマンドを実行しbundle install
ます。
@dmarkowの更新I
horo gemをインストールし、次のコードを my.rake
ファイルに挿入しました。
RDoc::Task.new do |rdoc|
rdoc.title = "My Awesome docs"
rdoc.rdoc_dir = 'doc'
rdoc.options << '-f' << 'horo'
rdoc.options << '--main' << 'README'
end
コマンドを実行すると、次のようrdoc -f horo --main README.rdoc *.rdoc lib ext
になります。
file '*.rdoc' not found
file 'ext' not found
uh-oh! RDoc had a problem:
Directory doc already exists, but it looks like it isn't an RDoc directory.
Because RDoc doesn't want to risk destroying any of your existing files,
you'll need to specify a different output directory name (using the --op <dir>
option)
コマンドを実行すると、次のようrake doc:app
になります。
WARNING: Deprecated reference to top-level constant 'Task' found at: <my_application_projectfolder>/Rakefile:7:in `<top (required)>'
Use --classic-namespace on rake command
or 'require "rake/classic_namespace"' in Rakefile
rake aborted!
wrong number of arguments (0 for 2)
@dmarkowのUPDATE II
doc
ディレクトリを削除しました:
コマンドを実行すると、次のようrdoc -f horo --main README.rdoc *.rdoc lib ext
になります。
file '*.rdoc' not found
file 'ext' not found
No newer files.
Files: 0
Classes: 0 (0 undocumented)
Modules: 0 (0 undocumented)
Constants: 0 (0 undocumented)
Attributes: 0 (0 undocumented)
Methods: 0 (0 undocumented)
Total: 0 (0 undocumented)
0.00% documented
ドキュメント ディレクトリにcreated.rid
ファイルを作成します。
コマンドを実行するrake doc:app
と、次の UPDATE と同じ結果になります。
私がしなければならないこと?まだgem "rdoc", "~> 3.6.1"
Gemfile に保持する必要がありますか?