From ce14713e865d41f0df770d430aaded9fba95bad2 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Fri, 17 Feb 2017 01:04:19 -0500 Subject: Strip `require 'ruby2d'` from source files For MRuby and Opal --- bin/ruby2d | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/ruby2d b/bin/ruby2d index 244e958..1d9ef7e 100755 --- a/bin/ruby2d +++ b/bin/ruby2d @@ -57,18 +57,22 @@ def make_lib lib << " include Ruby2D::DSL -include Ruby2D - -def require(str) - if str == 'ruby2d' - true - end -end\n" +include Ruby2D\n" File.write('build/lib.rb', lib) end +# Remove `require 'ruby2d'` from source file +def strip_require(file) + output = '' + File.foreach(file) do |line| + output << line unless line =~ /require ('|")ruby2d('|")/ + end + return output +end + + # Build a native version of the provided Ruby application def build_native(rb_file) -- cgit v1.2.3