From a1321e72bea710270d1091a5616f0bbd1e2bbad4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 15 Nov 2009 14:00:47 -0800 Subject: Rakefile: add raa_update task --- Rakefile | 41 +++++++++++++++++++++++++++++++++++++++-- unicorn.gemspec | 2 +- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 2d4386a..67534f2 100644 --- a/Rakefile +++ b/Rakefile @@ -33,6 +33,7 @@ def tags end cgit_url = "http://git.bogomips.org/cgit/unicorn.git" +git_url = ENV['GIT_URL'] || 'git://git.bogomips.org/unicorn.git' desc 'prints news as an Atom feed' task :news_atom do @@ -93,8 +94,6 @@ desc "print release notes for Rubyforge" task :release_notes do require 'rubygems' - git_url = ENV['GIT_URL'] || 'git://git.bogomips.org/unicorn.git' - spec = Gem::Specification.load('unicorn.gemspec') puts spec.description.strip puts "" @@ -106,3 +105,41 @@ task :release_notes do print "\nChanges:\n\n" puts body end + +desc "post to RAA" +task :raa_update do + require 'rubygems' + require 'net/http' + require 'net/netrc' + rc = Net::Netrc.locate('unicorn-raa') or abort "~/.netrc not found" + password = rc.password + + s = Gem::Specification.load('unicorn.gemspec') + desc = [ s.description.strip ] + desc << "" + desc << "* #{s.email}" + desc << "* #{git_url}" + desc << "* #{cgit_url}" + desc = desc.join("\n") + uri = URI.parse('http://raa.ruby-lang.org/regist.rhtml') + form = { + :name => s.name, + :short_description => s.summary, + :version => s.version.to_s, + :status => 'stable', + :owner => s.authors.first, + :email => s.email, + :category_major => 'Library', + :category_minor => 'Web', + :url => s.homepage, + :download => "http://rubyforge.org/frs/?group_id=1306", + :license => "Ruby's", + :description_style => 'Plain', + :description => desc, + :pass => password, + :submit => "Update", + } + res = Net::HTTP.post_form(uri, form) + p res + puts res.body +end diff --git a/unicorn.gemspec b/unicorn.gemspec index 063b313..d1ab2d2 100644 --- a/unicorn.gemspec +++ b/unicorn.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |s| s.name = %q{unicorn} s.version = ENV["VERSION"] - s.authors = ["Unicorn developers"] + s.authors = ["Unicorn hackers"] s.date = Time.now.utc.strftime('%Y-%m-%d') s.description = File.read("README").split(/\n\n/)[1] s.email = %q{mongrel-unicorn@rubyforge.org} -- cgit v1.2.3-24-ge0c7