File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module Kernel
99
1010 def __DIR__ ( *paths )
1111 c = caller . first
12- return nil unless c . rindex ( /:\d +(:in ` .*')?$/ )
12+ return nil unless c . rindex ( /:\d +(:in [`'] .*')?$/ )
1313 file = $` # File.dirname(c)
1414 return nil if /\A \( (.*)\) / =~ file # eval, etc.
1515 #File.expand_path(File.join(File.dirname(file), paths))
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def callstack(level = 1)
3131 stack = [ ]
3232 call_str_array . each { |call_str |
3333 file , lineno , method = call_str . split ( ':' )
34- if method =~ /in ` (.*)'/ then
34+ if method =~ /in [`'] (.*)'/ then
3535 method = $1. intern ( )
3636 end
3737 stack << [ file , lineno . to_i , method ]
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module Kernel
1313
1414 def require_all ( pattern )
1515 c = caller . first
16- fail "Can't parse #{ c } " unless c . rindex ( /:\d +(:in ` .*')?$/ )
16+ fail "Can't parse #{ c } " unless c . rindex ( /:\d +(:in [`'] .*')?$/ )
1717 file = $` # File.dirname(c)
1818 if /\A \( (.*)\) / =~ file # eval, etc.
1919 raise LoadError , "require_relative is called in #{ $1} "
@@ -27,7 +27,7 @@ def require_all(pattern)
2727 # Same as #require_all, but for #load.
2828 def load_all ( pattern , safe = nil )
2929 c = caller . first
30- fail "Can't parse #{ c } " unless c . rindex ( /:\d +(:in ` .*')?$/ )
30+ fail "Can't parse #{ c } " unless c . rindex ( /:\d +(:in [`'] .*')?$/ )
3131 file = $` # File.dirname(c)
3232 if /\A \( (.*)\) / =~ file # eval, etc.
3333 raise LoadError , "require_relative is called in #{ $1} "
You can’t perform that action at this time.
0 commit comments