- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (-4)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
A FileList is essentially an array with a few helper methods defined to make file manipulation a bit easier.
FileLists are lazy. When given a list of glob patterns for possible files to be included in the file list, instead of searching the file structures to find the files, a FileList holds the pattern for latter use.
This allows us to define a number of FileList to match any number of files, but only search out the actual files when then FileList itself is actually used. The key is that the first time an element of the FileList/Array is requested, the pending patterns are resolved into a real list of file names.
Constants
DEFAULT_IGNORE_PROCS = [ proc { |fn| fn =~ /(^|[\/\\])core$/ && ! File.directory?(fn) } ]
DEFAULT_IGNORE_PATTERNS = [ /(^|[\/\\])CVS([\/\\]|$)/, /(^|[\/\\])\.svn([\/\\]|$)/, /\.bak$/, /~$/ ]
DELEGATING_METHODS = (ARRAY_METHODS + MUST_DEFINE - MUST_NOT_DEFINE). map { |s| s.to_s }.sort.uniq
SPECIAL_RETURN = %w[ map collect sort sort_by select find_all reject grep compact flatten uniq values_at + - & | ]
MUST_NOT_DEFINE = %w[to_a to_ary partition * <<]
MUST_DEFINE = %w[inspect <=>]
ARRAY_METHODS = (Array.instance_methods - Object.instance_methods). map { |n| n.to_s }