update docs for rubyforge death
[clogger.git] / Rakefile
blobfc217c44afeb6e019c9eddfe99152b21f2307b0f
1 begin
2   require 'rake/extensiontask'
3   Rake::ExtensionTask.new('clogger_ext')
4 rescue LoadError
5   warn "rake-compiler not available, cross compiling disabled"
6 end
8 cgit_url = "http://bogomips.org/clogger.git"
9 git_url = 'git://bogomips.org/clogger.git'
11 desc "post news article to rubyforge"
12 task :publish_news do
13   require 'rubyforge'
14   spec = Gem::Specification.load('clogger.gemspec')
15   tmp = Tempfile.new('rf-news')
16   _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3)
17   tmp.puts subject
18   tmp.puts
19   tmp.puts spec.description.strip
20   tmp.puts ""
21   tmp.puts "* #{spec.homepage}"
22   tmp.puts "* #{spec.email}"
23   tmp.puts "* #{git_url}"
24   tmp.print "\nChanges:\n\n"
25   tmp.puts body
26   tmp.flush
27   system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
28   msg = File.readlines(tmp.path)
29   subject = msg.shift
30   blank = msg.shift
31   blank == "\n" or abort "no newline after subject!"
32   subject.strip!
33   body = msg.join("").strip!
35   rf = RubyForge.new.configure
36   rf.login
37   rf.post_news('clogger', subject, body)
38 end