From 3ea36c94cf5f65d5d3244df07c384a2e70647853 Mon Sep 17 00:00:00 2001 From: Caio Chassot Date: Sat, 13 Feb 2010 14:43:18 -0200 Subject: [PATCH] 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. --- Rakefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index 54875e6079..effd310dbb 100644 --- a/Rakefile +++ b/Rakefile @@ -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'