From f132c6baa33496515743de1a31854d169479518d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 26 Dec 2010 01:21:33 +0000 Subject: release: publish_news runs by default It's interactive and sucks less, now. --- Rakefile | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 84195de..c3d4a39 100644 --- a/Rakefile +++ b/Rakefile @@ -5,11 +5,27 @@ rescue LoadError warn "rake-compiler not available, cross compiling disabled" end -desc "read news article from STDIN and post to rubyforge" +cgit_url = "http://git.bogomips.org/cgit/clogger.git" +git_url = 'git://git.bogomips.org/clogger.git' + +desc "post news article 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('clogger.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!" @@ -21,9 +37,6 @@ task :publish_news do rf.post_news('clogger', subject, body) end -cgit_url = "http://git.bogomips.org/cgit/clogger.git" -git_url = 'git://git.bogomips.org/clogger.git' - desc "post to RAA" task :raa_update do require 'rubygems' -- cgit v1.2.3-24-ge0c7