-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRakefile
More file actions
55 lines (49 loc) · 1.33 KB
/
Copy pathRakefile
File metadata and controls
55 lines (49 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'rubygems'
require 'lib/tools/import'
require "lib/tools/configuration"
require "yaml"
require 'rexml/document'
require 'time'
require 'pp'
task :clean do
%x(rm -Rf datastore)
end
task :test do
%x(mkdir db) unless File.exist?("db")
%x(mkdir db/test) unless File.exist?("db/test")
Dir.glob("test/test_*.rb").each do |file|
sh("ruby #{file}")
end
end
task :install do
sh("sudo gem install rack rdiscount haml builder feedvalidator validatable english daemons")
sh("git submodule init")
sh("git submodule update")
end
desc "Create initial configuration"
task :configure do
Bliki::Configuration::configure "config.sample.yml", "config.yml"
end
namespace :import do
begin
require 'lib/stone/lib/stone'
rescue LoadError
false
end
desc "Clean imported data in DB=environment (default: development)"
task :clean do
%x(rm -Rf db/#{ENV['DB'] || 'development'}/*)
end
desc "Import posts from WordPress in DB=environment (default: development)"
task :wordpress => :clean do
import_wordpress_content(ENV['FILE'] || "db/wordpress.xml", ENV['DB'] || 'development')
end
desc "Import comments from WordPress XML in DB=environment (default: development)"
task :comments => :clean do
import_wordpress_comments()
end
# task :models do
# update_model_files
# end
end
task :default => :test