Skip to content

Commit

Permalink
more robust 'rake doc:api' under different ruby environments
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kch authored and rtomayko committed Feb 15, 2010
1 parent 171bf43 commit 3ea36c9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Rakefile
Expand Up @@ -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'
Expand Down

0 comments on commit 3ea36c9

Please sign in to comment.