whitespace

This commit is contained in:
Chris Wanstrath 2009-09-21 19:38:35 -07:00
parent a22f0c5ee6
commit 0124b3ab89
3 changed files with 7 additions and 7 deletions

View File

@ -51,7 +51,7 @@ module FakeFS
@pointer = integer
@contents[integer]
end
def self.[](pattern)
glob(pattern)
end
@ -66,7 +66,7 @@ module FakeFS
def self.delete(string)
raise SystemCallError, "No such file or directory - #{string}" unless FileSystem.find(string).values.empty?
FileSystem.delete(string)
FileSystem.delete(string)
end
def self.entries(dirname)
@ -77,7 +77,7 @@ module FakeFS
def self.foreach(dirname, &block)
Dir.open(dirname) { |file| yield file }
end
def self.glob(pattern)
[FileSystem.find(pattern) || []].flatten.map{|e| e.to_s}.sort
end

View File

@ -22,9 +22,9 @@ module FakeFS
def find(path)
parts = path_parts(normalize_path(path))
return fs if parts.empty? # '/'
entries = find_recurser(fs, parts).flatten
case entries.length
when 0 then nil
when 1 then entries.first
@ -113,6 +113,6 @@ module FakeFS
else
matches.map{|entry| find_recurser(entry, parts) }
end
end
end
end
end

View File

@ -21,7 +21,7 @@ module FakeFS
def rm(path)
FileSystem.delete(path)
end
alias_method :rm_rf, :rm
alias_method :rm_r, :rm