Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update stuff to use directories.

  • Loading branch information...
commit c94f10a7de9dec76a1fda21b38b35c29c4890f61 1 parent 189cdc3
@blatyo authored
View
12 Rakefile
@@ -3,22 +3,20 @@ require 'date'
desc "Create a new file with title as file name"
task :draft do
title = ENV['title']
- system %Q[touch "#{title}.md"]
+ system %Q[touch "draft/#{title}.md"]
end
desc "Add date stamp to file name so that it will be picked up as published"
task :publish do
old_file_name = ENV['article']
- category = ENV['category'] ? "[#{ENV['category']}]" : ""
- tags = ENV['tags'] ? "[#{ENV['tags']}]" : ""
- if old_file_name =~ /^(.+\/)?(.+)(\.md)$/
+ if old_file_name =~ /\Adraft\/(.+)(\.md)$/
date = Date.today.strftime("%Y-%m-%d")
- new_file_name = %Q|#{$1}#{date} #{$2}#{category}#{tags}#{$3}|
+ new_file_name = "published/#{date} #{$1}#{$2}"
- system %Q[git mv "#{old_file_name}" "#{new_file_name}"]
- system %Q[git commit -m "Publish #{$2}"]
+ system 'git mv "#{old_file_name}" "#{new_file_name}"'
+ system %(git commit -m "Published #{$1}")
else
raise "That's not an article!"
end
View
0  draft/.gitkeep
No changes.
View
0  published/.gitkeep
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.