Skip to content

Commit

Permalink
Simpler logic to category patch
Browse files Browse the repository at this point in the history
Replace single line with cleaner, more readable Ruby.
  • Loading branch information
parnmatt committed Jan 1, 2014
1 parent 2fc2e06 commit a53b4a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ task :post do
title = ENV["title"] || "new-post"
tags = ENV["tags"] || "[]"
category = ENV["category"] || ""
category = category.empty? ? "" : "\"#{category.gsub(/-/,' ')}\""
category = "\"#{category.gsub(/-/,' ')}\"" if !category.empty?
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
begin
date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d')
Expand Down

0 comments on commit a53b4a9

Please sign in to comment.