Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Fix for File.exists?('abcd') when 'abcd' does not exist, but 'cd' doe…
Browse files Browse the repository at this point in the history
…s [TORQUE-445]
  • Loading branch information
tobias committed Jun 9, 2011
1 parent e331af3 commit d1530a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/vfs/vfs-gem/lib/torquebox/vfs.rb
Expand Up @@ -41,17 +41,17 @@ def self.resolve_within_archive(path)
path = path.to_s
return path if ( path =~ %r(^vfs:) )
cur = path
trim_size = cur.length
while ( cur != '.' && cur != '/' )
if ( ::File.exist_without_vfs?( cur ) )

child_path = path[cur.length..-1]

child_path = path[trim_size..-1]
if ( cur[-1,1] == '/' )
cur = cur[0..-2]
end
return TorqueBox::VFS.resolve_path_url( cur ), child_path
end
cur = ::File.dirname( cur )
trim_size = cur.length
cur << '/' unless cur[-1,1] == '/'
end
nil
Expand Down
1 change: 0 additions & 1 deletion components/vfs/vfs-gem/spec/file_spec.rb
Expand Up @@ -21,7 +21,6 @@
end

it "should not report a file is there when it's not" do
# this fails due to the existence of the spec/ dir
File.exists?(".rspec").should be_false
end

Expand Down

0 comments on commit d1530a7

Please sign in to comment.