# -*- ruby -*- require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' require 'rake/contrib/sshpublisher' require 'rbconfig' $: << 'lib' require './lib/rubyforge.rb' require 'rubygems' gem = Gem::Specification::new do |spec| spec.name = 'rubyforge' spec.version = RubyForge::VERSION spec.platform = Gem::Platform::RUBY spec.summary = File.read("README").split(/\n\n+/)[3] spec.description = spec.summary # TODO: improve spec.files = File.readlines("Manifest.txt").map { |l| l.chomp } spec.executables = spec.files.grep(/^bin/).map { |f| File::basename f } spec.has_rdoc = true spec.test_suite_file = "test/test_rubyforge.rb" spec.author = "Ara T. Howard" spec.email = "ara.t.howard@noaa.gov" spec.homepage = "http://codeforpeople.com/lib/ruby/rubyforge/" if $DEBUG then puts "#{spec.name} #{spec.version}" puts puts "bin = #{spec.executable.sort.inspect}" puts puts "** summary:" puts spec.summary puts puts "** description:" puts spec.description end end desc 'Build Gem' Rake::GemPackageTask.new gem do |pkg| pkg.need_tar = true end desc 'Run tests' task :default => :test desc 'Run tests' Rake::TestTask.new :test do |t| t.libs << 'test' t.warning = true end desc 'Generate RDoc' Rake::RDocTask.new :rdoc do |rd| rd.rdoc_dir = 'doc' rd.rdoc_files.add 'README', 'History.txt', "lib/rubyforge.rb" rd.main = 'README' rd.options << "-t codeforpeople's rubyforge-#{RubyForge::VERSION} Documentation" end desc 'Upload RDoc to RubyForge' task :upload => :rdoc do user = "#{ENV['USER']}@rubyforge.org" project = '/var/www/gforge-projects/codeforpeople/rubyforge' local_dir = 'doc' pub = Rake::SshDirPublisher.new user, project, local_dir pub.upload end task :deploy => [:clean, :package] do |t| version = ENV["VERSION"] or abort "Must supply VERSION=x.y.z" puts "Releasing #{version}" rf = RubyForge.new rf.login rf.add_release 'codeforpeople', 'rubyforge', version, "pkg/rubyforge-#{version}.tgz", "pkg/rubyforge-#{version}.gem" end desc 'Clean up' task :clean => [ :clobber_rdoc, :clobber_package ] do rm_f Dir["**/*~"] end # vim:syntax=ruby