Module: GrenFileTest
- Defined in:
- lib/common/grenfiletest.rb
Constant Summary collapse
- IGNORE_FILE =
/(\A#.*#\Z)|(~\Z)|(\A\.#)|(\.d\Z)|(\.map\Z)|(\.MAP\Z)/
- IGNORE_DIR =
/(\A\.svn\Z)|(\A\.git\Z)|(\ACVS\Z)/
Class Method Summary collapse
Class Method Details
.binary?(fpath) ⇒ Boolean
15 16 17 18 |
# File 'lib/common/grenfiletest.rb', line 15 def self.binary?(fpath) s = File.read(fpath, 1024) or return false return s.index("\x00") end |
.ignoreDir?(fpath) ⇒ Boolean
7 8 9 |
# File 'lib/common/grenfiletest.rb', line 7 def self.ignoreDir?(fpath) IGNORE_DIR.match(File.basename(fpath)) end |
.ignoreFile?(fpath) ⇒ Boolean
11 12 13 |
# File 'lib/common/grenfiletest.rb', line 11 def self.ignoreFile?(fpath) IGNORE_FILE.match(File.basename(fpath)) end |