Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Sort all the things (links by date, keys alpha, tags alpha)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarber623 committed Nov 24, 2014
1 parent 27dc03b commit 693279a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Rakefile
Expand Up @@ -22,19 +22,19 @@ def build_output_file_contents
out = {
add_date: Time.at(link['add_date'].to_i),
private: link['private'],
tags: link['tags'].split(','),
tags: link['tags'].split(',').sort,
title: link.content,
url: link['href']
}

if dd.any?
out['comment'] = dd[0].content
out[:comment] = dd[0].content.strip
end

output_file_contents.unshift(out)
output_file_contents.push(Hash[out.sort_by(&:first)].to_h)
end

output_file_contents
output_file_contents.sort_by { |item| item[:add_date] }
end

namespace :convert do
Expand Down

0 comments on commit 693279a

Please sign in to comment.