blob: 941b1b5ca57fcdff6f26ec7827ef0689b2e5550d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
require 'Justicar'
require 'opal-browser'
desc "Build your website"
task :build do
Justicar.load_preprocessors('src')
Justicar.build_source('src')
Justicar.build_initialize('build', 'public')
end
desc "Create a server and open your site in your browser"
task :serve do
link = "http://localhost:8000/index.html"
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
system "start #{link}"
elsif RbConfig::CONFIG['host_os'] =~ /darwin/
system "open #{link}"
elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/
system "xdg-open #{link}"
end
`ruby -run -ehttpd build -p8000`
end
|