Replace multiple dashes with one dash
This commit is contained in:
parent
6af9258861
commit
948a9eeca2
2
ext/post
2
ext/post
|
@ -20,7 +20,7 @@ end
|
||||||
|
|
||||||
filename = Time.now.strftime("%Y-%m-%d-") + ARGV.map { |arg|
|
filename = Time.now.strftime("%Y-%m-%d-") + ARGV.map { |arg|
|
||||||
arg.downcase.gsub(/[^a-z0-9]/, '-')
|
arg.downcase.gsub(/[^a-z0-9]/, '-')
|
||||||
}.join('-').gsub(/--+/, '').gsub(/-$/, '')
|
}.join('-').gsub(/--+/, '-').gsub(/-$/, '')
|
||||||
title = ARGV.join(' ')
|
title = ARGV.join(' ')
|
||||||
file = File.join(OUTPUT_DIR, "#{filename}#{EXTENSION}")
|
file = File.join(OUTPUT_DIR, "#{filename}#{EXTENSION}")
|
||||||
date = Time.now.strftime("%d.%m.%Y %H:%M")
|
date = Time.now.strftime("%d.%m.%Y %H:%M")
|
||||||
|
|
Loading…
Reference in a new issue