lib/bad_browser/user_agent.rb
# Helper to make regex parsing a bit friendlier. It will convert the results to
# an array and remove any nil or empty elements (or return nil if not match, the default behaviour)
Helper to make regex parsing a bit friendlier. It will convert the results to
an array and remove any nil or empty elements (or return nil if not match, the default behaviour)
Helper to make regex parsing a bit friendlier . It will convert the results to an array and remove any nil or empty elements ( or return nil if not match the default behaviour )
def match_agent(regex)
    match = @string.match regex
    return nil unless match
    match = match.to_a
    match.reject! { |m| m.nil? || m.empty? }
    match
  end
def match_agent ( regex ) match = @string . match regex return nil unless match match = match . to_a match . reject! { | m | m . nil? || m . empty? } match end
Helper to make regex parsing a bit friendlier.
Helper to make regex parsing a bit friendlier .
regex