yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] use olddoc 1.1.0 for generating NEWS + NEWS.atom.xml
@ 2015-10-15  1:53 Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-10-15  1:53 UTC (permalink / raw)
  To: yahns-public

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: yahns@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 <normalperson@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] use olddoc 1.1.0 for generating NEWS + NEWS.atom.xml
@ 2015-10-15 16:40 Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2015-10-15 16:40 UTC (permalink / raw)
  To: yahns-public

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: yahns@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 <normalperson@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-15 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-15  1:53 [PATCH] use olddoc 1.1.0 for generating NEWS + NEWS.atom.xml Eric Wong
2015-10-15 16:40 Eric Wong

Code repositories for project(s) associated with this inbox:

	../../../yahns.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).