about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-26 01:25:27 +0000
committerEric Wong <normalperson@yhbt.net>2010-12-26 01:27:22 +0000
commit9edc6946bbd4cc4be55ca4293135189c3db356c6 (patch)
treec9c2b110a5fa21a477386bf52294a6a41527e787
parent88e85b58f3cb0796a680c86d83c16c305c33b098 (diff)
downloadruby_posix_mq-9edc6946bbd4cc4be55ca4293135189c3db356c6.tar.gz
Run it by default on releases.
-rw-r--r--GNUmakefile1
-rw-r--r--Rakefile17
2 files changed, 16 insertions, 2 deletions
diff --git a/GNUmakefile b/GNUmakefile
index fe1b160..dbf12a5 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -127,6 +127,7 @@ release: verify package $(release_notes) $(release_changes)
         # in case of gem downloads from RubyForge releases page
         -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 5882d80..e7fd985 100644
--- a/Rakefile
+++ b/Rakefile
@@ -5,8 +5,21 @@ git_url = 'git://git.bogomips.org/ruby_posix_mq.git'
 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('posix_mq.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!"