summaryrefslogtreecommitdiff
path: root/tool/ruby_vm
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-09-18 14:16:08 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2022-09-18 14:19:22 +0900
commit62ec621f8c7457374d1f08aec97138ac1b7bdf2a (patch)
tree6b2d9d5ca834efcad3d31c973300d4e7271cecb8 /tool/ruby_vm
parent0e816e6d3022892da438940b09c4d4b49ceb670f (diff)
downloadruby-62ec621f8c7457374d1f08aec97138ac1b7bdf2a.tar.gz
Preserve the directory structure under tool/ruby_vm/views
for nested target directories
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r--tool/ruby_vm/helpers/dumper.rb3
-rw-r--r--tool/ruby_vm/views/lib/mjit/instruction.rb.erb (renamed from tool/ruby_vm/views/instruction.rb.erb)0
2 files changed, 2 insertions, 1 deletions
diff --git a/tool/ruby_vm/helpers/dumper.rb b/tool/ruby_vm/helpers/dumper.rb
index 7aec9c7631..c4294e1b3e 100644
--- a/tool/ruby_vm/helpers/dumper.rb
+++ b/tool/ruby_vm/helpers/dumper.rb
@@ -25,10 +25,11 @@ class RubyVM::Dumper
end
def new_erb spec
+ srcdir = Pathname.new(__dir__).parent.parent.parent
path = Pathname.new(__FILE__)
path = (path.relative_path_from(Pathname.pwd) rescue path).dirname
path += '../views'
- path += File.basename(spec)
+ path += Pathname.pwd.join(spec).to_s.sub("#{srcdir}/", '')
src = path.read mode: 'rt:utf-8:utf-8'
rescue Errno::ENOENT
raise "don't know how to generate #{path}"
diff --git a/tool/ruby_vm/views/instruction.rb.erb b/tool/ruby_vm/views/lib/mjit/instruction.rb.erb
index 1c462de53a..1c462de53a 100644
--- a/tool/ruby_vm/views/instruction.rb.erb
+++ b/tool/ruby_vm/views/lib/mjit/instruction.rb.erb