lib/setup/rubyver.rb in setup-4.1.0 vs lib/setup/rubyver.rb in setup-4.2.0
- old
+ new
@@ -1,25 +1,32 @@
#
# Ruby Extensions
#
-unless File.respond_to?(:read) # Ruby 1.6 and less
- def File.read(fname)
- open(fname) {|f|
- return f.read
- }
+# Is this needed any more?
+class << File #:nodoc: all
+
+ unless respond_to?(:read) # Ruby 1.6 and less
+
+ def read(fname)
+ open(fname){ |f| return f.read }
+ end
+
end
+
+ # for corrupted Window's stat(2)
+ def dir?(path)
+ directory?((path[-1,1] == '/') ? path : path + '/')
+ end
+
end
unless Errno.const_defined?(:ENOTEMPTY) # Windows?
- module Errno
- class ENOTEMPTY
+
+ module Errno #:nodoc:
+ class ENOTEMPTY #:nodoc:
# We do not raise this exception, implementation is not needed.
end
end
-end
-# for corrupted Windows' stat(2)
-def File.dir?(path)
- File.directory?((path[-1,1] == '/') ? path : path + '/')
end