lib/vfs/integration/string.rb in vfs-0.3.13 vs lib/vfs/integration/string.rb in vfs-0.3.14
- old
+ new
@@ -1,10 +1,11 @@
class String
def to_entry_on storage = nil
path = self
storage ||= Vfs.default_storage
- Vfs::Dir.new(storage, '/')[path]
+ path = "./#{path}" unless path =~ /^[\/\.\~]/
+ Vfs::Dir.new(storage, path)
end
alias_method :to_entry, :to_entry_on
def to_file_on storage = nil
to_entry_on(storage).file
\ No newline at end of file