Sha256: 4021645b8a3d1e6404771a22656473152ab37967365412ba776181d6f7151bca

Contents?: true

Size: 841 Bytes

Versions: 4

Compression:

Stored size: 841 Bytes

Contents

require_relative './version'

module Percy
  def self.client_info
    "percy-capybara/#{VERSION}"
  end

  def self.environment_info
    env_strings = [
      "rails/#{self._rails_version}",
      "sinatra/#{self._sinatra_version}",
      "capybara/#{self.capybara_version}",
      "ember-cli-rails/#{self._ember_cli_rails_version}",
    ].reject do |info|
      info =~ /\/$/ # reject if version is empty
    end
    env_strings.empty? ? 'unknown' : env_strings.join('; ')
  end

  def self.capybara_version
    Capybara::VERSION if defined? Capybara
  end

  def self._ember_cli_rails_version
    return unless defined? EmberCli

    require 'ember_cli/version'
    EmberCli::VERSION
  end

  def self._rails_version
    Rails.version if defined? Rails
  end

  def self._sinatra_version
    Sinatra::VERSION if defined? Sinatra
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
percy-capybara-4.3.3 lib/environment.rb
percy-capybara-4.3.2 lib/environment.rb
percy-capybara-4.3.1 lib/environment.rb
percy-capybara-4.3.0 lib/environment.rb