more robust 'rake doc:api' under different ruby environments

In Rakefile, doc:api, fix hardcoded `hanna` call to derive the hanna
executable name from ruby_install_name. So for ruby1.9, we get hanna1.9;
for macruby, machanna; etc.

Also did away with the shell line continuation backslashes, as we're
gsubbing \s+ with ' ' anyway.
This commit is contained in:
Caio Chassot 2010-02-13 14:43:18 -02:00 committed by Ryan Tomayko
parent 171bf43341
commit 3ea36c94cf
1 changed files with 11 additions and 8 deletions

View File

@ -37,16 +37,19 @@ task 'doc' => ['doc:api']
task 'doc:api' => ['doc/api/index.html']
file 'doc/api/index.html' => FileList['lib/**/*.rb','README.rdoc'] do |f|
require 'rbconfig'
hanna = RbConfig::CONFIG['ruby_install_name'].sub('ruby', 'hanna')
rb_files = f.prerequisites
sh((<<-end).gsub(/\s+/, ' '))
hanna --charset utf8 \
--fmt html \
--inline-source \
--line-numbers \
--main README.rdoc \
--op doc/api \
--title 'Sinatra API Documentation' \
#{rb_files.join(' ')}
#{hanna}
--charset utf8
--fmt html
--inline-source
--line-numbers
--main README.rdoc
--op doc/api
--title 'Sinatra API Documentation'
#{rb_files.join(' ')}
end
end
CLEAN.include 'doc/api'