9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/ceedling/file_finder_helper.rb', line 9
def find_file_in_collection(file_name, file_list, complain, ="")
file_to_find = nil
file_list.each do |item|
base_file = File.basename(item)
if (base_file.casecmp(file_name) == 0)
if (base_file == file_name)
file_to_find = item
break
else
blow_up(file_name, "However, a filename having different capitalization was found: '#{item}'.")
end
end
end
if file_to_find.nil?
case (complain)
when :error then blow_up(file_name, )
when :warn then gripe(file_name, )
end
end
return file_to_find
end
|