Sha256: 732adb0157ee5e208dda516ccfcaa4f3239537f55fb92cc6e9e8493365d3cf8f

Contents?: true

Size: 1.33 KB

Versions: 656

Compression:

Stored size: 1.33 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
          search_platform = search_platform.to_sym if search_platform

          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'].to_sym == :ios }
          elsif !search_platform.nil?
            platform = versions.detect { |p| p['platformString'].to_sym == search_platform }
          end
          platform
        end
      end
    end
  end
end

Version data entries

656 entries across 656 versions & 5 rubygems

Version Path
fastlane-2.225.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.224.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.223.1 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.223.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.222.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.221.1 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.221.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.220.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.219.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.218.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-security-patched-2.216.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.217.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.216.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.215.1 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.215.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-mercafacil-2.214.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.214.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.213.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.212.2 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane_pricing_fix-2.212.1 spaceship/lib/spaceship/tunes/app_version_common.rb