Sha256: f0d69165be6a4912a02f76f6d65b1213aca5efa7725f2be8eb9ddb54139b97ac
Contents?: true
Size: 704 Bytes
Versions: 9
Compression:
Stored size: 704 Bytes
Contents
# -*- coding: utf-8 -*- module GrenFileTest IGNORE_FILE = /(\A#.*#\Z)|(~\Z)|(\A\.#)|(\.d\Z)|(\.map\Z)|(\.MAP\Z)|(\.xbm\Z)|(\.ppm\Z)|(\.ai\Z)|(\.png\Z)|(\.webarchive\Z)/ IGNORE_DIR = /(\A\.svn\Z)|(\A\.git\Z)|(\ACVS\Z)/ def self.ignoreDir?(fpath) begin IGNORE_DIR.match(File.basename(fpath)) rescue ArgumentError => e puts "[skip dir] #{fpath}: #{e.to_s}" true end end def self.ignoreFile?(fpath) begin IGNORE_FILE.match(File.basename(fpath)) rescue ArgumentError => e puts "[skip] #{fpath}: #{e.to_s}" true end end def self.binary?(fpath) s = File.read(fpath, 1024) or return false return s.index("\x00") end end
Version data entries
9 entries across 9 versions & 1 rubygems