From 0f52b2115a5f910ae4d3350f7400bb11622ea899 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Sun, 2 Dec 2018 01:34:29 -0800 Subject: Remove current web backend Preparing for WebAssembly --- bin/ruby2d | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'bin') diff --git a/bin/ruby2d b/bin/ruby2d index 2af7bee..5ed6552 100755 --- a/bin/ruby2d +++ b/bin/ruby2d @@ -115,38 +115,6 @@ end # Build a web-based version of the provided Ruby application def build_web(rb_file) puts "Warning: ".warn + "This feature is currently disabled while it's being upgraded." - return - - check_build_src_file(rb_file) - - # Assemble the Ruby 2D library in one `.rb` file and compile to JS - make_lib - `opal --compile --no-opal build/lib.rb > build/lib.js` - - # Read the provided Ruby source file, copy to build dir, and compile to JS - File.open('build/src.rb', 'w') { |file| file << strip_require(rb_file) } - `opal --compile --no-opal build/src.rb > build/src.js` - FileUtils.cp "#{@gem_dir}/ext/ruby2d/ruby2d-opal.rb", "build/" - `opal --compile --no-opal build/ruby2d-opal.rb > build/ruby2d-opal.js` - - # Combine contents of JS source files and compiled JS into one file - open('build/app.js', 'w') do |f| - f << File.read("#{@gem_dir}/assets/simple2d.js") << "\n\n" - f << File.read("#{@gem_dir}/assets/opal.js") << "\n\n" - f << File.read("build/lib.js") << "\n\n" - f << File.read("build/ruby2d-opal.js") << "\n\n" - f << File.read("build/src.js") << "\n\n" - end - - # Copy over HTML template - FileUtils.cp "#{@gem_dir}/assets/template.html", "build/app.html" - - # Clean up - clean_up unless @debug - - # Success! - puts "Web app created at `build/app.js`", - " Run by opening `build/app.html`" end @@ -204,7 +172,6 @@ end def clean_up(cmd = nil) FileUtils.rm( Dir.glob('build/{src,lib}.{rb,c,js}') + - Dir.glob('build/ruby2d-opal.{rb,js}') + Dir.glob('build/app.c') ) if cmd == :all -- cgit v1.2.3