Sha256: cb0bc6cf4f5c08c0e8f62e94dbe8dd724e2dcec44edddef00a9928529226d0d1

Contents?: true

Size: 1.16 KB

Versions: 320

Compression:

Stored size: 1.16 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)
      data = client.get_build_trains(app_id: app_id, platform: platform)
      trains = {}

      data.each do |train_version|
        builds_data = client.get_builds_for_train(app_id: app_id, platform: platform, train_version: train_version, retry_count: retry_count)
        trains[train_version] = builds_data.map { |attrs| Spaceship::TestFlight::Build.new(attrs) }
      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

320 entries across 320 versions & 1 rubygems

Version Path
fastlane-2.120.0.beta.20190409200021 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190408200017 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190407200059 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190406200021 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190405200012 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190404200009 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190403200039 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190402200013 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190401200056 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190331200023 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190330200100 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190329200012 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190328200010 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190327200117 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190326200014 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.120.0.beta.20190325200020 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.119.0 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.119.0.beta.20190324200014 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.119.0.beta.20190323200019 spaceship/lib/spaceship/test_flight/build_trains.rb
fastlane-2.119.0.beta.20190322200024 spaceship/lib/spaceship/test_flight/build_trains.rb