From 3607ef808c947c37d1810cdb34ed924c86502ad1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 Aug 2010 08:39:22 +0000 Subject: maint: publish Rubyforge news on release I keep forgetting, so I'll force it on myself. --- GNUmakefile | 1 + Rakefile | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 55d55e6..7599291 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -183,6 +183,7 @@ release: verify package $(release_notes) $(release_changes) $(rfproject) $(rfpackage) $(VERSION) $(pkggem) $(RAKE) raa_update VERSION=$(VERSION) $(RAKE) fm_update VERSION=$(VERSION) + $(RAKE) publish_news VERSION=$(VERSION) else gem install-gem: GIT-VERSION-FILE $(MAKE) $@ VERSION=$(GIT_VERSION) diff --git a/Rakefile b/Rakefile index 219744a..d2db54d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ # -*- encoding: binary -*- autoload :Gem, 'rubygems' +autoload :Tempfile, 'tempfile' # most tasks are in the GNUmakefile which offers better parallelism @@ -105,8 +106,21 @@ end desc "read news article from STDIN and post to rubyforge" task :publish_news do require 'rubyforge' - IO.select([STDIN], nil, nil, 1) or abort "E: news must be read from stdin" - msg = STDIN.readlines + spec = Gem::Specification.load('rainbows.gemspec') + tmp = Tempfile.new('rf-news') + _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3) + tmp.puts subject + tmp.puts + tmp.puts spec.description.strip + tmp.puts "" + tmp.puts "* #{spec.homepage}" + tmp.puts "* #{spec.email}" + tmp.puts "* #{git_url}" + tmp.print "\nChanges:\n\n" + tmp.puts body + tmp.flush + system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?" + msg = File.readlines(tmp.path) subject = msg.shift blank = msg.shift blank == "\n" or abort "no newline after subject!" @@ -157,7 +171,6 @@ end desc "post to FM" task :fm_update do - require 'tempfile' require 'net/http' require 'net/netrc' require 'json' -- cgit v1.2.3-24-ge0c7