diff --git a/Rakefile b/Rakefile index ce129541..8eaf0e19 100644 --- a/Rakefile +++ b/Rakefile @@ -44,3 +44,26 @@ end file package('.tar.gz') => %w[dist/] + spec.files do |f| sh "git archive --format=tar HEAD | gzip > #{f.name}" end + +# Hanna RDoc ========================================================= +# +# Building docs requires the hanna gem: +# gem install mislav-hanna --source=http://gems.github.com + +desc 'Generate Hanna RDoc under doc/api' +task :doc => ['doc/api/index.html'] + +file 'doc/api/index.html' => FileList['lib/**/*.rb','README.rdoc'] do |f| + 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(' ')} + end +end +CLEAN.include 'doc/api'