diff options
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -1,5 +1,6 @@ # -*- encoding: binary -*- autoload :Gem, 'rubygems' +autoload :Tempfile, 'tempfile' # most tasks are in the GNUmakefile which offers better parallelism @@ -105,8 +106,21 @@ end desc "read news article from STDIN and post to rubyforge" task :publish_news do require 'rubyforge' - IO.select([STDIN], nil, nil, 1) or abort "E: news must be read from stdin" - msg = STDIN.readlines + spec = Gem::Specification.load('rainbows.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!" @@ -157,7 +171,6 @@ end desc "post to FM" task :fm_update do - require 'tempfile' require 'net/http' require 'net/netrc' require 'json' |