summaryrefslogtreecommitdiffhomepage
path: root/template/Rakefile
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-04-21 07:55:45 -0400
committerrealtradam <[email protected]>2022-04-21 07:55:45 -0400
commit8c0569bf34405dfdf0968b26f33dd70976866943 (patch)
tree321cc6e1b0840b0eebf84523dcd6486cabaab3c6 /template/Rakefile
downloadJusticar-8c0569bf34405dfdf0968b26f33dd70976866943.tar.gz
Justicar-8c0569bf34405dfdf0968b26f33dd70976866943.zip
initv0.1.0
Diffstat (limited to 'template/Rakefile')
-rw-r--r--template/Rakefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/template/Rakefile b/template/Rakefile
new file mode 100644
index 0000000..1629ff0
--- /dev/null
+++ b/template/Rakefile
@@ -0,0 +1,21 @@
+require 'Justicar'
+require 'opal-browser'
+
+desc "Build your website"
+task :build do
+ Justicar.build_source('src')
+ Justicar.build('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