open last log entry

master
muflax 2012-04-14 13:57:18 +02:00
parent 3208bcfbf5
commit d846ffa5fb
1 changed files with 19 additions and 0 deletions

19
commands/last.rb Normal file
View File

@ -0,0 +1,19 @@
usage 'last'
summary 'open last page'
description 'Opens last page in Emacs.'
module Nanoc::CLI::Commands
class Compress < ::Nanoc::CLI::CommandRunner
def run
page = Dir['content_daily/log/*.mkd'].map do |l|
[l.match(/\/(\d+).mkd$/)[1].to_i, l]
end.sort.last[1]
puts "editing: #{page}..."
system "emacs-gui #{page}"
end
end
end
runner Nanoc::CLI::Commands::Compress