summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-07 00:59:01 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-07 00:59:01 -0500
commit90a45f9729f131569889f52cf792007f23df3949 (patch)
tree3a7297268da2f4fd81749c4e724faaa7a8f0f047 /bin
parentadd2ce8c856d99a2f4cc0bbd4f630cc9aeb2ef05 (diff)
tidy
Diffstat (limited to 'bin')
-rwxr-xr-xbin/index61
-rwxr-xr-xbin/page12
-rwxr-xr-xbin/write-atomic21
-rwxr-xr-xbin/write-ifchanged25
4 files changed, 0 insertions, 119 deletions
diff --git a/bin/index b/bin/index
deleted file mode 100755
index c3ac2ff..0000000
--- a/bin/index
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-require 'util'
-require 'yaml'
-
-# ARGV[0]
-type = ARGV.shift
-template = "bin/index.#{type}.erb"
-erb = ERB.new(File.read(template));
-erb.filename = template
-
-# ARGV[1]
-@path = ARGV.shift
-webpath = (@path+'/').sub(/^(src|out)\//, '/')
-if type == 'atom'
- webpath += 'index.atom'
-end
-@url = URI::parse('https://www.andrewdm.me/') + webpath
-
-indexyaml = @path.sub('out', 'src')+'/index.yaml'
-if File.exists?(indexyaml)
- metadata = YAML::load(File.read(indexyaml))
-else
- metadata = {}
-end
-
-@pages = []
-for data in metadata['external']
- @pages.push(ExternPage.new(data))
-end
-
-# ARGV[2..]
-for filename in ARGV do
- @pages.push(Page.new(filename))
-end
-
-# main
-@title = metadata['title'] || @path.sub('out', '')
-
-def guess_section(page)
- for path in @sections.keys do
- if @url.route_to(page.url).to_s.start_with?(path+'/')
- return path
- end
- end
- return ''
-end
-
-@sections = { '' => {'head' => '', 'body' => []} }
-(metadata['sections'] || []).each do |path, name|
- @sections[path] = {
- 'head' => name,
- 'body' => []
- }
-end
-for page in @pages do
- section = page.section || guess_section(page)
- @sections[section]['body'].push(page)
-end
-
-erb.run()
diff --git a/bin/page b/bin/page
deleted file mode 100755
index e2d4f38..0000000
--- a/bin/page
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-require 'util'
-require 'uri'
-
-template = "bin/page.#{ARGV[0]}.erb"
-@page = Page.new(ARGV[1])
-@url = URI::parse('https://www.andrewdm.me/') + @page.absoutpath
-
-erb = ERB.new(File.read(template));
-erb.filename = template
-erb.run()
diff --git a/bin/write-atomic b/bin/write-atomic
deleted file mode 100755
index efb2551..0000000
--- a/bin/write-atomic
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (C) 2015-2016 Luke Shumaker
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-outfile=$1
-tmpfile="$(dirname "$outfile")/.tmp${outfile##*/}"
-
-cat > "$tmpfile" || { r=$?; rm -f "$tmpfile"; exit $r; }
-mv -f "$tmpfile" "$outfile"
diff --git a/bin/write-ifchanged b/bin/write-ifchanged
deleted file mode 100755
index 185ceb0..0000000
--- a/bin/write-ifchanged
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-# Copyright (C) 2015 Luke Shumaker
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-outfile=$1
-tmpfile="$(dirname "$outfile")/.tmp${outfile##*/}"
-
-cat > "$tmpfile" || exit $?
-if cmp -s "$tmpfile" "$outfile"; then
- rm -f "$tmpfile" || :
-else
- mv -f "$tmpfile" "$outfile"
-fi