* [PATCH 1/4] update more referenced URLs to be HTTPS
2017-03-05 22:29 [PATCH 0/4] documentation cleanups and tidying Eric Wong
@ 2017-03-05 22:29 ` Eric Wong
2017-03-05 22:30 ` [PATCH 2/4] chunk_body: nodoc this internal class Eric Wong
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2017-03-05 22:29 UTC (permalink / raw)
To: yahns-public
HTTPS provides some security against spying and MitM attacks,
so refer users to HTTPS sites, instead.
---
Documentation/yahns-rackup.pod | 2 +-
Documentation/yahns_config.pod | 4 ++--
HACKING | 10 +++++-----
README | 2 +-
examples/logrotate.conf | 2 +-
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Documentation/yahns-rackup.pod b/Documentation/yahns-rackup.pod
index bd10efc..3fbde0e 100644
--- a/Documentation/yahns-rackup.pod
+++ b/Documentation/yahns-rackup.pod
@@ -168,7 +168,7 @@ List archives are available at L<https://yhbt.net/yahns-public/>
=head1 COPYRIGHT
Copyright (C) 2013-2016 all contributors L<mailto:yahns-public@yhbt.net>
-License: GPL-3.0+ L<http://www.gnu.org/licenses/gpl-3.0.txt>
+License: GPL-3.0+ L<https://www.gnu.org/licenses/gpl-3.0.txt>
=head1 SEE ALSO
diff --git a/Documentation/yahns_config.pod b/Documentation/yahns_config.pod
index 8fb1608..9558d3d 100644
--- a/Documentation/yahns_config.pod
+++ b/Documentation/yahns_config.pod
@@ -427,7 +427,7 @@ To enable TLS connections, you must configure this yourself.
See documentation for OpenSSL::SSL::SSLContext
for more information:
-L<http://docs.ruby-lang.org/en/trunk/OpenSSL/SSL/SSLContext.html>
+L<https://docs.ruby-lang.org/en/trunk/OpenSSL/SSL/SSLContext.html>
Default: none
@@ -667,7 +667,7 @@ List archives are available at L<https://yhbt.net/yahns-public/>
=head1 COPYRIGHT
Copyright (C) 2013-2016 all contributors L<mailto:yahns-public@yhbt.net>
-License: GPL-3.0+ L<http://www.gnu.org/licenses/gpl-3.0.txt>
+License: GPL-3.0+ L<https://www.gnu.org/licenses/gpl-3.0.txt>
=head1 SEE ALSO
diff --git a/HACKING b/HACKING
index e9a2b76..d0485c4 100644
--- a/HACKING
+++ b/HACKING
@@ -2,12 +2,12 @@ development dependencies
------------------------
* minitest RubyGem (version 4 or 5, standard in Ruby 2.0+)
-* curl - http://curl.haxx.se/ - we don't trust our own Ruby abilities :>
+* curl - https://curl.haxx.se/ - we don't trust our own Ruby abilities :>
* dd(1) - standard POSIX tool - to feed curl
-* ab - http://httpd.apache.org/ - for concurrent testing
+* ab - https://httpd.apache.org/ - for concurrent testing
* GNU make - https://www.gnu.org/software/make/
-* git - http://www.git-scm.com/
-* ruby - http://www.ruby-lang.org/en/
+* git - https://www.git-scm.com/
+* ruby - https://www.ruby-lang.org/en/
git clone git://yhbt.net/yahns
@@ -52,4 +52,4 @@ No subscription is necessary to post to the mailing list.
Please remember to Cc: all recipients as subscription is optional.
Copyright (C) 2013-2016 all contributors <yahns-public@yhbt.net>
-License: GPL-3.0+ <http://www.gnu.org/licenses/gpl-3.0.txt>
+License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
diff --git a/README b/README
index 2b15cba..349b028 100644
--- a/README
+++ b/README
@@ -88,7 +88,7 @@ the git(7) suite for generating and sending patches. Please format
pull requests with the git-request-pull(1) script (also distributed
with git(7)) and send them via email.
-See http://www.git-scm.com/ for more information on git.
+See https://www.git-scm.com/ for more information on git.
Design
------
diff --git a/examples/logrotate.conf b/examples/logrotate.conf
index b0d1351..1fd92d0 100644
--- a/examples/logrotate.conf
+++ b/examples/logrotate.conf
@@ -5,7 +5,7 @@
# /etc/logrotate.d/yahns_app on my Debian systems
#
# See the logrotate(8) manpage for more information:
-# http://linux.die.net/man/8/logrotate
+# https://linux.die.net/man/8/logrotate
# Modify the following glob to match the logfiles your app writes to:
/var/log/yahns_app/*.log {
--
EW
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] Revert "use olddoc 1.1.0 for generating NEWS + NEWS.atom.xml"
2017-03-05 22:29 [PATCH 0/4] documentation cleanups and tidying Eric Wong
2017-03-05 22:29 ` [PATCH 1/4] update more referenced URLs to be HTTPS Eric Wong
2017-03-05 22:30 ` [PATCH 2/4] chunk_body: nodoc this internal class Eric Wong
@ 2017-03-05 22:30 ` Eric Wong
2017-03-05 22:30 ` [PATCH 4/4] gemspec: stop advertising "private" email address Eric Wong
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2017-03-05 22:30 UTC (permalink / raw)
To: yahns-public
This reverts commit bcf0f0efb3173b18957ddba2af6592219a2d72a3.
The dependency on olddoc makes it slightly more difficult for
users to package their own and distribute RubyGems. We will
also not host HTML RDoc files since we have no internal API
to support.
---
.gitignore | 1 -
.olddoc.yml | 7 -----
Rakefile | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 97 insertions(+), 12 deletions(-)
delete mode 100644 .olddoc.yml
diff --git a/.gitignore b/.gitignore
index c1c147f..45603bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,4 +15,3 @@
.gem-manifest
.tgz-manifest
/doc
-/LATEST
diff --git a/.olddoc.yml b/.olddoc.yml
deleted file mode 100644
index 67b78d0..0000000
--- a/.olddoc.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-cgit_url: https://yhbt.net/yahns.git
-git_url: git://yhbt.net/yahns.git
-rdoc_url: https://yhbt.net/yahns/
-ml_url: https://yhbt.net/yahns-public/
-public_email: yahns-public@yhbt.net
-private_email: yahns@yhbt.net
diff --git a/Rakefile b/Rakefile
index b776c4a..3eb0219 100644
--- a/Rakefile
+++ b/Rakefile
@@ -66,12 +66,105 @@ def tags
end.compact.sort { |a,b| b[:time] <=> a[:time] }
end
+def xml(dst, tag, text = nil, attrs = nil)
+ if Hash === text
+ attrs = text
+ text = nil
+ end
+ if attrs
+ attrs = attrs.map { |k,v| "#{k}=#{v.encode(xml: :attr)}" }
+ attrs = "\n#{attrs.join("\n")}"
+ end
+ case text
+ when nil
+ if block_given?
+ dst << "<#{tag}#{attrs}>"
+ yield
+ dst << "</#{tag}>"
+ else
+ dst << "<#{tag}#{attrs}/>"
+ end
+ else
+ dst << "<#{tag}#{attrs}>#{text.encode(xml: :text)}</#{tag}>"
+ end
+end
+
desc 'prints news as an Atom feed'
task "NEWS.atom.xml" do
- # 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 #$?"
+ require 'uri'
+ cgit_uri = URI('https://yhbt.net/yahns.git')
+ uri = URI('https://yhbt.net/yahns/')
+ new_tags = tags[0,10]
+ time = nil
+ project_name = 'yahns'
+ short_desc = File.readlines('README')[0].split(' - ')[0]
+ new_tags = tags[0,10]
+ atom_uri = uri.dup
+ atom_uri.path += 'NEWS.atom.xml'
+ news_uri = uri.dup
+ news_uri.path += 'NEWS.html'
+ dst = ''
+ xml(dst, 'feed', xmlns: 'http://www.w3.org/2005/Atom') do
+ xml(dst, 'id', atom_uri.to_s)
+ xml(dst, 'title', "#{project_name} news")
+ xml(dst, 'subtitle', short_desc)
+ xml(dst, 'link', rel: 'alternate', type: 'text/html', href: news_uri.to_s)
+ xml(dst, 'updated', new_tags.empty? ? '1970-01-01:00:00:00Z'
+ : new_tags[0][:time])
+ new_tags.each do |tag|
+ xml(dst, 'entry') do
+ xml(dst, 'title', tag[:subject])
+ xml(dst, 'updated', tag[:time])
+ xml(dst, 'published', tag[:time])
+ xml(dst, 'author') do
+ xml(dst, 'name', tag[:tagger_name])
+ xml(dst, 'email', tag[:tagger_email])
+ end
+ uri = cgit_uri.dup
+ uri.path += '/tag/'
+ uri.query = "id=#{tag[:tag]}"
+ uri = uri.to_s
+ xml(dst, 'link', rel: 'alternate', type: 'text/html', href: uri)
+ xml(dst, 'id', uri)
+ xml(dst, 'content', type: 'xhtml') do
+ xml(dst, 'div', xmlns: 'http://www.w3.org/1999/xhtml') do
+ xml(dst, 'pre', tag[:body])
+ end # div
+ end # content
+ end # entry
+ end # new_tags.each
+ end # feed
+
+ fp = Tempfile.new('NEWS.atom.xml', '.')
+ fp.sync = true
+ fp.write(dst)
+ fp.chmod 0644
+ File.utime(time, time, fp.path) if time
+ File.rename(fp.path, 'NEWS.atom.xml')
+ fp.close!
end
desc 'prints news as a text file'
-task 'NEWS' => 'NEWS.atom.xml'
+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 "---------"
+ fp.puts "Copyright (C) 2013-2017 all contributors <yahns-public@yhbt.net>"
+ fp.puts "License: GPL-3.0+ <https://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
--
EW
^ permalink raw reply related [flat|nested] 5+ messages in thread