Sha256: ea177ca1ea526c98fa77f7e693940eced5e00aaf06481d7ed911a9666ab6ea0c

Contents?: true

Size: 1.1 KB

Versions: 44

Compression:

Stored size: 1.1 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)
          # 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 for app #{app_id}" 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
            platform = versions.detect { |p| p['platformString'] == "ios" }
          end
          platform
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
spaceship-0.37.0 lib/spaceship/tunes/app_version_common.rb
spaceship-0.36.2 lib/spaceship/tunes/app_version_common.rb
spaceship-0.36.1 lib/spaceship/tunes/app_version_common.rb
spaceship-0.36.0 lib/spaceship/tunes/app_version_common.rb
spaceship-0.35.0 lib/spaceship/tunes/app_version_common.rb
spaceship-0.34.3 lib/spaceship/tunes/app_version_common.rb
spaceship-0.34.2 lib/spaceship/tunes/app_version_common.rb
spaceship-0.34.1 lib/spaceship/tunes/app_version_common.rb
spaceship-0.34.0 lib/spaceship/tunes/app_version_common.rb
spaceship-0.33.0 lib/spaceship/tunes/app_version_common.rb
spaceship-0.32.4 lib/spaceship/tunes/app_version_common.rb
spaceship-0.32.3 lib/spaceship/tunes/app_version_common.rb
spaceship-0.32.2 lib/spaceship/tunes/app_version_common.rb
spaceship-0.32.1 lib/spaceship/tunes/app_version_common.rb
spaceship-0.32.0 lib/spaceship/tunes/app_version_common.rb
spaceship-0.31.10 lib/spaceship/tunes/app_version_common.rb
spaceship-0.31.9 lib/spaceship/tunes/app_version_common.rb
spaceship-0.31.8 lib/spaceship/tunes/app_version_common.rb
spaceship-0.31.7 lib/spaceship/tunes/app_version_common.rb
spaceship-0.31.6 lib/spaceship/tunes/app_version_common.rb