Sha256: 54a5f78c977d3d6f6d3cf1bd3f3389b93c440003e2d759ce3c7507c888bd3107

Contents?: true

Size: 1.24 KB

Versions: 238

Compression:

Stored size: 1.24 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)
      filter_platform = Spaceship::ConnectAPI::Platform.map(platform) if platform
      connect_builds = Spaceship::ConnectAPI::Build.all(
        app_id: app_id,
        sort: "uploadedDate",
        platform: filter_platform
      )

      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

238 entries across 238 versions & 5 rubygems

Version Path
fastlane-2.128.0 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190722200021 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190721200024 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190720200049 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane_iac_publish-0.1.5 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.2 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190719200019 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190718200101 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190717200026 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190716200022 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190715200056 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190714200028 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190713200107 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190712200059 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190711200117 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.1 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.128.0.beta.20190710200106 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.127.0 spaceship/lib/spaceship/test_flight/build_trains.rb