From c09f94c6ffdb6a4126bf4526ac3a1163d03c4930 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 5 Oct 2009 03:53:12 -0700 Subject: Rakefile: add publish_news target --- Rakefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Rakefile b/Rakefile index b9a89c3..19efea4 100644 --- a/Rakefile +++ b/Rakefile @@ -101,3 +101,19 @@ task :release_notes do print "\nChanges:\n\n" puts body 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 + subject = msg.shift + blank = msg.shift + blank == "\n" or abort "no newline after subject!" + subject.strip! + body = msg.join("").strip! + + rf = RubyForge.new.configure + rf.login + rf.post_news('rainbows', subject, body) +end -- cgit v1.2.3-24-ge0c7