lib/browser_sniffer/patterns.rb in browser_sniffer-1.0.0 vs lib/browser_sniffer/patterns.rb in browser_sniffer-1.0.1
- old
+ new
@@ -94,11 +94,11 @@
], [:name, :version, :major], [
/(firefox)\/((\d+)?[\w\.-]+)/i, # Firefox
/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, # Mozilla
], [:name, :version, :major, [:type, :firefox]], [
# Other
- /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?((\d+)?[\w\.]+)/i, # UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf
+ /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|word|excel)[\/\s]?((\d+)?[\w\.]+)/i, # UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Word/Excel
/(links)\s\(((\d+)?[\w\.]+)/i, # Links
/(gobrowser)\/?((\d+)?[\w\.]+)*/i, # GoBrowser
/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, # ICE Browser
/(mosaic)[\/\s]((\d+)?[\w\.]+)/i # Mosaic
], [:name, :version, :major]
@@ -134,11 +134,11 @@
/(sprint\s(\w+))/i # Sprint Phones
], [:vendor, :model, [:type, :handheld]], [
/(htc)[;_\s-]+([\w\s_]+(?=\))|\w+)*/i, # HTC
/(zte)-(\w+)*/i, # ZTE
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i # Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
- ], [:vendor, [:model, lambda {|str| str.gsub(/_/, ' ') }], [:type, :handheld]], [
+ ], [:vendor, [:model, lambda {|str| str && str.gsub(/_/, ' ') }], [:type, :handheld]], [
/\s((milestone|droid[2x]?))[globa\s]*\sbuild\//i, # Motorola
/(mot)[\s-]?(\w+)*/i
], [[:vendor, 'Motorola'], :model, [:type, :handheld]], [
/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i
], [[:vendor, 'Motorola'], :model, [:type, :tablet]], [
@@ -224,12 +224,12 @@
], [[:name, 'Solaris'], :version], [
# BSD based
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i # FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
], [:name, :version],[
/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i # iOS
- ], [[:name, 'iOS'], [:version, lambda {|str| str.gsub(/_/, '.') }], [:type, :ios]], [
+ ], [[:name, 'iOS'], [:version, lambda {|str| str && str.gsub(/_/, '.') }], [:type, :ios]], [
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i # Mac OS
- ], [:name, [:version, lambda {|str| str.gsub(/_/, '.') }], [:type, :mac]], [
+ ], [:name, [:version, lambda {|str| str && str.gsub(/_/, '.') }], [:type, :mac]], [
# Other
/(haiku)\s(\w+)/i, # Haiku
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, # AIX
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, # Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS
/(unix)\s?([\w\.]+)*/i # UNIX