Sha256: 2629badadb8e1f51f6eaa13d72830780c6a39deb5670b1d3131791a1adc0a58b
Contents?: true
Size: 1.91 KB
Versions: 6
Compression:
Stored size: 1.91 KB
Contents
# -*- encoding: binary -*- require 'wrongdoc' cgit_url = Wrongdoc.config[:cgit_url] git_url = Wrongdoc.config[:git_url] desc "post news article to rubyforge" task :publish_news do require 'rubyforge' spec = Gem::Specification.load('posix_mq.gemspec') tmp = Tempfile.new('rf-news') _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3) tmp.puts subject tmp.puts tmp.puts spec.description.strip tmp.puts "" tmp.puts "* #{spec.homepage}" tmp.puts "* #{spec.email}" tmp.puts "* #{git_url}" tmp.print "\nChanges:\n\n" tmp.puts body tmp.flush system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?" msg = File.readlines(tmp.path) subject = msg.shift blank = msg.shift blank == "\n" or abort "no newline after subject!" subject.strip! body = msg.join("").strip! rf = RubyForge.new.configure rf.login rf.post_news('qrp', subject, body) end desc "post to RAA" task :raa_update do require 'rubygems' require 'net/http' require 'net/netrc' rc = Net::Netrc.locate('posix_mq-raa') or abort "~/.netrc not found" password = rc.password s = Gem::Specification.load('posix_mq.gemspec') desc = [ s.description.strip ] desc << "" desc << "* #{s.email}" desc << "* #{git_url}" desc << "* #{cgit_url}" desc = desc.join("\n") uri = URI.parse('http://raa.ruby-lang.org/regist.rhtml') form = { :name => s.name, :short_description => s.summary, :version => s.version.to_s, :status => 'experimental', :owner => s.authors.first, :email => s.email, :category_major => 'Library', :category_minor => 'System', :url => s.homepage, :download => 'http://rubyforge.org/frs/?group_id=5626', :license => 'LGPL', # LGPLv3, actually, but RAA is ancient... :description_style => 'Plain', :description => desc, :pass => password, :submit => 'Update', } res = Net::HTTP.post_form(uri, form) p res puts res.body end
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
posix_mq-2.0.0 | Rakefile |
posix_mq-1.0.0 | Rakefile |
posix_mq-0.8.0pre | Rakefile |
posix_mq-0.7.0 | Rakefile |
posix_mq-0.6.0.11.g634a | Rakefile |
posix_mq-0.6.0.7.g3a8a | Rakefile |