module Rouge::Guessers::Util

def get_source(source)

Returns:
  • (String) -

Parameters:
  • source (String, IO) --
def get_source(source)
  if source.respond_to?(:to_str)
    SourceNormalizer.normalize(source.to_str)
  elsif source.respond_to?(:read)
    SourceNormalizer.normalize(source.read)
  else
    raise ArgumentError, "Invalid source: #{source.inspect}"
  end
end

def test_glob(pattern, path)

def test_glob(pattern, path)
  File.fnmatch?(pattern, path, File::FNM_DOTMATCH | File::FNM_CASEFOLD)
end