Rakefile in getopt-declare-1.23 vs Rakefile in getopt-declare-1.25

- old
+ new

@@ -1,102 +1,30 @@ #!/usr/bin/env ruby -require 'rake/gempackagetask' -require 'rake/rdoctask' -require 'rake/testtask' +require 'rubygems' +require 'hoe' +require './lib/Getopt/Declare' + rdoc_files = ["Declare.rdoc", 'HISTORY.txt'] + Dir.glob('lib/*/*.rb') -# -# TASK: Gem specification and creation ('gem') -# -spec = Gem::Specification.new do |spec| - spec.name = "getopt-declare" - spec.version = '1.23' - spec.author = "Gonzalo Garramuno" - spec.email = 'ggarra@advancedsl.com.ar, GGarramuno@aol.com' - spec.homepage = 'http://www.rubyforge.org/projects/getoptdeclare/' - spec.summary = 'Getopt-Declare is a command-line argument parser.' - spec.require_path = "lib" - spec.autorequire = "Getopt/Declare" - spec.files = ["lib/Getopt/Declare.rb", "lib/Getopt/DelimScanner.rb", - "Rakefile"] - spec.description = <<-"EOF" + +Hoe.new('getopt-declare', Getopt::Declare::VERSION) do |p| + p.rubyforge_name = name = 'getoptdeclare' + p.author = "Gonzalo Garramuno" + p.email = 'ggarra@advancedsl.com.ar, GGarramuno@aol.com' + p.summary = "Getopt-Declare is a command-line argument parser." + p.description = <<-"EOF" Comprehensive and easy to use command-line parser library using regular expressions. Port of Damian Conway\'s Perl Getopt-Declare. EOF - # to fix emacs coloring bug - spec.extra_rdoc_files = rdoc_files - spec.has_rdoc = true - spec.test_files = Dir.glob('samples/*.rb') - spec.rubyforge_project = 'getoptdeclare' - spec.required_ruby_version = '>= 1.6.8' + # p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1] + p.url = "#{name}.rubyforge.org" + p.changes = p.paragraphs_of('HISTORY.txt', 0).join("\n\n") + p.need_zip = p.need_tar = true end -Rake::GemPackageTask.new(spec) do |pkg| - pkg.need_tar = true -end +task :default => ['test', 'redocs', 'publish_docs', + 'package', 'release', 'announce', 'email', 'post_news'] -# -# TASK: Run rdoc to document code ('rdoc') -# -html_dir = 'doc/html' -library = 'Getopt/Declare' -Rake::RDocTask.new('rdoc') do |t| - t.rdoc_files.include(rdoc_files) - t.main = 'doc/index.html' # Main web page - t.title = "#{library} API documentation" - t.rdoc_dir = html_dir -end - -# -# TASK: Upload docs to rubyforge ('upload-docs') -# -desc 'Upload documentation to RubyForge.' -task 'upload-docs' => ['rdoc'] do - rubyforge_user = 'gga' - rubyforge_project = spec.rubyforge_project - rubyforge_path = "/var/www/gforge-projects/#{rubyforge_project}/" - - sh "scp -r #{html_dir}/* #{rubyforge_user}@rubyforge.org:#{rubyforge_path}" -end - - -desc 'Zip directory as an archive.' -task 'zip' => ['rdoc'] do - dir = File.basename(Dir.pwd) - zipfile = spec.name + "-" + spec.version.to_s + ".zip" - Dir.chdir('..') - File.unlink(zipfile) if File.exists?(zipfile) - sh "zip -9rv #{zipfile} #{dir} -x '*~' -x '#*#' -x '*docs/*' -x '*pkg/*' -x '.*'" - Dir.chdir(dir) -end - -desc 'Run unit tests' -Rake::TestTask.new do |t| - t.libs << 'test' - t.test_files = FileList['test/*.rb'] - t.verbose = true - t.warning = true - # t.loader = :testrb - # p t.methods - Object.methods -end - -desc 'upload gem' -task 'upload-gem' => ['test', 'gem'] do -end - -desc 'upload zip' -task 'upload-zip' => ['zip'] do -end - -desc 'Upload gem, docs and zip file' -task 'upload' => [ 'upload-gem', 'upload-zip', 'upload-docs' ] - - - -# -# Main task -# -task :default => ['upload']