1 # -*- encoding: binary -*-
2 cgit_url = "http://bogomips.org/kgio.git"
3 git_url = 'git://bogomips.org/kgio.git'
5 desc "post news article to rubyforge"
8 spec = Gem::Specification.load('kgio.gemspec')
9 tmp = Tempfile.new('rf-news')
10 _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3)
13 tmp.puts spec.description.strip
15 tmp.puts "* #{spec.homepage}"
16 tmp.puts "* #{spec.email}"
17 tmp.puts "* #{git_url}"
18 tmp.print "\nChanges:\n\n"
21 system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
22 msg = File.readlines(tmp.path)
25 blank == "\n" or abort "no newline after subject!"
27 body = msg.join("").strip!
29 rf = RubyForge.new.configure
31 rf.post_news('rainbows', subject, body)
38 rc = Net::Netrc.locate('kgio-raa') or abort "~/.netrc not found"
39 password = rc.password
41 s = Gem::Specification.load('kgio.gemspec')
42 desc = [ s.description.strip ]
44 desc << "* #{s.email}"
45 desc << "* #{git_url}"
46 desc << "* #{cgit_url}"
47 desc = desc.join("\n")
48 uri = URI.parse('http://raa.ruby-lang.org/regist.rhtml')
51 :short_description => s.summary,
52 :version => s.version.to_s,
53 :status => 'experimental',
54 :owner => s.authors.first,
56 :category_major => 'Library',
57 :category_minor => 'System',
59 :download => 'http://rubyforge.org/frs/?group_id=8977',
61 :description_style => 'Plain',
66 res = Net::HTTP.post_form(uri, form)