Sha256: 268edadce74dfd47b90817b21584a3710adb12d4d1da3c107ff05a9c684945e8
Contents?: true
Size: 644 Bytes
Versions: 14
Compression:
Stored size: 644 Bytes
Contents
require "rack/request" module Galakei module Request def docomo? /DoCoMo/i =~ user_agent end def au? # doesn't detect some 2G phones, but as they will be discontinued soon, doesn't really matter /KDDI/ =~ user_agent end def softbank? /^(SoftBank|Vodafone)/ =~ user_agent end def cookies? !imode_browser_1_0? end def imode_browser_1_0? if /docomo(.*\((.*;)?c(\d+)\;)?/i =~ user_agent $3.to_i < 500 else false end end def galakei? docomo? || au? || softbank? end end end Rack::Request.send :include, Galakei::Request
Version data entries
14 entries across 14 versions & 1 rubygems