about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile1
-rw-r--r--Rakefile25
2 files changed, 20 insertions, 6 deletions
diff --git a/GNUmakefile b/GNUmakefile
index a82fad1..cfe11bc 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -133,6 +133,7 @@ release: verify package $(release_notes) $(release_changes)
         gem push $(pkggem)
         rubyforge add_file \
           $(rfproject) $(rfpackage) $(VERSION) $(pkggem)
+        $(RAKE) publish_news VERSION=$(VERSION)
 else
 gem install-gem: GIT-VERSION-FILE
         $(MAKE) $@ VERSION=$(GIT_VERSION)
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'