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.11 lib/sugarcube/document.rb
sugarcube-0.10 lib/sugarcube/document.rb
sugarcube-0.9.4 lib/sugarcube/document.rb
sugarcube-0.9.3 lib/sugarcube/document.rb
sugarcube-0.9.2 lib/sugarcube/document.rb
sugarcube-0.9.1 lib/sugarcube/document.rb
sugarcube-0.9 lib/sugarcube/document.rb
sugarcube-0.8.7 lib/sugarcube/document.rb
sugarcube-0.8.6 lib/sugarcube/document.rb
sugarcube-0.8.5 lib/sugarcube/document.rb
sugarcube-0.8.4 lib/sugarcube/document.rb
sugarcube-0.8.3 lib/sugarcube/document.rb
sugarcube-0.8.2 lib/sugarcube/document.rb
sugarcube-0.8.1 lib/sugarcube/document.rb
sugarcube-0.8 lib/sugarcube/document.rb
sugarcube-0.7.9 lib/sugarcube/document.rb
sugarcube-0.7.7 lib/sugarcube/document.rb
sugarcube-0.7.6 lib/sugarcube/document.rb
sugarcube-0.7.4 lib/sugarcube/document.rb
sugarcube-0.7.3 lib/sugarcube/document.rb