Method: HTMLProofer::Attribute::Url#full_path

Defined in:
lib/html_proofer/attribute/url.rb

#full_pathObject



158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/html_proofer/attribute/url.rb', line 158

def full_path
  return if path.nil? || path.empty?

  base = if absolute_path?(path) # path relative to root
    # either overwrite with root_dir; or, if source is directory, use that; or, just get the source file's dirname
    @runner.options[:root_dir] || (File.directory?(@source) ? @source : File.dirname(@source))
  else
    # path relative to the file where the link is defined
    File.dirname(@filename)
  end

  File.join(base, path)
end