Rakefile in ruby-vpi-11.1.0 vs Rakefile in ruby-vpi-11.1.1

- old
+ new

@@ -38,13 +38,14 @@ include RubyVpi::Config PROJECT_SSH_URL = "snk@rubyforge.org:/var/www/gforge-projects/#{PROJECT_ID}" -File.read('HISTORY') =~ /Version\s+([\d\.]+)\s*\((.*?)\)/ -PROJECT_VERSION = $1 -PROJECT_BIRTHDAY = $2 +load 'doc/history.rb' +head = @history.first +PROJECT_VERSION = head['Version'] +PROJECT_BIRTHDAY = head['Date'] # Returns a temporary, unique path ready for use. No file exists at the returned path. def generate_temp_path rm_f path = Tempfile.new($$).path @@ -115,11 +116,11 @@ ## documentation desc 'Generate user documentation.' -task 'doc' do |t| +task :doc do |t| cd t.name do sh 'rake' end end @@ -161,48 +162,21 @@ ## distribution -DIST_INFO_HEADER = 'HEADER' - -distDocs = [DIST_INFO_HEADER, 'README', 'HISTORY', 'MEMO'].map do |src| - dst = src.downcase << '.html' - dstPartial = src.downcase << '.part.html' - - file dst => [DIST_INFO_HEADER, src] do - sh "redcloth #{DIST_INFO_HEADER unless src == DIST_INFO_HEADER} #{src} > #{dst}" - end - - file dstPartial => src do - sh "redcloth < #{src} > #{dstPartial}" - end - - CLOBBER.include dst, dstPartial - [dst, dstPartial] -end.flatten - -desc "Prepare distribution information." -task :dist_info => distDocs - - desc "Prepare for distribution." -task :dist => ['ext', 'ref', :doc, :dist_info] do |t| +task :dist => ['ext', 'ref', :doc] do |t| cd 'ext' do sh 'rake swig' end end desc 'Publish documentation to website.' -task :web => [:web_info, :web_ref, :web_doc] +task :web => [:web_ref, :web_doc] -desc "Publish distribution info." -task :web_info => ['style.css', *distDocs] do |t| - upload PROJECT_SSH_URL, *t.prerequisites -end - desc "Publish reference documentation." task :web_ref => 'ref' do |t| upload PROJECT_SSH_URL, *t.prerequisites end @@ -246,20 +220,17 @@ pkg.need_tar = true end desc "Configures the gem during installation." -task :gem_config_inst => 'readme.html' do |t| +task :gem_config_inst do |t| # make documentation available to gem_server gemDir = File.dirname(__FILE__) gemName = File.basename(gemDir) docDir = File.join('..', '..', 'doc', gemName) mkdir_p docDir ln_s gemDir, File.join(docDir, 'rdoc') - - # gem_server doesn't dynamically generate directory index - cp t.prerequisites[0], 'index.html' end ## testing