65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/ruber/project_dir_scanner.rb', line 65
def file_in_project? file
if file.start_with? '/'
file = file.dup
return false unless file.sub! @regexp, ''
end
return nil if file.end_with? '/'
if file =~ %r{^([\w+-.]+)://(.+)}
if $1 == 'file' then file = $2
else return false
end
end
return false if @exclude_regexp =~ file
return false if @exclude_files.include? file
return true if @extensions.any?{|e| File.fnmatch?(e, file, File::FNM_DOTMATCH)}
return true if @include_regexp =~ file or @include_files.include? file
false
end
|