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