class Dir

Public Class Methods

restricted?( dir, excludes=[] ) click to toggle source

check if directed is restricted

# File lib/ckfiles/libs.rb, line 4
def Dir.restricted?( dir, excludes=[] )
        rdirs = [
                /\.Trash/, /\.Trashes/, /\.fseventsd/, /\.Spotlight-V100/, /\.DocumentRevisions-V100/,
                /\.git/,
                /\/\./,
                /\.\$EXTEND/,
                /_SYNCAPP/,
                /Corrupted/,
                /System Volume Information/, /RECYCLER/,
                /backup/i,
                /\/Library\//,
                /\.sparsebundle/,
                /\.tmpdir/, /\.tmp7z/,
                /\.AppleDouble/
        ]

        for word in rdirs - excludes
            return true if dir.match( word )
    end
    return false
end