Rakefile: remove raa_update task
[raindrops.git] / Rakefile
blobe8890b6d03608c857eb0597be677f4236b2520b1
1 desc "read news article from STDIN and post to rubyforge"
2 task :publish_news do
3   require 'rubyforge'
4   spec = Gem::Specification.load('raindrops.gemspec')
5   tmp = Tempfile.new('rf-news')
6   _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3)
7   tmp.puts subject
8   tmp.puts
9   tmp.puts spec.description.strip
10   tmp.puts ""
11   tmp.puts "* #{spec.homepage}"
12   tmp.puts "* #{spec.email}"
13   tmp.puts "* #{git_url}"
14   tmp.print "\nChanges:\n\n"
15   tmp.puts body
16   tmp.flush
17   system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
18   msg = File.readlines(tmp.path)
19   subject = msg.shift
20   blank = msg.shift
21   blank == "\n" or abort "no newline after subject!"
22   subject.strip!
23   body = msg.join("").strip!
25   rf = RubyForge.new.configure
26   rf.login
27   rf.post_news('rainbows', subject, body)
28 end