aboutsummaryrefslogtreecommitdiffstats
path: root/tool/ruby_vm/controllers/application_controller.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-09-18 14:22:35 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2022-09-18 14:39:53 +0900
commita988fe0b3e4cd5a3955706affdc1f498ff9b5d77 (patch)
treecb8478fc417dc73bb495636b45b0393190c74926 /tool/ruby_vm/controllers/application_controller.rb
parent12023c833fb2ba3b50a34ab7f6b53f5f77d78658 (diff)
downloadruby-a988fe0b3e4cd5a3955706affdc1f498ff9b5d77.tar.gz
Introduce --basedir to insns2vm.rb
and leverage that to preserve the directory structure under tool/ruby_vm/views
Diffstat (limited to 'tool/ruby_vm/controllers/application_controller.rb')
-rw-r--r--tool/ruby_vm/controllers/application_controller.rb5
1 files changed, 3 insertions, 2 deletions
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