My Own Ruby Learning Ruby Here and There


Hello Menik ! This post was generated using rake task

how to use

open your terminal and type :

rake post:create

then enter your desired title

you are free to edit the template. just go to lib/tasks/post.rake and change whatever you want in :

File.open(filename, 'w') do |post|
  post.puts "---"
  post.puts "layout: post"
  post.puts "title: \"#{title.gsub(/&/,'&')}\""
  post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M:%S %z')}"
  post.puts "comments: true"
  post.puts "categories: "
  post.puts "tags: "
  post.puts "---"
end

comments powered by Disqus