about summary refs log tree commit homepage
path: root/Rakefile
diff options
context:
space:
mode:
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