Sha256: 0a03b1c117186fff3a877a59e93c45bc0b72670d7418f94524baa4706f9c1bfb

Contents?: true

Size: 669 Bytes

Versions: 27

Compression:

Stored size: 669 Bytes

Contents

require 'rubygems'
require 'sauce/utilities'
require 'sauce/tunnel'
require 'sauce/job'
require 'sauce/client'
require 'sauce/config'
require 'sauce/selenium'
require 'sauce/integrations'
require 'sauce/connect'

module Sauce
  @@cached_sessions = {}

  def self.cached_session(opts)
    @@cached_sessions[opts] or new_session(opts)
  end

  private

  def self.new_session(opts)
    session = nil
    if Sauce::Config.new.local?
      session = ::Selenium::Client::Driver.new(opts)
    else
      session = Sauce::Selenium.new(opts)
    end
    at_exit do
      session.stop
    end
    session.start
    @@cached_sessions[opts] = session
    return session
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
sauce-0.20.0 lib/sauce.rb
sauce-0.19.1 lib/sauce.rb
sauce-0.19.0 lib/sauce.rb
sauce-0.18.3 lib/sauce.rb
sauce-0.18.2 lib/sauce.rb
sauce-0.18.1 lib/sauce.rb
sauce-0.18.0 lib/sauce.rb
sauce-0.17.8 lib/sauce.rb
sauce-0.17.7 lib/sauce.rb
sauce-0.17.6 lib/sauce.rb
sauce-0.17.5 lib/sauce.rb
sauce-0.17.4 lib/sauce.rb
sauce-0.17.3 lib/sauce.rb
sauce-0.17.3.alpha2 lib/sauce.rb
sauce-0.17.3.alpha1 lib/sauce.rb
sauce-0.17.2 lib/sauce.rb
sauce-0.17.1 lib/sauce.rb
sauce-0.17.0 lib/sauce.rb
sauce-0.16.2 lib/sauce.rb
sauce-0.16.1 lib/sauce.rb