Permalink
Browse files

[psyde] refuses to publish future-dated posts

I've tested the patch; it works.
  • Loading branch information...
1 parent 1cae694 commit 10a3d906aae76bef6223cd94927b299f8f333080 @masak committed Apr 13, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 psyde
View
7 psyde
@@ -59,7 +59,12 @@ for dir('posts', :test( / '.markdown' $ / )) -> $markdown_filename {
%info{$key} = $value;
}
%info<created> ~~ /(\d\d\d\d) '-' (\d\d) '-' (\d\d)/;
- %info<humandate> = "$2.Int() @monthnames[$1-1], $0";
+ given Date.new("$0-$1-$2") {
+ die "Won't publish $markdown_filename which claims it was created $_"
+ when * after Date.today;
+ %info<humandate>
+ = sprintf "%d %s, %d", .day, @monthnames[.month-1], .year;
+ }
%info<url> = "$markdown_filename.subst(/'.' <-[.]>+ $/, '')";
%all_posts{%info<created>} = {
filename =>"posts/$markdown_filename",

0 comments on commit 10a3d90

Please sign in to comment.