diff options
author | Takashi Kokubun <[email protected]> | 2022-09-18 14:16:08 +0900 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2022-09-18 14:19:22 +0900 |
commit | 62ec621f8c7457374d1f08aec97138ac1b7bdf2a (patch) | |
tree | 6b2d9d5ca834efcad3d31c973300d4e7271cecb8 /tool/ruby_vm/helpers | |
parent | 0e816e6d3022892da438940b09c4d4b49ceb670f (diff) |
Preserve the directory structure under tool/ruby_vm/views
for nested target directories
Diffstat (limited to 'tool/ruby_vm/helpers')
-rw-r--r-- | tool/ruby_vm/helpers/dumper.rb | 3 |
1 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}" |