Sha256: cc7ef6100802152cd1d5d90a300a28ff432d29de73978feb6c6f031e799238a1

Contents?: true

Size: 657 Bytes

Versions: 3

Compression:

Stored size: 657 Bytes

Contents

# frozen_string_literal: true

module Browser
  def self.user_agents
    @user_agents ||= browser_user_agents
                     .merge(bot_user_agents)
                     .merge(search_engine_user_agents)
  end

  def self.browser_user_agents
    @browser_user_agents ||= YAML.load_file(Browser.root.join("test/ua.yml"))
  end

  def self.bot_user_agents
    @bot_user_agents ||= YAML.load_file(Browser.root.join("test/ua_bots.yml"))
  end

  def self.search_engine_user_agents
    @search_engine_user_agents ||= YAML.load_file(
      Browser.root.join("test/ua_search_engines.yml")
    )
  end

  def self.[](key)
    user_agents.fetch(key)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
browser-6.2.0 lib/browser/testing.rb
browser-6.1.0 lib/browser/testing.rb
browser-6.0.0 lib/browser/testing.rb