From 663111480d8222763e5f553a71166442ef9990cc Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Sep 2010 22:40:16 +0000 Subject: release: publish rubyforge news post Otherwise we'd keep forgetting and users would not know about us. --- Rakefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index a400bc3..1f7297b 100644 --- a/Rakefile +++ b/Rakefile @@ -105,8 +105,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('raindrops.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!" -- cgit v1.2.3-24-ge0c7