summaryrefslogtreecommitdiff
path: root/lib/irb/ext/loader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/ext/loader.rb')
-rw-r--r--lib/irb/ext/loader.rb25
1 files changed, 1 insertions, 24 deletions
diff --git a/lib/irb/ext/loader.rb b/lib/irb/ext/loader.rb
index 0a599ee802..1ab8a4e322 100644
--- a/lib/irb/ext/loader.rb
+++ b/lib/irb/ext/loader.rb
@@ -24,31 +24,8 @@ module IRB # :nodoc:
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