Class: Rake::Delphi::LibList
Constant Summary
Constants inherited
from FileList
FileList::IGNORE_GIT_PATTERN
Instance Method Summary
collapse
Methods inherited from FileList
get_ignored_dir_pattern
Constructor Details
#initialize(*patterns) ⇒ LibList
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/rake/delphi/liblist.rb', line 30
def initialize(*patterns)
initialize_base(patterns)
@exclude_patterns_libs = read_ignored_libs
@exclude_procs << proc do |fn|
! File.directory?(fn)
end << proc do |fn|
@exclude_patterns_libs.any? do |pat|
match = fn =~ pat
Logger.trace(Logger::TRACE, "Dir #{fn} match pattern /#{pat}/. Ignored") if match
match
end
end
end
|
Instance Method Details
#initialize_base ⇒ Object
28
|
# File 'lib/rake/delphi/liblist.rb', line 28
alias_method :initialize_base, :initialize
|
#read_ignored_libs ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/rake/delphi/liblist.rb', line 9
def read_ignored_libs
libs = []
file = (ENV['RAKE_DIR'] || Rake.original_dir) + '/.rake.ignored.libs'
unless File.exists?(file)
Logger.trace(Logger::TRACE, "File #{file} not found")
return libs
end
Logger.trace(Logger::TRACE, "Reading #{file}")
IO.readlines(file).each do |line|
if /^\s*[#;]/.match(line)
Logger.trace(Logger::TRACE, "Line #{line} ignored as a comment")
next
end
libs << FileList.get_ignored_dir_pattern(line.chomp)
end
libs
end
|