From cee939b527e82237f89eb8eece62610854ac888a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 7 Sep 2009 15:49:55 -0700 Subject: Switch to hand-rolled packaging/distro scripts Several bikeshed reasons brought me to this point: * I like the README.html layout more than any default index.html even if it's using README content. Having links on the side helps navigation IMHO. * publish_docs preserves timestamps to improve cache hit rate * git is used to maintain the manifest at packaging/release-time so my changesets have less noise in them * git is used to generate history files (from tag messages), this is a more DRY approach to me. * I don't like the ".txt" suffix being translated to "_txt.html" in URLs. I don't like the ".txt" suffix in general. * I don't like Manifest.txt showing up in my RDoc --- Rakefile | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 0cc50a7..cdcded1 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,3 @@ -require 'hoe' -$LOAD_PATH << 'lib' -require 'clogger' begin require 'rake/extensiontask' Rake::ExtensionTask.new('clogger_ext') @@ -8,24 +5,33 @@ rescue LoadError warn "rake-compiler not available, cross compiling disabled" end -common = lambda do |hoe| - title = hoe.paragraphs_of("README.txt", 0).first.sub(/^= /, '') - hoe.version = Clogger::VERSION - hoe.summary = title.split(/\s*-\s*/, 2).last - hoe.description = hoe.paragraphs_of("README.txt", 3) - hoe.rubyforge_name = 'clogger' - hoe.author = 'Eric Wong' - hoe.email = 'clogger@librelist.com' - hoe.spec_extras.merge!('rdoc_options' => [ "--title", title ]) - hoe.remote_rdoc_dir = '' - hoe.extra_deps << [ 'rack', '> 0.9' ] +desc 'prints RDoc-formatted history' +task :history do + tags = `git tag -l`.split(/\n/).grep(/^v/).reverse + timefmt = '%Y-%m-%d %H:%M UTC' + tags.each do |tag| + header, subject, body = `git cat-file tag #{tag}`.split(/\n\n/) + tagger = header.split(/\n/).grep(/^tagger /).first.split(/\s/) + time = Time.at(tagger[-2].to_i).utc + puts "=== #{tag.sub(/^v/, '')} / #{time.strftime(timefmt)}" + puts "" + puts body + puts "" + end end -if ENV['CLOGGER_EXT'] - Hoe.spec('clogger_ext') do - common.call(self) - self.spec_extras.merge!(:extensions => Dir.glob('ext/*/extconf.rb')) - end -else - Hoe.spec('clogger') { common.call(self) } +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 + 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('clogger', subject, body) end -- cgit v1.2.3-24-ge0c7