From: Eric Wong <e@80x24.org>
To: <olddoc-public@80x24.org>
Subject: [PATCH] allow multiple rdoc_url and cgit_url values
Date: Sun, 26 Jul 2020 02:15:53 +0000 [thread overview]
Message-ID: <20200726021553.22397-1-e@80x24.org> (raw)
Might as well, since domain name ownership is a shaky thing
and ICANN may try to screw the world over once again.
---
lib/olddoc/history.rb | 2 +-
lib/olddoc/news_atom.rb | 4 ++--
lib/olddoc/prepare.rb | 4 ++--
lib/oldweb.rb | 20 ++++++++++----------
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
reply other threads:[~2020-07-26 2:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://80x24.org/olddoc/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200726021553.22397-1-e@80x24.org \
--to=e@80x24.org \
--cc=olddoc-public@80x24.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/olddoc.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).