1 # -*- encoding: binary -*-
3 cgit_url = Wrongdoc.config[:cgit_url]
4 git_url = Wrongdoc.config[:git_url]
6 desc "post news article to rubyforge"
9 spec = Gem::Specification.load('socket_dontwait.gemspec')
10 tmp = Tempfile.new('rf-news')
11 _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3)
14 tmp.puts spec.description.strip
16 tmp.puts "* #{spec.homepage}"
17 tmp.puts "* #{spec.email}"
18 tmp.puts "* #{git_url}"
19 tmp.print "\nChanges:\n\n"
22 system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
23 msg = File.readlines(tmp.path)
26 blank == "\n" or abort "no newline after subject!"
28 body = msg.join("").strip!
30 rf = RubyForge.new.configure
32 rf.post_news('rainbows', subject, body)
39 rc = Net::Netrc.locate('socket_dontwait-raa') or abort "~/.netrc not found"
40 password = rc.password
42 s = Gem::Specification.load('socket_dontwait.gemspec')
43 desc = [ s.description.strip ]
45 desc << "* #{s.email}"
46 desc << "* #{git_url}"
47 desc << "* #{cgit_url}"
48 desc = desc.join("\n")
49 uri = URI.parse('http://raa.ruby-lang.org/regist.rhtml')
52 :short_description => s.summary,
53 :version => s.version.to_s,
54 :status => 'experimental',
55 :owner => s.authors.first,
57 :category_major => 'Library',
58 :category_minor => 'System',
60 :download => 'http://rubyforge.org/frs/?group_id=8977',
62 :description_style => 'Plain',
67 res = Net::HTTP.post_form(uri, form)