Skip to content

Commit dc277a3

Browse files
committed
fix break syntax for ruby <3.4
1 parent 94b049e commit dc277a3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/device_detector/parser/client/abstract_client_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def parse
1919

2020
regex, matches = regexes.detect do |regex|
2121
match = match_user_agent_r(regex[:regex])
22-
match ? break [regex, match] : nil
22+
break [regex, match] if match
2323
end
2424

2525
next nil unless regex

lib/device_detector/parser/client/browser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def parse_browser_from_user_agent
881881
regex, matches = regex_from_user_agent_cache do
882882
regexes.detect do |regex|
883883
match = match_user_agent_r(regex[:regex])
884-
match ? break [regex, match] : nil
884+
break [regex, match] if match
885885
end
886886
end
887887

lib/device_detector/parser/operating_system.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def parse_os_from_user_agent
530530
os_regex, matches = regex_from_user_agent_cache do
531531
regexes.detect do |regex|
532532
match = match_user_agent_r(regex[:regex])
533-
match ? break [regex, match] : nil
533+
break [regex, match] if match
534534
end
535535
end
536536

0 commit comments

Comments
 (0)