summaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
authorTom Black <[email protected]>2018-12-02 01:34:29 -0800
committerTom Black <[email protected]>2018-12-12 00:04:19 -0800
commit0f52b2115a5f910ae4d3350f7400bb11622ea899 (patch)
tree843cfd6db52bb812116ebee1e7655a2ba0feed93 /bin
parent80a2c9b1e14b5ed6a68107db407568e63547ac8d (diff)
downloadruby2d-0f52b2115a5f910ae4d3350f7400bb11622ea899.tar.gz
ruby2d-0f52b2115a5f910ae4d3350f7400bb11622ea899.zip
Remove current web backend
Preparing for WebAssembly
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ruby2d33
1 files changed, 0 insertions, 33 deletions
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