From 1fbddef75580cfaf6b25a1d328b29225ef563ed7 Mon Sep 17 00:00:00 2001 From: realtradam Date: Wed, 12 Jan 2022 11:37:53 -0500 Subject: added rake serve task to show game in browser --- Rakefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Rakefile b/Rakefile index b7c8e2d..f69f0f1 100644 --- a/Rakefile +++ b/Rakefile @@ -4,3 +4,16 @@ task :build do `env MRUBY_CONFIG=build_config/felflame_linux.rb rake` end end + +task :serve do + link = "http://localhost:8000/game.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/temp/ -p8000` +end +task :s => :serve -- cgit v1.2.3