Sha256: 46eed714317ed8a52fc5b81432dcc55d69b7c62248c26a60cb5145bacd6eae08

Contents?: true

Size: 856 Bytes

Versions: 2

Compression:

Stored size: 856 Bytes

Contents

module Percy
  module Capybara
    class Client
      module UserAgent
        def _client_info
          "percy-capybara/#{VERSION}"
        end

        def _environment_info
          [
            "percy-capybara-loader/#{loader}",
            "rails/#{_rails_version}",
            "sinatra/#{_sinatra_version}",
            "ember-cli-rails/#{_ember_cli_rails_version}",
          ].reject do |info|
            info =~ /\/$/ # reject if version is empty
          end.join('; ')
        end

        def _ember_cli_rails_version
          return unless defined? EmberCli

          require 'ember_cli/version'
          EmberCli::VERSION
        end

        def _rails_version
          Rails.version if defined? Rails
        end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
percy-capybara-3.2.0 lib/percy/capybara/client/user_agent.rb
percy-capybara-3.1.2 lib/percy/capybara/client/user_agent.rb