forked from thinkshout/thinkshout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
57 lines (47 loc) · 1.26 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
require 'rubygems'
require 'rake'
require 'rdoc'
require 'date'
require 'yaml'
require 'tmpdir'
require 'jekyll'
task :default => :serve
desc 'Install dependencies'
task :install do
system 'bundle install'
unless File.exist?('package.json')
system 'npm init'
end
system 'npm install -g browser-sync'
end
desc 'Build site with Jekyll'
task :build do
system 'bundle exec sass --update -r sass-globbing assets/sass:assets/css'
system 'bundle exec jekyll build'
end
desc 'Trigger visual regression test'
task :test do
system '_scripts/trigger-circle.sh'
end
desc 'Watch sass files'
task :sasswatch do
system 'bundle exec sass -r sass-globbing --watch assets/sass:assets/css'
end
desc 'Watch jekyll files'
task :jekyllwatch do
system 'bundle exec jekyll serve --watch --baseurl="" --drafts'
end
desc 'BrowserSync for live reloading and injecting new changes'
task :browsersync do
system 'browser-sync start --proxy "localhost:4000" --files "_site/assets/*, _site/*.md, _site/*.html, _site/*.js"'
end
# Run development tasks on separate threads
task :serve do
threads = []
%w{sasswatch jekyllwatch browsersync}.each do |task|
threads << Thread.new(task) do |devtask|
Rake::Task[devtask].invoke
end
end
threads.each {|thread| thread.join}
end