diff --git a/tool/ruby_vm/controllers/application_controller.rb b/tool/ruby_vm/controllers/application_controller.rb index 65783513e7..ba8f15a0c1 100644 --- a/tool/ruby_vm/controllers/application_controller.rb +++ b/tool/ruby_vm/controllers/application_controller.rb @@ -18,7 +18,7 @@ require_relative '../loaders/vm_opts_h' class ApplicationController def generate i, destdir path = Pathname.new i - dst = Pathname.new(destdir).join(i) + dst = destdir ? Pathname.new(destdir).join(i) : Pathname.new(i) dumper = RubyVM::Dumper.new dst return [path, dumper] end diff --git a/tool/ruby_vm/helpers/dumper.rb b/tool/ruby_vm/helpers/dumper.rb index ccd5717cc8..ae2a0145cf 100644 --- a/tool/ruby_vm/helpers/dumper.rb +++ b/tool/ruby_vm/helpers/dumper.rb @@ -25,7 +25,7 @@ class RubyVM::Dumper end def new_erb spec - path = Pathname.new(__FILE__).realpath.dirname + path = Pathname.new(__FILE__).relative_path_from(Pathname.pwd).dirname path += '../views' path += spec src = path.read mode: 'rt:utf-8:utf-8' @@ -37,7 +37,7 @@ class RubyVM::Dumper else erb = ERB.new(src, nil, '%-') end - erb.filename = path.realpath.to_path + erb.filename = path.to_path return erb end @@ -87,7 +87,7 @@ class RubyVM::Dumper def initialize dst @erb = {} @empty = new_binding - @file = cstr dst.realdirpath.to_path + @file = cstr dst.to_path end def render partial, opts = { :locals => {} } diff --git a/tool/ruby_vm/helpers/scanner.rb b/tool/ruby_vm/helpers/scanner.rb index 2ae5ad66b1..410b02eff5 100644 --- a/tool/ruby_vm/helpers/scanner.rb +++ b/tool/ruby_vm/helpers/scanner.rb @@ -20,10 +20,10 @@ class RubyVM::Scanner attr_reader :__LINE__ def initialize path - src = Pathname.new(__FILE__).realpath.dirname + src = Pathname.new(__FILE__).relative_path_from(Pathname.pwd).dirname src += path @__LINE__ = 1 - @__FILE__ = src.realpath.to_path + @__FILE__ = src.to_path @str = src.read mode: 'rt:utf-8:utf-8' @pos = 0 end diff --git a/tool/ruby_vm/scripts/insns2vm.rb b/tool/ruby_vm/scripts/insns2vm.rb index 4e474d9a52..564d91cd2d 100644 --- a/tool/ruby_vm/scripts/insns2vm.rb +++ b/tool/ruby_vm/scripts/insns2vm.rb @@ -15,7 +15,7 @@ require_relative '../controllers/application_controller.rb' module RubyVM::Insns2VM def self.router argv - options = { destdir: Dir.getwd } + options = { destdir: nil } targets = generate_parser(options).parse argv return targets.map do |i| next ApplicationController.new.generate i, options[:destdir]