summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tool/ruby_vm/helpers/dumper.rb3
-rw-r--r--tool/ruby_vm/helpers/scanner.rb3
2 files changed, 4 insertions, 2 deletions
diff --git a/tool/ruby_vm/helpers/dumper.rb b/tool/ruby_vm/helpers/dumper.rb
index 00c301c01c..98104f4b92 100644
--- a/tool/ruby_vm/helpers/dumper.rb
+++ b/tool/ruby_vm/helpers/dumper.rb
@@ -25,7 +25,8 @@ class RubyVM::Dumper
end
def new_erb spec
- path = Pathname.new(__FILE__).relative_path_from(Pathname.pwd).dirname
+ path = Pathname.new(__FILE__)
+ path = (path.relative_path_from(Pathname.pwd) rescue path).dirname
path += '../views'
path += spec
src = path.read mode: 'rt:utf-8:utf-8'
diff --git a/tool/ruby_vm/helpers/scanner.rb b/tool/ruby_vm/helpers/scanner.rb
index 593271a415..ef6de8120e 100644
--- a/tool/ruby_vm/helpers/scanner.rb
+++ b/tool/ruby_vm/helpers/scanner.rb
@@ -20,7 +20,8 @@ class RubyVM::Scanner
attr_reader :__LINE__
def initialize path
- src = Pathname.new(__FILE__).relative_path_from(Pathname.pwd).dirname
+ src = Pathname.new(__FILE__)
+ src = (src.relative_path_from(Pathname.pwd) rescue src).dirname
src += path
@__LINE__ = 1
@__FILE__ = src.to_path