Browse files

Added support for rdoc generation from Rakefile, and use hanna if ava…

…ilable

Signed-off-by: ezmobius <ez@engineyard.com>
  • Loading branch information...
1 parent 66c2b22 commit 78baa0c01a8b7977466c956f4b398761c8ba6cf0 @raggi committed with ezmobius Jan 28, 2009
Showing with 27 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +26 −0 Rakefile
View
1 .gitignore
@@ -4,3 +4,4 @@
.emacs*
pkg
*.log
+rdoc
View
26 Rakefile
@@ -1,6 +1,13 @@
require 'rubygems'
require 'rake/gempackagetask'
require "spec/rake/spectask"
+begin; require 'rubygems'; rescue LoadError; end
+begin
+ require 'hanna/rdoctask'
+rescue LoadError
+ require 'rake/rdoctask'
+end
+require 'rake/clean'
GEM = "nanite"
VER = "0.2.0"
@@ -46,3 +53,22 @@ Spec::Rake::SpecTask.new do |t|
t.spec_opts = ["--format", "specdoc", "--colour"]
t.spec_files = FileList["spec/**/*_spec.rb"]
end
+
+desc 'Generate RDoc documentation'
+Rake::RDocTask.new do |rd|
+ rd.title = spec.name
+ rd.rdoc_dir = 'rdoc'
+ rd.main = "README.rdoc"
+ rd.rdoc_files.include("lib/**/*.rb", *spec.extra_rdoc_files)
+end
+CLOBBER.include(:clobber_rdoc)
+
+desc 'Generate and open documentation'
+task :docs => :rdoc do
+ case RUBY_PLATFORM
+ when /darwin/ ; sh 'open rdoc/index.html'
+ when /mswin|mingw/ ; sh 'start rdoc\index.html'
+ else
+ sh 'firefox rdoc/index.html'
+ end
+end

0 comments on commit 78baa0c

Please sign in to comment.