125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
# File 'lib/html_proofer/attribute/url.rb', line 125
def resolved_path
path_to_resolve = absolute_path
return @runner.resolved_paths[path_to_resolve] if @runner.resolved_paths.key?(path_to_resolve)
path_with_extension = "#{path_to_resolve}#{@runner.options[:assume_extension]}"
resolved = if @runner.options[:assume_extension] && File.file?(path_with_extension)
path_with_extension elsif File.directory?(path_to_resolve) && !unslashed_directory?(path_to_resolve)
@runner.options[:directory_index_files]
.map { |dif| File.join(path_to_resolve, dif) }
.find { |path_with_index| File.file?(path_with_index) }
elsif File.exist?(path_to_resolve)
path_to_resolve
end
@runner.resolved_paths[path_to_resolve] = resolved
resolved
end
|