Introduce --basedir to insns2vm.rb

and leverage that to preserve the directory structure under tool/ruby_vm/views
This commit is contained in:
Takashi Kokubun 2022-09-18 14:22:35 +09:00
parent 12023c833f
commit a988fe0b3e
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD
5 changed files with 18 additions and 8 deletions

View file

@ -16,10 +16,11 @@ require_relative '../models/typemap'
require_relative '../loaders/vm_opts_h'
class ApplicationController
def generate i, destdir
def generate i, destdir, basedir
path = Pathname.new i
dst = destdir ? Pathname.new(destdir).join(i) : Pathname.new(i)
dumper = RubyVM::Dumper.new dst
base = basedir ? Pathname.new(basedir) : Pathname.pwd
dumper = RubyVM::Dumper.new dst, base.expand_path
return [path, dumper]
end
end