def parse_q_values(values)
      values.to_s.split(/\s*,\s*/).map do |part|
        value, parameters = part.split(/\s*;\s*/, 2)
        quality = 1.0
        if md = /\Aq=([\d.]+)/.match(parameters)
          quality = md[1].to_f
        end
        [value, quality]
      end
    end
def parse_q_values(values)
      values.to_s.split(/\s*,\s*/).map do |part|
        value, parameters = part.split(/\s*;\s*/, 2)
        quality = 1.0
        if md = /\Aq=([\d.]+)/.match(parameters)
          quality = md[1].to_f
        end
        [value, quality]
      end
    end
Internal: Parse Accept header quality values.

 values - String e.g. "application/javascript"

 Adapted from Rack::Utils#q_values. Quality values are
 described in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

    parse_q_values("application/javascript")
      # => [["application/javascript", 1.0]]

    parse_q_values("*/*")
      # => [["*/*", 1.0]]

    parse_q_values("text/plain; q=0.5, image/*")
      # => [["text/plain", 0.5], ["image/*", 1.0]]

    parse_q_values("application/javascript, text/css")
      # => [["application/javascript", 1.0], ["text/css", 1.0]]

 Returns an Array of [String, Float].