From a988fe0b3e4cd5a3955706affdc1f498ff9b5d77 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sun, 18 Sep 2022 14:22:35 +0900 Subject: Introduce --basedir to insns2vm.rb and leverage that to preserve the directory structure under tool/ruby_vm/views --- tool/ruby_vm/controllers/application_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tool/ruby_vm/controllers') diff --git a/tool/ruby_vm/controllers/application_controller.rb b/tool/ruby_vm/controllers/application_controller.rb index 25c10947ed..e03e54e397 100644 --- a/tool/ruby_vm/controllers/application_controller.rb +++ b/tool/ruby_vm/controllers/application_controller.rb @@ -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 -- cgit v1.2.3