about summary refs log tree commit homepage
path: root/Rakefile
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-07 15:49:55 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-07 16:00:07 -0700
commitcee939b527e82237f89eb8eece62610854ac888a (patch)
tree019f3874373ea19c4292df73d90c8df85cee634c /Rakefile
parent00814d46e9e82fa24d38bd77172143df3757f020 (diff)
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
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile48
1 files changed, 27 insertions, 21 deletions
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