mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
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:
parent
171bf43341
commit
3ea36c94cf
1 changed files with 11 additions and 8 deletions
17
Rakefile
17
Rakefile
|
@ -37,15 +37,18 @@ 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' \
|
||||
#{hanna}
|
||||
--charset utf8
|
||||
--fmt html
|
||||
--inline-source
|
||||
--line-numbers
|
||||
--main README.rdoc
|
||||
--op doc/api
|
||||
--title 'Sinatra API Documentation'
|
||||
#{rb_files.join(' ')}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue