Open yumetodo opened 5 years ago
require 'ruby2d' require('ruby2d') require'ruby2d' require %q(ruby2d) require %Q(ruby2d) %w(open3 bigdecimal ruby2d).each { |x| require(x) } %w(open3 bigdecimal ruby2d).each(&method(:require)) gem 'ruby2d' gem('ruby2d')
This will not match the regexp. There are a tonne of ways a one liner could write require.
When I replace the function like below, another error occurred.
def strip_require(file)
output = ''
f = File.open(file, "rt:BOM|utf-8")
f.each_line{ |line|
output << line unless line =~ /require ('|")ruby2d('|")/
}
return output
end
$rake test:native audio
==> Running native test: audio.rb
==> ruby2d build --clean
cleaning up...
==> ruby2d build --native test/audio.rb --debug
cc: error: `simple2d: No such file or directory
cc: error: unrecognized command line option '--libs`'
Native app created at `build/app`
==> ( cd test/ && ../build/app )
What is simple2d
command?
On pure msys2 mingw64 environment, after merge #166,
rake test:native audio
will fail (usage ofFile.foreach
).I think that we need to specify encoding as utf-8. However, I don't know how to specify encoding is best so that I just create this issue.
https://github.com/ruby2d/ruby2d/blob/43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4/lib/ruby2d/cli/build.rb#L62-L64