1
0
Fork 0
mirror of https://github.com/fmap/muflax65ngodyewp.onion synced 2024-06-02 06:46:50 +02:00
muflax65ngodyewp.onion/commands/log.rb
2012-06-05 08:05:58 +02:00

24 lines
550 B
Ruby

usage 'log'
summary 'create new log entry'
description 'Opens new log entry in Emacs.'
module Nanoc::CLI::Commands
class CreateLog < ::Nanoc::CLI::CommandRunner
def run
site = load_site "daily"
logs = site.items_by_date.select do |i|
i.reps.any? {|r| r.name == :wordcount}
end
page = "content_daily" + logs.last.identifier.gsub(/(\d+)/){|s| s.to_i + 1}.chop + ".mkd"
puts "editing: #{page}..."
system "emacs-gui #{page}"
end
end
end
runner Nanoc::CLI::Commands::CreateLog