1 # -*- encoding: binary -*-
2 autoload :Gem, 'rubygems'
3 autoload :Tempfile, 'tempfile'
4 cgit_url = "http://git.bogomips.org/cgit/ruby_io_splice.git"
5 git_url = 'git://git.bogomips.org/ruby_io_splice.git'
6 web_url = "http://bogomips.org/ruby_io_splice/"
8 desc "read news article from STDIN and post to rubyforge"
11 spec = Gem::Specification.load('io_splice.gemspec')
12 tmp = Tempfile.new('rf-news')
13 _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3)
16 tmp.puts spec.description.strip
18 tmp.puts "* #{spec.homepage}"
19 tmp.puts "* #{spec.email}"
20 tmp.puts "* #{git_url}"
21 tmp.print "\nChanges:\n\n"
24 system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
25 msg = File.readlines(tmp.path)
28 blank == "\n" or abort "no newline after subject!"
30 body = msg.join("").strip!
32 rf = RubyForge.new.configure
34 rf.post_news('qrp', subject, body)
41 rc = Net::Netrc.locate('io_splice-raa') or abort "~/.netrc not found"
42 password = rc.password
44 s = Gem::Specification.load('io_splice.gemspec')
45 desc = [ s.description.strip ]
47 desc << "* #{s.email}"
48 desc << "* #{git_url}"
49 desc << "* #{cgit_url}"
50 desc = desc.join("\n")
51 uri = URI.parse('http://raa.ruby-lang.org/regist.rhtml')
54 :short_description => s.summary,
55 :version => s.version.to_s,
57 :owner => s.authors.first,
59 :category_major => 'Library',
60 :category_minor => 'System',
62 :download => 'http://rubyforge.org/frs/?group_id=5626',
64 :description_style => 'Plain',
69 res = Net::HTTP.post_form(uri, form)