diff options
-rw-r--r-- | GNUmakefile | 1 | ||||
-rw-r--r-- | 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) @@ -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' |