Class: Spaceship::Tunes::Build
- Defined in:
- lib/spaceship/tunes/build.rb
Overview
Represents a build which is inside the build train
Direct Known Subclasses
General metadata collapse
-
#app_name ⇒ String
The name of the app this build is for.
-
#build_train ⇒ Spaceship::Tunes::BuildTrain
A reference to the build train this build is contained in.
-
#build_version ⇒ String
The build version (not the version number), but also is named ‘build number`.
-
#external_expiry_date ⇒ Integer
: When is the external build going to expire?.
-
#external_testing_enabled ⇒ Boolean
: Is this build available for external beta testing this is only true after the build was approved by Apple.
-
#icon_url ⇒ String
URL to the app icon of this build (150x150px).
-
#id ⇒ Integer
The ID generated by iTunes Connect.
-
#internal_expiry_date ⇒ Integer
When is this build going to be invalid.
-
#platform ⇒ String
The platform of this build (e.g. ‘ios’).
-
#ready_to_install ⇒ Bool
:.
-
#train_version ⇒ String
The version number (e.g. 1.3).
-
#upload_date ⇒ Integer
The number of ticks since 1970 (e.g. 1413966436000).
- #valid ⇒ Boolean
-
#watch_kit_enabled ⇒ Bool
Does this build support WatchKit?.
Analytics collapse
-
#crash_count ⇒ Integer
Might be nil.
-
#external_install_count ⇒ Integer
Number of installs for this build that come from external users.
-
#install_count ⇒ Integer
Number of installs of this build.
-
#internal_install_count ⇒ Integer
Number of installs for this build that come from internal users.
-
#session_count ⇒ Integer
Might be nil.
Attributes inherited from Base
Analytics collapse
-
.factory(attrs) ⇒ Object
Create a new object based on a hash.
-
#cancel_beta_review! ⇒ Object
This will cancel the review process for this TestFlight build.
- #setup ⇒ Object
-
#submit_for_beta_review!(metadata) ⇒ Object
This will submit this build for TestFlight beta review.
-
#testing_status ⇒ String
@examples: External, Internal, Inactive, Expired.
Methods inherited from TunesBase
Methods inherited from Base
attr_accessor, attr_mapping, #attributes, attributes, #initialize, #inspect, mapping_module, method_missing, set_client, #to_s
Constructor Details
This class inherits a constructor from Spaceship::Base
Instance Attribute Details
#app_name ⇒ String
Returns The name of the app this build is for.
32 33 34 |
# File 'lib/spaceship/tunes/build.rb', line 32 def app_name @app_name end |
#build_train ⇒ Spaceship::Tunes::BuildTrain
Returns A reference to the build train this build is contained in.
11 12 13 |
# File 'lib/spaceship/tunes/build.rb', line 11 def build_train @build_train end |
#build_version ⇒ String
Returns The build version (not the version number), but also is named ‘build number`.
20 21 22 |
# File 'lib/spaceship/tunes/build.rb', line 20 def build_version @build_version end |
#crash_count ⇒ Integer
Returns Might be nil. The number of crashes of this build.
70 71 72 |
# File 'lib/spaceship/tunes/build.rb', line 70 def crash_count @crash_count end |
#external_expiry_date ⇒ Integer
Returns : When is the external build going to expire?.
41 42 43 |
# File 'lib/spaceship/tunes/build.rb', line 41 def external_expiry_date @external_expiry_date end |
#external_install_count ⇒ Integer
Returns Number of installs for this build that come from external users.
64 65 66 |
# File 'lib/spaceship/tunes/build.rb', line 64 def external_install_count @external_install_count end |
#external_testing_enabled ⇒ Boolean
Returns : Is this build available for external beta testing this is only true after the build was approved by Apple.
45 46 47 |
# File 'lib/spaceship/tunes/build.rb', line 45 def external_testing_enabled @external_testing_enabled end |
#icon_url ⇒ String
Returns URL to the app icon of this build (150x150px).
29 30 31 |
# File 'lib/spaceship/tunes/build.rb', line 29 def icon_url @icon_url end |
#id ⇒ Integer
Returns The ID generated by iTunes Connect.
14 15 16 |
# File 'lib/spaceship/tunes/build.rb', line 14 def id @id end |
#install_count ⇒ Integer
Returns Number of installs of this build.
58 59 60 |
# File 'lib/spaceship/tunes/build.rb', line 58 def install_count @install_count end |
#internal_expiry_date ⇒ Integer
Returns When is this build going to be invalid.
38 39 40 |
# File 'lib/spaceship/tunes/build.rb', line 38 def internal_expiry_date @internal_expiry_date end |
#internal_install_count ⇒ Integer
Returns Number of installs for this build that come from internal users.
61 62 63 |
# File 'lib/spaceship/tunes/build.rb', line 61 def internal_install_count @internal_install_count end |
#platform ⇒ String
Returns The platform of this build (e.g. ‘ios’).
35 36 37 |
# File 'lib/spaceship/tunes/build.rb', line 35 def platform @platform end |
#ready_to_install ⇒ Bool
Returns :.
51 52 53 |
# File 'lib/spaceship/tunes/build.rb', line 51 def ready_to_install @ready_to_install end |
#session_count ⇒ Integer
Returns Might be nil. The number of sessions for this build.
67 68 69 |
# File 'lib/spaceship/tunes/build.rb', line 67 def session_count @session_count end |
#train_version ⇒ String
Returns The version number (e.g. 1.3).
23 24 25 |
# File 'lib/spaceship/tunes/build.rb', line 23 def train_version @train_version end |
#upload_date ⇒ Integer
Returns The number of ticks since 1970 (e.g. 1413966436000).
26 27 28 |
# File 'lib/spaceship/tunes/build.rb', line 26 def upload_date @upload_date end |
#valid ⇒ Boolean
17 18 19 |
# File 'lib/spaceship/tunes/build.rb', line 17 def valid @valid end |
#watch_kit_enabled ⇒ Bool
Returns Does this build support WatchKit?.
48 49 50 |
# File 'lib/spaceship/tunes/build.rb', line 48 def watch_kit_enabled @watch_kit_enabled end |
Class Method Details
.factory(attrs) ⇒ Object
Create a new object based on a hash. This is used to create a new object based on the server response.
96 97 98 |
# File 'lib/spaceship/tunes/build.rb', line 96 def factory(attrs) self.new(attrs) end |
Instance Method Details
#cancel_beta_review! ⇒ Object
This will cancel the review process for this TestFlight build
182 183 184 185 186 |
# File 'lib/spaceship/tunes/build.rb', line 182 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 |
#setup ⇒ Object
101 102 103 104 105 106 |
# File 'lib/spaceship/tunes/build.rb', line 101 def setup super self.external_expiry_date ||= 0 @external_testing_enabled = self.external_expiry_date > 0 end |
#submit_for_beta_review!(metadata) ⇒ Object
This will submit this build for TestFlight beta review
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/spaceship/tunes/build.rb', line 128 def submit_for_beta_review!() # First, enable beta testing for this train (per iTC requirement) self.build_train.update_testing_status!(true) 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: "[email protected]", marketing_url: "http://marketing.com", first_name: "Felix", last_name: "Krause", review_email: "[email protected]", phone_number: "0123456789", # Optional Metadata: privacy_policy_url: nil, review_user_name: nil, review_password: nil, encryption: false }.merge() client.submit_testflight_build_for_review!(parameters) return parameters end |
#testing_status ⇒ String
@examples:
External, Internal, Inactive, Expired
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/spaceship/tunes/build.rb', line 162 def testing_status testing ||= "External" if self.external_expiry_date > 0 if self.build_train.testing_enabled # only the latest build is actually valid if self.build_train.builds.find_all { |b| b.upload_date > self.upload_date }.count == 0 testing ||= "Internal" end end if Time.at(self.internal_expiry_date / 1000) > Time.now testing ||= "Inactive" else testing = "Expired" end return testing end |