class Fontina::Fetchers::LocalFileURI

Public Instance Methods

fetch(location) click to toggle source
Calls superclass method
# File lib/fontina/fetchers/local_file_uri.rb, line 8
def fetch(location)
  return super unless
    location.is_a?(URI::Generic) &&
    location.scheme == 'file' &&
    [nil, 'localhost'].include?(location.host)

  path = URI.decode location.path

  Result[IO.binread(path), File.basename(path)]
end