Sha256: 813fe2556b502d57f42901bfbbae2c8355c28034431e4e2d4ee3d8804a29aeaf

Contents?: true

Size: 1.78 KB

Versions: 6

Compression:

Stored size: 1.78 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] do

      rubyforge = RubyForge.new

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

      config = rubyforge.userconfig
      config["release_notes"]     = proj_conf.description
      config["release_changes"]   = Utils.release_notes_from(proj_conf.history)[Amalgalite::VERSION]
      config["Prefomatted"]       = true

      puts "Uploading to rubyforge..."
      files = FileList[File.join("pkg","#{Amalgalite::GEM_SPEC.name}-#{Amalgalite::VERSION}*.*")].to_a
      rubyforge.login
      rubyforge.add_release(Amalgalite::GEM_SPEC.rubyforge_project, Amalgalite::GEM_SPEC.name, Amalgalite::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.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

6 entries across 6 versions & 1 rubygems

Version Path
amalgalite-0.1.0 tasks/rubyforge.rake
amalgalite-0.2.0 tasks/rubyforge.rake
amalgalite-0.2.3 tasks/rubyforge.rake
amalgalite-0.2.2 tasks/rubyforge.rake
amalgalite-0.2.1 tasks/rubyforge.rake
amalgalite-0.2.4 tasks/rubyforge.rake