Sha256: 4a98471009995beab71c727043a8fe09949c0607d49aea7d10e9fcc212b91a1c

Contents?: true

Size: 318 Bytes

Versions: 22

Compression:

Stored size: 318 Bytes

Contents

class NSString

  def document
    @@docs ||= NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0]
    return self if self.hasPrefix(@@docs)

    @@docs.stringByAppendingPathComponent(self)
  end

  def exists?
    NSFileManager.defaultManager.fileExistsAtPath(self.document)
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
sugarcube-0.7.2 lib/sugarcube/document.rb
sugarcube-0.7.1 lib/sugarcube/document.rb