Sha256: 2893289b4f137694c388086226fc04c77fe5c46a43cff7cb9020b6f3f14170a5

Contents?: true

Size: 1.08 KB

Versions: 156

Compression:

Stored size: 1.08 KB

Contents

require_relative '../client'
require_relative '../../tunes/tunes_client'

module Spaceship
  class ConnectAPI
    module TestFlight
      class Client < Spaceship::ConnectAPI::Client
        def self.instance
          # Verify there is a token or a client that can be used
          if Spaceship::ConnectAPI.token
            if @client.nil? || @client.token != Spaceship::ConnectAPI.token
              @client = Client.new(token: Spaceship::ConnectAPI.token)
            end
          elsif Spaceship::Tunes.client
            # Initialize new client if new or if team changed
            if @client.nil? || @client.team_id != Spaceship::Tunes.client.team_id
              @client = Client.client_with_authorization_from(Spaceship::Tunes.client)
            end
          end

          # Need to handle not having a client but this shouldn't ever happen
          raise "Please login using `Spaceship::Tunes.login('user', 'password')`" unless @client

          @client
        end

        def self.hostname
          'https://appstoreconnect.apple.com/iris/v1/'
        end
      end
    end
  end
end

Version data entries

156 entries across 156 versions & 2 rubygems

Version Path
fastlane-2.132.0.beta.20190917200011 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.132.0.beta.20190916200055 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.132.0.beta.20190915200038 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.132.0.beta.20190914200034 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.132.0.beta.20190913200058 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.132.0.beta.20190912200052 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190911200010 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190910200104 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190909200058 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190908200041 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190907200030 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190906200026 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190905200113 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190904200040 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190903200013 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190902200022 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190901200035 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190831200041 spaceship/lib/spaceship/connect_api/testflight/client.rb
fastlane-2.131.0.beta.20190830200038 spaceship/lib/spaceship/connect_api/testflight/client.rb