lib/irb/ext/loader.rb in irb-1.6.3 vs lib/irb/ext/loader.rb in irb-1.6.4
- old
+ new
@@ -22,34 +22,11 @@
raise LoadError, "No such file to load -- #{fn}" unless path
load_file(path, priv)
end
- if File.respond_to?(:absolute_path?)
- def absolute_path?(path)
- File.absolute_path?(path)
- end
- else
- separator =
- if File::ALT_SEPARATOR
- "[#{Regexp.quote(File::SEPARATOR + File::ALT_SEPARATOR)}]"
- else
- File::SEPARATOR
- end
- ABSOLUTE_PATH_PATTERN = # :nodoc:
- case Dir.pwd
- when /\A\w:/, /\A#{separator}{2}/
- /\A(?:\w:|#{separator})#{separator}/
- else
- /\A#{separator}/
- end
- def absolute_path?(path)
- ABSOLUTE_PATH_PATTERN =~ path
- end
- end
-
def search_file_from_ruby_path(fn) # :nodoc:
- if absolute_path?(fn)
+ if File.absolute_path?(fn)
return fn if File.exist?(fn)
return nil
end
for path in $: