From d3f9ce058c1096fd19d8755a7ca40fd5b83fca1d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 15 Nov 2009 15:10:01 -0800 Subject: Rakefile: add raa_update task --- Rakefile | 41 +++++++++++++++++++++++++++++++++++++++-- rainbows.gemspec | 2 +- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 8198df9..986353a 100644 --- a/Rakefile +++ b/Rakefile @@ -24,6 +24,7 @@ def tags end cgit_url = "http://git.bogomips.org/cgit/rainbows.git" +git_url = ENV['GIT_URL'] || 'git://git.bogomips.org/rainbows.git' desc 'prints news as an Atom feed' task :news_atom do @@ -88,8 +89,6 @@ desc "print release notes for Rubyforge" task :release_notes do require 'rubygems' - git_url = ENV['GIT_URL'] || 'git://git.bogomips.org/rainbows.git' - spec = Gem::Specification.load('rainbows.gemspec') puts spec.description.strip puts "" @@ -117,3 +116,41 @@ task :publish_news do rf.login rf.post_news('rainbows', subject, body) end + +desc "post to RAA" +task :raa_update do + require 'rubygems' + require 'net/http' + require 'net/netrc' + rc = Net::Netrc.locate('rainbows-raa') or abort "~/.netrc not found" + password = rc.password + + s = Gem::Specification.load('rainbows.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 => 'experimental', + :owner => s.authors.first, + :email => s.email, + :category_major => 'Library', + :category_minor => 'Web', + :url => s.homepage, + :download => "http://rubyforge.org/frs/?group_id=8977", + :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/rainbows.gemspec b/rainbows.gemspec index 699de2b..581fbb5 100644 --- a/rainbows.gemspec +++ b/rainbows.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |s| s.name = %q{rainbows} s.version = ENV["VERSION"] - s.authors = ["Rainbows! developers"] + s.authors = ["Rainbows! hackers"] s.date = Time.now.utc.strftime('%Y-%m-%d') s.description = File.read("README").split(/\n\n/)[1] s.email = %q{rainbows-talk@rubyforge.org} -- cgit v1.2.3-24-ge0c7