Sha256: f2a87fdbb5e7202c8eee82614d2a3016a2ab6befda1aa2fb1230e7fa9fb2321a

Contents?: true

Size: 602 Bytes

Versions: 7

Compression:

Stored size: 602 Bytes

Contents

module Aua::Agents::Opera
  def self.extend?(agent)
    agent.products.include?("Opera")
  end

  PATTERN = /Opera ([\d.]+)/
  PATTERN_MINI = /Opera Mini\/([\d.]+)/
  PATTERN_MOBILE = /Opera Mobi\//

  def type
    :Browser
  end

  def name
    @name ||= begin
      return :OperaMobile if app_comments_string =~ PATTERN_MOBILE
      return :OperaMini if app_comments_string =~ PATTERN_MINI
      :Opera
    end
  end

  def version
    @version ||= begin
      return $1 if app_comments[1] =~ PATTERN_MINI
      (raw =~ PATTERN && $1) || version_of("Version") || version_of("Opera")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aua-0.3.2 lib/aua/agents/opera.rb
aua-0.3.1 lib/aua/agents/opera.rb
aua-0.3.0 lib/aua/agents/opera.rb
aua-0.2.6 lib/aua/agents/opera.rb
aua-0.2.5 lib/aua/agents/opera.rb
aua-0.2.4 lib/aua/agents/opera.rb
aua-0.2.3 lib/aua/agents/opera.rb