forked from ELLIOTTCABLE/git-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile.rb
More file actions
21 lines (18 loc) · 704 Bytes
/
Rakefile.rb
File metadata and controls
21 lines (18 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'rubygems'
require 'fileutils'
include FileUtils
$:.unshift File.expand_path('./lib')
require 'git-blog/core'
desc 'Create a new git-blog'
task :create, :destination do |_, params|
destination = params[:destination].nil? ? './blog' : params[:destination]
destination = File.expand_path destination
mkdir destination rescue nil
File.open destination/:Rakefile.rb, File::RDWR|File::TRUNC|File::CREAT do |rakefile|
rakefile.puts "$:.unshift File.expand_path('#{GitBlog::Scope / :lib}')"
rakefile.puts "require 'git-blog'"
rakefile.print "\n"; rakefile.close
end
puts "** git-blog created at #{destination}!"
puts "** now `cd #{destination}` and `rake initialize`!"
end