1
Fork 0

Replace multiple dashes with one dash

This commit is contained in:
Jan-Erik Rediger 2014-11-05 08:54:20 -05:00
parent 6af9258861
commit 948a9eeca2

View file

@ -20,7 +20,7 @@ end
filename = Time.now.strftime("%Y-%m-%d-") + ARGV.map { |arg|
arg.downcase.gsub(/[^a-z0-9]/, '-')
}.join('-').gsub(/--+/, '').gsub(/-$/, '')
}.join('-').gsub(/--+/, '-').gsub(/-$/, '')
title = ARGV.join(' ')
file = File.join(OUTPUT_DIR, "#{filename}#{EXTENSION}")
date = Time.now.strftime("%d.%m.%Y %H:%M")