Sha256: af8ff5abed1d563716bdc5d053ef16889ec2f041825b107c5ee747eef08f7ffa

Contents?: true

Size: 1.26 KB

Versions: 20

Compression:

Stored size: 1.26 KB

Contents

require_relative 'base'
require_relative 'build'

module Spaceship::TestFlight
  class BuildTrains < Base
    ##
    # BuildTrains represent the collection of builds for a `train_version`
    #
    # Note: builds returned by BuildTrains are _partially_ complete. Properties
    # such as `exportCompliance`, `testInfo` and many others are not provided.
    # It is the responsibility of Build to lazy-load the necessary properties.
    #
    # See `Spaceship::TestFlight::Build#reload`

    def self.all(app_id: nil, platform: nil, retry_count: 3)
      resps = Spaceship::ConnectAPI.get_builds(filter: { app: app_id, processingState: "VALID,PROCESSING,FAILED,INVALID" }, limit: 100, sort: "uploadedDate", includes: "preReleaseVersion,app").all_pages
      connect_builds = resps.map(&:to_models).flatten

      trains = {}
      connect_builds.each do |connect_build|
        train_version = connect_build.app_version
        trains[train_version] ||= []
        trains[train_version] << connect_build.to_testflight_build
      end

      self.new(trains)
    end

    def initialize(trains = {})
      @trains = trains
    end

    def get(key)
      @trains[key]
    end
    alias [] get

    def values
      @trains.values
    end

    def versions
      @trains.keys
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
fastlane-2.127.0.beta.20190709200015 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190708200031 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane_iac_publish-0.1.4 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane_iac_publish-0.1.3 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane_iac_publish-0.1.2 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190707200017 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane_iac_publish-0.1.1 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190706200054 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190705200056 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190704200049 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane_iac_publish-0.1.0 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190703200032 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190701200019 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190630200023 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190629200029 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190628200030 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190627200058 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190625200058 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0.beta.20190624200045 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.126.0 spaceship/lib/spaceship/test_flight/build_trains.rb