From 9537fe8c91354da667fcf589929af1b2db441956 Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Wed, 22 Oct 2025 15:53:41 +0300 Subject: [PATCH] update constants --- lib/detect_browser_device.rb | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/detect_browser_device.rb b/lib/detect_browser_device.rb index 349679f5..64f4bf51 100644 --- a/lib/detect_browser_device.rb +++ b/lib/detect_browser_device.rb @@ -3,10 +3,28 @@ module DetectBrowserDevice module_function - # rubocop:disable Metrics/LineLength - MOBILE_USER_AGENT_REGEXP = /iPhone|iPod|Android.*Mobile|Opera Mini|Opera Mobi|webOS|IEMobile|Windows Phone|BlackBerry|BB10|Mobile/i - TABLET_USER_AGENT_REGEXP = /iPad|Android(?!.*Mobile)|Tablet|Kindle|PlayBook|Silk/i - # rubocop:enable Metrics/LineLength + MOBILE_USER_AGENT_REGEXP = / + iPhone | + iPod | + Android.*Mobile| + Opera\ Mini | + Opera\ Mobi | + webOS | + IEMobile | + Windows\ Phone | + BlackBerry | + BB10 | + Mobile + /ix + + TABLET_USER_AGENT_REGEXP = / + iPad | + Android(?!.*Mobile)| + Tablet | + Kindle | + PlayBook | + Silk + /ix def call(user_agent) return :mobile if mobile?(user_agent)