lib/aua-mite/agents/anytime.rb in aua-mite-0.0.6 vs lib/aua-mite/agents/anytime.rb in aua-mite-0.0.7

- old
+ new

@@ -1,9 +1,9 @@ module Aua::Agents::Anytime def self.extend?(agent) - agent.app == "Anytime" + agent.app == "Anytime" || agent.app == "anytime" end def type :ApiClient end @@ -11,18 +11,30 @@ def name :Anytime end def version - products[1] + products[1] || version_of("anytime") || version_of("Anytime") end def platform - @platform ||= app_comments.first =~ /^iPod/ ? :iPod : :iPhone + @platform ||= begin + if app_comments.first =~ /^iPod/ + :iPod + elsif app_comments.first =~ /^iPad/ + :iPad + else + :iPhone + end + end end def os_version - @os_version ||= $1 if comments[1] && (comments[1][1] || "") =~ /iPhone OS ([\d\.]+)/ + @os_version ||= if comments[1] && (comments[1][1] || "") =~ /iPhone OS ([\d\.]+)/ + $1 + elsif app_comments[1] =~ /iOS ([\d\.]+)/ + $1 + end end def os_name :iOS end \ No newline at end of file