From 98215fe4883c1c0c7a9baa567688f29a46bbcad6 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Tue, 14 Jul 2009 00:08:58 -0700 Subject: [PATCH] rename File.exists? to File.exist? exists? is marked as obsolete in the API doc [madx] --- lib/fakefs.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/fakefs.rb b/lib/fakefs.rb index 2534f36..52ab82b 100644 --- a/lib/fakefs.rb +++ b/lib/fakefs.rb @@ -95,7 +95,7 @@ module FakeFS def chown_R(user, group, list, options={}) chown(user, group, list, options={}) end - + def touch(list, options={}) Array(list).each do |f| directory = File.dirname(f) @@ -116,10 +116,14 @@ module FakeFS parts * PATH_SEPARATOR end - def self.exists?(path) + def self.exist?(path) FileSystem.find(path) || false end + class << self + alias_method :exists?, :exist? + end + def self.directory?(path) if path.respond_to? :entry path.entry.is_a? MockDir