class Sinatra::Request
def accept_entry(entry)
def accept_entry(entry) type, *options = entry.gsub(/\s/, '').split(';') quality = 0 # we sort smalles first options.delete_if { |e| quality = 1 - e[2..-1].to_f if e =~ /^q=/ } [type, [quality, type.count('*'), 1 - options.size]] end