From 7e888980b92693a6b46e2f9fe4f280db5c087894 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 1 Sep 2012 14:02:10 +0100 Subject: [PATCH] Include HHMM in generated HTML and RSS, and make RSS item timestamps more precise --- html/index.erb | 2 +- html/updates.rss.erb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/html/index.erb b/html/index.erb index 1e688d8c..5d4ca7fc 100644 --- a/html/index.erb +++ b/html/index.erb @@ -18,7 +18,7 @@ data = archive_json.keys.sort.map do |pkgname| versions, deps, descr, pkgtype = archive_json[pkgname] - version = versions.max.to_s + version = versions.join('.') pkgurl = "packages/#{pkgname}-#{version}." + (pkgtype == "single" ? "el" : "tar") recipe_url = "https://github.com/milkypostman/melpa/blob/master/recipes/#{pkgname}" source = 'unknown' diff --git a/html/updates.rss.erb b/html/updates.rss.erb index 4f605f3b..f299b968 100644 --- a/html/updates.rss.erb +++ b/html/updates.rss.erb @@ -17,11 +17,12 @@ require 'ostruct' JSON.parse(File.open("../archive.json").read).each do |pkgname, info| versions, deps, descr, pkgtype = info - version = versions.max.to_s + version = versions.join('.') package = OpenStruct.new package.name = pkgname package.version = version - package.build_time = Time.new(version[0..3].to_i, version[4..5].to_i, version[6..7].to_i) + hour_portion = sprintf("%04d", versions[1]) + package.build_time = Time.new(version[0..3].to_i, version[4..5].to_i, version[6..7].to_i, hour_portion[0..1].to_i, hour_portion[2..3].to_i) package.url = "#{base_url}packages/#{pkgname}-#{version}." + (pkgtype == "single" ? "el" : "tar") package.info_url = "#{base_url}##{pkgname}" %>