forked from siannopollo/plan_my_route
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
59 lines (50 loc) · 1.31 KB
/
Rakefile
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
56
57
58
59
# Taken from http://matthewbass.com/2007/03/07/overriding-existing-rake-tasks/
Rake::TaskManager.class_eval do
def remove_task(task_name)
@tasks.delete(task_name.to_s)
end
end
def remove_task(task_name)
Rake.application.remove_task(task_name)
end
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
desc 'Runs preview'
task :preview do
system 'staticmatic preview .'
end
desc 'Builds the site'
task :build => 'styles:clear' do
puts '*** Building the site ***'
system 'rm -f ./site/stylesheets/*.css && staticmatic build .'
end
desc 'Clears and generates new styles, builds and deploys'
task :deploy => :build do
puts '*** Deploying the site ***'
system 'scp -r site [email protected]:/var/www/apps/plan_my_route/'
end
namespace :styles do
desc "Clears the styles"
task :clear do
puts "*** Clearing styles ***"
system "rm -Rfv site/stylesheets/*.css"
end
desc "Generates new styles"
task :generate do
puts "*** Generating styles ***"
system "compass compile"
end
end
remove_task :jasmine
desc 'Run specs via server, and open them in Safari'
task :jasmine do
threads = []
threads << Thread.new do
sleep 1
system 'open -a Safari http://localhost:8888'
end
threads << Thread.new do
Rake::Task['jasmine:server'].invoke
end
threads.each {|t| t.join}
end