Sha256: 0989f077d6ac11791c76973ac10be33be9814f287fdbbb3fc6b5ce88056344f6

Contents?: true

Size: 1.85 KB

Versions: 6

Compression:

Stored size: 1.85 KB

Contents

module Establish
  class App
    attr_accessor :apple_id, :app_identifier

    module AppStatus
      # As specified by Apple: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/ChanginAppStatus.html
      PREPARE_FOR_SUBMISSION = "Prepare for Submission"
      WAITING_FOR_REVIEW = "Waiting for Review"
      IN_REVIEW = "In Review"
      UPLOAD_RECEIVED = "Upload Received"
      # PENDING_CONTRACT = "Pending Contract"
      # WAITING_FOR_EXPORT_COMPLIANCE = "Waiting for Export Compliance"
      PENDING_DEVELOPER_RELEASE = "Pending Developer Release"
      PROCESSING_FOR_APP_STORE = "Processing for App Store"
      # PENDING_APPLE_RELEASE = "Pending Apple Release"
      READY_FOR_SALE = "Ready for Sale"
      REJECTED = "Rejected"
      # METADATA_REJECTED = "Metadata Rejected"
      # REMOVED_FROM_SALE = "Removed from Sale"
      # DEVELOPER_REJECTED = "Developer Rejected" # equals PREPARE_FOR_SUBMISSION
      # DEVELOPER_REMOVED_FROM_SALE = "Developer Removed from Sale"
      # INVALID_BINARY = "Invalid Binary"
    end


    def initialize(apple_id = nil, app_identifier = nil)
      self.apple_id = apple_id
      self.app_identifier = app_identifier

      if apple_id and not app_identifier
        self.app_identifier = Establish::ItunesSearchApi.fetch_bundle_identifier(apple_id)
        Helper.log.debug "Created app with ID #{apple_id} and app_identifier #{self.app_identifier}"
      end
    end

    def itc
      @itc ||= Establish::ItunesConnect.new
    end

    def open_in_itunes_connect
      itc.open_app_page(self)
    end

    def get_app_status
      itc.get_app_status(self)
    end

    def to_s
      "#{apple_id} - #{app_identifier}"
    end

    # Destructive/Constructive meethods

    def create_new_version!(version_number)
      itc.create_new_version!(self, version_number)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
establish-0.0.25 lib/establish/app.rb
establish-0.0.24 lib/establish/app.rb
establish-0.0.23 lib/establish/app.rb
establish-0.0.22 lib/establish/app.rb
establish-0.0.21 lib/establish/app.rb
establish-0.0.20 lib/establish/app.rb