class Spaceship::Tunes::Build

Represents a build which is inside the build train

def cancel_beta_review!

This will cancel the review process for this TestFlight build
def cancel_beta_review!
  client.remove_testflight_build_from_review!(app_id: self.build_train.application.apple_id,
                                               train: self.build_train.version_string,
                                        build_number: self.build_version)
end

def factory(attrs)

This is used to create a new object based on the server response.
Create a new object based on a hash.
def factory(attrs)
  self.new(attrs)
end

def setup

def setup
  super
  self.external_expiry_date ||= 0
  self.internal_expiry_date ||= 0
end

def submit_for_beta_review!(metadata)

Parameters:
  • metadata (Hash) -- A hash containing the following information (keys must be symbols):
def submit_for_beta_review!(metadata)
  # First, enable beta testing for this train (per iTC requirement)
  self.build_train.update_testing_status!(true, 'external')
  parameters = {
    app_id: self.build_train.application.apple_id,
    train: self.build_train.version_string,
    build_number: self.build_version,
    # Required Metadata:
    changelog: "No changelog provided",
    description: "No app description provided",
    feedback_email: "contact@company.com",
    marketing_url: "http://marketing.com",
    first_name: "Felix",
    last_name: "Krause",
    review_email: "contact@company.com",
    phone_number: "0123456789",
    # Optional Metadata:
    privacy_policy_url: nil,
    review_user_name: nil,
    review_password: nil,
    encryption: false
  }.merge(metadata)
  client.submit_testflight_build_for_review!(parameters)
  return parameters
end

def testing_status

Returns:
  • (String) - A nicely formatted string about the state of this build
def testing_status
  testing ||= "External" if self.external_testing_enabled
  testing ||= "Internal" if self.internal_testing_enabled
  if Time.at(self.internal_expiry_date / 1000) > Time.now
    testing ||= "Inactive"
  else
    testing = "Expired"
  end
  return testing
end