This removes the build-time dependency on Nokogiri, which can
be time-consuming to install.  We won't be supporting any public
APIs, so we will not actually support RDoc here.
---
 .gitignore  |  1 +
 .olddoc.yml |  7 ++++++
 Rakefile    | 72 ++++---------------------------------------------------------
 3 files changed, 12 insertions(+), 68 deletions(-)
 create mode 100644 .olddoc.yml

diff --git a/.gitignore b/.gitignore
index 3c8af53..2d6dc88 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@
 .gem-manifest
 .tgz-manifest
 /doc
+/LATEST
diff --git a/.olddoc.yml b/.olddoc.yml
new file mode 100644
index 0000000..585a3a2
--- /dev/null
+++ b/.olddoc.yml
@@ -0,0 +1,7 @@
+---
+cgit_url: http://yhbt.net/yahns.git
+git_url: git://yhbt.net/yahns.git
+rdoc_url: http://yahns.yhbt.net/
+ml_url: http://yhbt.net/yahns-public/
+public_email: yahns-public@yhbt.net
+private_email: ya...@yhbt.net
diff --git a/Rakefile b/Rakefile
index 8a2ca77..e8e4af0 100644
--- a/Rakefile
+++ b/Rakefile
@@ -61,76 +61,12 @@ def tags
   end.compact.sort { |a,b| b[:time] <=> a[:time] }
 end
 
-url_base = 'http://yahns.yhbt.net'
-cgit_url = 'http://yhbt.net/yahns.git'
-git_url = 'git://yhbt.net/yahns.git'
-since = "v0.0.2"
-
 desc 'prints news as an Atom feed'
 task "NEWS.atom.xml" do
-  require 'nokogiri'
-  new_tags = tags[0,10]
-  time = nil
-  str = Nokogiri::XML::Builder.new do
-    feed :xmlns => "http://www.w3.org/2005/Atom"; do
-      id! "#{url_base}/NEWS.atom.xml"
-      title "yahns news"
-      subtitle "sleepy, multi-threaded, non-blocking Ruby application server"
-      link! :rel => 'alternate', :type => 'text/plain',
-            :href => "#{url_base}/NEWS"
-      updated(new_tags.empty? ? "1970-01-01T00:00:00Z" : new_tags.first[:time])
-      new_tags.each do |tag|
-        time ||= tag[:time_obj]
-        entry do
-          title tag[:subject]
-          updated tag[:time]
-          published tag[:time]
-          author {
-            name tag[:tagger_name]
-            email tag[:tagger_email]
-          }
-          url = "#{cgit_url}/tag/?id=#{tag[:tag]}"
-          link! :rel => "alternate", :type => "text/html", :href =>url
-          id! url
-          message_only = tag[:body].split(/\n.+\(\d+\):\n {6}/).first.strip
-          content({:type =>:text}, message_only)
-          content(:type =>:xhtml) { pre tag[:body] }
-        end
-      end
-    end
-  end.to_xml
-
-  fp = Tempfile.new("NEWS.atom.xml", ".")
-  fp.sync = true
-  fp.write(str)
-  fp.chmod 0644
-  File.utime(time, time, fp.path) if time
-  File.rename(fp.path, "NEWS.atom.xml")
-  fp.close!
+  # gem install 'olddoc', 'olddoc prepare' has no API besides the
+  # command-line.  This requires olddoc 1.1 or later.
+  system('olddoc', 'prepare') or abort "olddoc prepare failed #$?"
 end
 
 desc 'prints news as a text file'
-task "NEWS" do
-  fp = Tempfile.new("NEWS", ".")
-  fp.sync = true
-  time = nil
-  tags.each do |tag|
-    time ||= tag[:time_obj]
-    line = tag[:subject] + " / " + tag[:time].sub(/T.*/, '')
-    fp.puts line
-    fp.puts("-" * line.length)
-    fp.puts
-    fp.puts tag[:body]
-    fp.puts
-  end
-  fp.write("Unreleased\n\n") unless fp.size > 0
-  fp.puts "COPYRIGHT"
-  fp.puts "---------"
-  bdfl = 'Eric Wong <normalper...@yhbt.net>'
-  fp.puts "Copyright (C) 2013, #{bdfl} and all contributors"
-  fp.puts "License: GPLv3 or later (http://www.gnu.org/licenses/gpl-3.0.txt)"
-  fp.chmod 0644
-  File.utime(time, time, fp.path) if time
-  File.rename(fp.path, "NEWS")
-  fp.close!
-end
+task 'NEWS' => 'NEWS.atom.xml'
-- 
EW

--
unsubscribe: yahns-public+unsubscr...@yhbt.net
archive: http://yhbt.net/yahns-public/

Reply via email to