about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-07-26 01:59:30 +0000
committerEric Wong <e@80x24.org>2020-07-26 02:13:18 +0000
commit864e2f59ac4e4aadf8c5a4bf97e35facaaea6883 (patch)
treee136be41df6caf42ba65da11dce6fad3f90f4dcc
parent0be43ba42f608ea842e628d29f5c10a571d28f7a (diff)
downloadolddoc-864e2f59ac4e4aadf8c5a4bf97e35facaaea6883.tar.gz
Might as well, since domain name ownership is a shaky thing
and ICANN may try to screw the world over once again.
-rw-r--r--lib/olddoc/history.rb2
-rw-r--r--lib/olddoc/news_atom.rb4
-rw-r--r--lib/olddoc/prepare.rb4
-rw-r--r--lib/oldweb.rb20
4 files changed, 15 insertions, 15 deletions
diff --git a/lib/olddoc/history.rb b/lib/olddoc/history.rb
index dcdf0fe..800446e 100644
--- a/lib/olddoc/history.rb
+++ b/lib/olddoc/history.rb
@@ -9,7 +9,7 @@ module Olddoc::History # :nodoc:
 
   # returns a cgit URI for a given +tag_name+
   def tag_uri(tag_name)
-    uri = @cgit_uri.dup
+    uri = @cgit_uri[0].dup
     uri.path += "/tag/"
     uri.query = "id=#{tag_name}"
     uri
diff --git a/lib/olddoc/news_atom.rb b/lib/olddoc/news_atom.rb
index ed01197..39f9bb8 100644
--- a/lib/olddoc/news_atom.rb
+++ b/lib/olddoc/news_atom.rb
@@ -32,9 +32,9 @@ module Olddoc::NewsAtom # :nodoc:
   def news_atom_xml
     project_name, short_desc, _ = readme_metadata
     new_tags = tags[0,10]
-    atom_uri = @rdoc_uri.dup
+    atom_uri = @rdoc_uri[0].dup
     atom_uri.path += "NEWS.atom.xml"
-    news_uri = @rdoc_uri.dup
+    news_uri = @rdoc_uri[0].dup
     news_uri.path += "NEWS.html"
 
     dst = ''
diff --git a/lib/olddoc/prepare.rb b/lib/olddoc/prepare.rb
index f902fff..f0e6329 100644
--- a/lib/olddoc/prepare.rb
+++ b/lib/olddoc/prepare.rb
@@ -12,8 +12,8 @@ class Olddoc::Prepare # :nodoc:
     cgit_url = opts['cgit_url']
     rdoc_url && cgit_url or
       abort "rdoc_url and cgit_url required in .olddoc.yml for `prepare'"
-    @rdoc_uri = URI.parse(rdoc_url)
-    @cgit_uri = URI.parse(cgit_url)
+    @rdoc_uri = Array(rdoc_url).map { |u| URI.parse(u) }
+    @cgit_uri = Array(cgit_url).map { |u| URI.parse(u) }
     @name, @short_desc = readme_metadata
   end
 
diff --git a/lib/oldweb.rb b/lib/oldweb.rb
index 74b4db1..3b2b2f2 100644
--- a/lib/oldweb.rb
+++ b/lib/oldweb.rb
@@ -73,23 +73,23 @@ class Oldweb
     noindex = @old_cfg['noindex'] and noindex.each { |k| ni[k] = true }
     @old_cfg['noindex'] = ni
 
-    cgit_url = @old_cfg['cgit_url']
+    cgit_url = Array(@old_cfg['cgit_url'])
     source = @old_cfg['source_code'] ||= []
     if source.empty?
-      if cgit_url
-        source << "git clone #{cgit_url}"
-      end
+      source << "git clone #{cgit_url[0]}" if cgit_url[0]
       git_url = @old_cfg['git_url']
-      if git_url && git_url != cgit_url
+      if git_url && git_url != cgit_url[0]
         source << "git clone #{git_url}"
       end
     end
 
-    if cgit_url
-      cgit_url += '/tree/%s' # path name
-      tag = @git_tag and cgit_url << "id=#{CGI.escape(tag)}"
-      cgit_url << '#n%d' # lineno
-      @old_vcs_url = cgit_url
+    if cgit_url[0]
+      cgit_url.each do |u|
+        u += '/tree/%s' # path name
+        tag = @git_tag and u << "id=#{CGI.escape(tag)}"
+        u << '#n%d' # lineno
+      end
+      @old_vcs_url = cgit_url[0]
     end
     @oldweb_style = nil # used by dark216
   end