Sha256: d069d3b77a8041a1b75da2c10ed00bb6c762183fef044935438f939ed37d3090

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

module Superbot
  DOMAIN = ENV.fetch('SUPERBOT_DOMAIN', 'superbot.cloud')

  WEBDRIVER_ENDPOINT = {
    cloud: "https://webdriver.#{DOMAIN}/webdriver/v1",
    local: "http://127.0.0.1:9515",
    local_cloud: "http://localhost:3000/webdriver/v1"
  }.freeze
  private_constant :WEBDRIVER_ENDPOINT

  SCREENSHOTS_ENDPOINT = {
    cloud: "https://peek.#{DOMAIN}/v1",
    local_cloud: "http://localhost:3002/v1"
  }.freeze
  private_constant :SCREENSHOTS_ENDPOINT

  CLOUD_TIMEOUT = 2000
  private_constant :CLOUD_TIMEOUT

  def self.test_run?
    ENV["SUPERBOT_TEST_RUN"] == "true"
  end

  def self.webdriver_endpoint(type)
    WEBDRIVER_ENDPOINT[type.to_sym]
  end

  def self.cloud_timeout
    CLOUD_TIMEOUT
  end

  def self.screenshots_url(type, session_id)
    "#{SCREENSHOTS_ENDPOINT[type.to_sym]}/#{session_id}"
  end
end

require_relative "superbot/version"
require_relative "superbot/project"
require_relative "superbot/cli"
require_relative "superbot/web"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
superbot-0.1.17 lib/superbot.rb