diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-12-26 01:21:33 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-12-26 01:29:22 +0000 |
commit | f132c6baa33496515743de1a31854d169479518d (patch) | |
tree | 2a8c88ea23937d928c8a902327dfa5de668c9f2e | |
parent | a4b13f3e1376b539a1b7b7cbfeb9e38f6de2b289 (diff) | |
download | clogger-f132c6baa33496515743de1a31854d169479518d.tar.gz |
It's interactive and sucks less, now.
-rw-r--r-- | GNUmakefile | 1 | ||||
-rw-r--r-- | Rakefile | 25 |
2 files changed, 20 insertions, 6 deletions
diff --git a/GNUmakefile b/GNUmakefile index a82fad1..cfe11bc 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -133,6 +133,7 @@ release: verify package $(release_notes) $(release_changes) gem push $(pkggem) rubyforge add_file \ $(rfproject) $(rfpackage) $(VERSION) $(pkggem) + $(RAKE) publish_news VERSION=$(VERSION) else gem install-gem: GIT-VERSION-FILE $(MAKE) $@ VERSION=$(GIT_VERSION) @@ -5,11 +5,27 @@ rescue LoadError warn "rake-compiler not available, cross compiling disabled" end -desc "read news article from STDIN and post to rubyforge" +cgit_url = "http://git.bogomips.org/cgit/clogger.git" +git_url = 'git://git.bogomips.org/clogger.git' + +desc "post news article 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('clogger.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!" @@ -21,9 +37,6 @@ task :publish_news do rf.post_news('clogger', subject, body) end -cgit_url = "http://git.bogomips.org/cgit/clogger.git" -git_url = 'git://git.bogomips.org/clogger.git' - desc "post to RAA" task :raa_update do require 'rubygems' |