class Rufo::FileFinder
Constants
- DEFAULT_PATTERNS
- EXCLUDE_PATTERNS
- EXTENSIONS
- FILENAMES
- RAKEFILES
Taken from github.com/ruby/rake/blob/f0a897e3fb557f64f5da59785b1a4464826f77b2/lib/rake/application.rb#L41
Attributes
excludes[R]
files_or_dirs[R]
includes[R]
Public Class Methods
new(files_or_dirs, includes: [], excludes: [])
click to toggle source
# File lib/rufo/file_finder.rb, line 36 def initialize(files_or_dirs, includes: [], excludes: []) @files_or_dirs = files_or_dirs @includes = includes @excludes = excludes end
Public Instance Methods
each() { |true, file| ... }
click to toggle source
# File lib/rufo/file_finder.rb, line 42 def each files_or_dirs.each do |file_or_dir| if Dir.exist?(file_or_dir) all_rb_files(file_or_dir).each { |file| yield [true, file] } else yield [File.exist?(file_or_dir), file_or_dir] end end end
Private Instance Methods
all_rb_files(file_or_dir)
click to toggle source
# File lib/rufo/file_finder.rb, line 56 def all_rb_files(file_or_dir) Dir.chdir(file_or_dir) do fl = build_file_list fl.to_a.map do |path| File.join(file_or_dir, path) end end end
build_file_list()
click to toggle source
# File lib/rufo/file_finder.rb, line 65 def build_file_list fl = Rufo::FileList.new(*DEFAULT_PATTERNS) fl.exclude(*EXCLUDE_PATTERNS) fl.exclude(*excludes) fl.include(*includes) fl end