5 $:.unshift File.expand_path('./lib')
6 require 'git-blog/core'
8 desc 'Create a new git-blog'
9 task :create, :destination do |_, params|
10 destination = params[:destination].nil? ? './blog' : params[:destination]
11 destination = File.expand_path destination
13 mkdir destination rescue nil
14 File.open destination/:Rakefile.rb, File::RDWR|File::TRUNC|File::CREAT do |rakefile|
15 rakefile.puts "$:.unshift File.expand_path('#{GitBlog::Scope / :lib}')"
16 rakefile.puts "require 'git-blog'"
17 rakefile.print "\n"; rakefile.close
19 puts "** git-blog created at #{destination}!"
20 puts "** now `cd #{destination}` and `rake initialize`!"