Skip to content

Commit

Permalink
Added support for rdoc generation from Rakefile, and use hanna if ava…
Browse files Browse the repository at this point in the history
…ilable

Signed-off-by: ezmobius <ez@engineyard.com>
  • Loading branch information
raggi authored and ezmobius committed Jan 29, 2009
1 parent 66c2b22 commit 78baa0c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.emacs*
pkg
*.log
rdoc
26 changes: 26 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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.