Sha256: 2ea9dc015d3a8722286e7697c1ec86a9592eb275e00c8f03185255af262619f0

Contents?: true

Size: 1.87 KB

Versions: 18

Compression:

Stored size: 1.87 KB

Contents

require 'tasks/config'    

#-----------------------------------------------------------------------
# Rubyforge additions to the task library
#-----------------------------------------------------------------------
if rf_conf = Configuration.for_if_exist?("rubyforge") then

  abort("rubyforge gem not installed 'gem install rubyforge'") unless Utils.try_require('rubyforge')
  
  proj_conf = Configuration.for('project')

  namespace :dist do
    desc "Release files to rubyforge"
    task :rubyforge => [:clean, :package, :package_win] do

      rubyforge = RubyForge.new

      config = {}
      config["release_notes"]     = proj_conf.description
      config["release_changes"]   = Utils.release_notes_from(proj_conf.history)[Hitimes::VERSION]
      config["Prefomatted"]       = true
 

      rubyforge.configure config

      # make sure this release doesn't already exist
      releases = rubyforge.autoconfig['release_ids']
      if releases.has_key?(Hitimes::GEM_SPEC.name) and releases[Hitimes::GEM_SPEC.name][Hitimes::VERSION] then
        abort("Release #{Hitimes::VERSION} already exists! Unable to release.")
      end

      puts "Uploading to rubyforge..."
      files = FileList[File.join("pkg","#{Hitimes::GEM_SPEC.name}-#{Hitimes::VERSION}*.*")].to_a
      files.each do |f|
        puts "  * #{f}"
      end
      rubyforge.login
      rubyforge.add_release(Hitimes::GEM_SPEC.rubyforge_project, Hitimes::GEM_SPEC.name, Hitimes::VERSION, *files)
      puts "done."
    end
  end

  namespace :announce do
    desc "Post news of #{proj_conf.name} to #{rf_conf.project} on rubyforge"
    task :rubyforge do
      info = Utils.announcement
      rubyforge = RubyForge.new
      rubyforge.configure
      rubyforge.login
      rubyforge.post_news(rf_conf.project, info[:subject], "#{info[:title]}\n\n#{info[:urls]}\n\n#{info[:release_notes]}")
      puts "Posted to rubyforge"
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hitimes-1.1.1-java tasks/rubyforge.rake
hitimes-1.1.1-x86-mswin32 tasks/rubyforge.rake
hitimes-1.1.1-x86-mingw32 tasks/rubyforge.rake
hitimes-1.1.1 tasks/rubyforge.rake
hitimes-1.1.0-java tasks/rubyforge.rake
hitimes-1.1.0-x86-mswin32 tasks/rubyforge.rake
hitimes-1.1.0-x86-mingw32 tasks/rubyforge.rake
hitimes-1.1.0 tasks/rubyforge.rake
hitimes-1.0.5-x86-mswin32 tasks/rubyforge.rake
hitimes-1.0.5-x86-mingw32 tasks/rubyforge.rake
hitimes-1.0.5 tasks/rubyforge.rake
hitimes-1.0.4-x86-mswin32 tasks/rubyforge.rake
hitimes-1.0.4-x86-mingw32 tasks/rubyforge.rake
hitimes-1.0.3-x86-mswin32-60 tasks/rubyforge.rake
hitimes-1.0.2-x86-mswin32-60 tasks/rubyforge.rake
hitimes-1.0.2 tasks/rubyforge.rake
hitimes-1.0.3 tasks/rubyforge.rake
hitimes-1.0.4 tasks/rubyforge.rake