From 3d989e2caf683d8300ae4e8191b81fd6fe0c0948 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 7 Jan 2017 00:14:22 -0500 Subject: more --- lib/sitegen.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'lib/sitegen.rb') diff --git a/lib/sitegen.rb b/lib/sitegen.rb index e69de29..f565d20 100644 --- a/lib/sitegen.rb +++ b/lib/sitegen.rb @@ -0,0 +1,27 @@ +# coding: utf-8 +require 'set' + +module Sitegen + def self.init + @set = Set[] + @mk = {} + end + def self.add(page) + @set.add(page) + end + def self.pages + @set + end + def self.want(filename) + page = pages.select{|page|page.local_depends.keys.include?(filename)}.first + @mk[filename] = page + end + def self.Makefile() + str = '' + str += "all: #{@mk.keys.sort.join(' ')}\n" + @mk.each do |filename, page| + str += "#{filename}: #{page.local_depends[filename].sort.join(' ')}\n" + end + return str + end +end -- cgit v1.2.3-2-g168b