lib/sane/require_relative.rb in sane-0.20.0 vs lib/sane/require_relative.rb in sane-0.20.1
- old
+ new
@@ -2,10 +2,12 @@
module Kernel
module_function
def require_relative(relative_feature)
c = caller.first
- e = c.rindex(/:\d+:in /)
+ # could be spec.sane.rb:127
+ # or e:/abc.rb:127
+ e = c.rindex(/:\d+/)
file = $`
if /\A\((.*)\)/ =~ file # eval, etc.
raise LoadError, "require_relative is called in #{$1}"
end
absolute_feature = File.expand_path(File.join(File.dirname(file), relative_feature))
\ No newline at end of file