From f13c41b78df947b862370470fbcbb62fb8b80d85 Mon Sep 17 00:00:00 2001 From: muflax Date: Wed, 30 May 2012 06:55:19 +0200 Subject: [PATCH] fix with latest wc changes --- commands/last.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/commands/last.rb b/commands/last.rb index fa9293e..b48dd66 100644 --- a/commands/last.rb +++ b/commands/last.rb @@ -5,11 +5,19 @@ description 'Opens last page in Emacs.' module Nanoc::CLI::Commands class Last < ::Nanoc::CLI::CommandRunner def run - page = daily_logs.last + site = load_site "daily" + + logs = site.items_by_date.select do |i| + i.reps.any? {|r| r.name == :wordcount} + end + + page = logs.last[:filename] puts "editing: #{page}..." system "emacs-gui #{page}" end end + + end runner Nanoc::CLI::Commands::Last