Sha256: 84cd369493ea407200addc14f52efeec02b3abae3fa8fea13beb0bffbad9f4e2

Contents?: true

Size: 1.33 KB

Versions: 66

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

66 entries across 66 versions & 1 rubygems

Version Path
fastlane-2.74.1 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.74.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.74.0.beta.20180108010004 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.74.0.beta.20180107010004 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.74.0.beta.20180106010004 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.73.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.73.0.beta.20180105010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.73.0.beta.20180104010004 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.73.0.beta.20180103010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.72.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.72.0.beta.20180102010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.72.0.beta.20180101010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.72.0.beta.20171231010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.71.1 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.72.0.beta.20171230010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.72.0.beta.20171229010003 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.72.0.beta.20171228010004 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.71.0 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.71.0.beta.20171227010004 spaceship/lib/spaceship/tunes/app_version_common.rb
fastlane-2.71.0.beta.20171226010004 spaceship/lib/spaceship/tunes/app_version_common.rb