Sha256: bb537b2d692b46000080ab038c711ec5b3327d99d7f9e9854f1715cd98081a0c

Contents?: true

Size: 1.25 KB

Versions: 402

Compression:

Stored size: 1.25 KB

Contents

module Spaceship
  module Tunes
    # internal to spaceship
    # Represents the common structure between application['versionSets'] and app_version['platform']
    class AppVersionCommon
      class << self
        def find_version_id(platform, is_live)
          version = platform[(is_live ? 'deliverableVersion' : 'inFlightVersion')]
          return nil unless version
          version['id']
        end

        def find_platform(versions, search_platform: nil)
          # We only support platforms that exist ATM
          platform = versions.detect do |p|
            ['ios', 'osx', 'appletvos'].include? p['platformString']
          end

          raise "Could not find platform 'ios', 'osx' or 'appletvos'" unless platform

          # If your app has versions for both iOS and tvOS we will default to returning the iOS version for now.
          # This is intentional as we need to do more work to support apps that have hybrid versions.
          if versions.length > 1 && search_platform.nil?
            platform = versions.detect { |p| p['platformString'] == "ios" }
          elsif !search_platform.nil?
            platform = versions.detect { |p| p['platformString'] == search_platform }
          end
          platform
        end
      end
    end
  end
end

Version data entries

402 entries across 402 versions & 2 rubygems

Version Path
fastlane-2.57.0.beta.20170916010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.57.0.beta.20170915010002 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.57.0.beta.20170914010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.57.0.beta.20170913010002 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170912010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170911010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170910010002 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170909010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170908010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170907010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170906010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170905010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170904010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170903010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170902010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.56.0.beta.20170901010002 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.55.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.55.0.beta.20170831010002 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.54.4 spaceship/lib/spaceship/tunes/app_version_common.rb