Methods
Public Instance methods
[ show source ]
# File lib/folio/document.rb, line 36 def delete ; ::File.delete(path) ; end
[ show source ]
# File lib/folio/document.rb, line 23 def executable? ; ::FileTest.executable?(path) ; end
[ show source ]
# File lib/folio/document.rb, line 24 def executable_real? ; ::FileTest.executable_real?(path) ; end
[ show source ]
# File lib/folio/document.rb, line 17 def file? ; true ; end
[ show source ]
# File lib/folio/document.rb, line 7 def intialize(path) super raise FileNotFound unless ::File.file?(@path) raise FileNotFound if ::File.symlink?(@path) end
[ show source ]
# File lib/folio/document.rb, line 42 def open(mode, &block) ::File.open(path, mode, &block) end
[ show source ]
# File lib/folio/document.rb, line 30 def read ; ::File.read(path) ; end
[ show source ]
# File lib/folio/document.rb, line 32 def readlines ; ::File.readlines(path) ; end
[ show source ]
# File lib/folio/document.rb, line 46 def truncate(size) ::File.open(path, 'w'){|f| f.truncate(size)} end
TODO: how to handle unkinking (b/c file no longer exists)
[ show source ]
# File lib/folio/document.rb, line 35 def unlink ; ::File.unlink(path) ; end