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']
|
task 'doc:api' => ['doc/api/index.html']
|
||||||
|
|
||||||
file 'doc/api/index.html' => FileList['lib/**/*.rb','README.rdoc'] do |f|
|
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
|
rb_files = f.prerequisites
|
||||||
sh((<<-end).gsub(/\s+/, ' '))
|
sh((<<-end).gsub(/\s+/, ' '))
|
||||||
hanna --charset utf8 \
|
#{hanna}
|
||||||
--fmt html \
|
--charset utf8
|
||||||
--inline-source \
|
--fmt html
|
||||||
--line-numbers \
|
--inline-source
|
||||||
--main README.rdoc \
|
--line-numbers
|
||||||
--op doc/api \
|
--main README.rdoc
|
||||||
--title 'Sinatra API Documentation' \
|
--op doc/api
|
||||||
|
--title 'Sinatra API Documentation'
|
||||||
#{rb_files.join(' ')}
|
#{rb_files.join(' ')}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue