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 ⇒ Bool
readonly
Is external beta testing enabled for this train? Only one train can have enabled testing.
-
#external_testing_status ⇒ String
readonly
The status of internal testflight testing for this build.
-
#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.
-
#internal_testing_enabled ⇒ Bool
readonly
Is internal beta testing enabled for this train? Only one train can have enabled testing.
-
#platform ⇒ String
The platform of this build (e.g. ‘ios’).
-
#processing ⇒ Boolean
Is this build currently processing?.
-
#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
-
#apple_id ⇒ String
The App identifier of this app, provided by iTunes Connect.
-
#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.
- #details ⇒ Object
- #setup ⇒ Object
-
#submit_for_beta_review!(metadata) ⇒ Object
This will submit this build for TestFlight beta review Note that iTC will pull a lot of this information from previous builds or the app store information, all of the required values must be set either in this hash or automatically for this to work.
-
#testing_status ⇒ String
@examples: External, Internal, Inactive, Expired.
- #update_build_information!(whats_new: nil, description: nil, feedback_email: nil) ⇒ Object
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.
39 40 41 |
# File 'lib/spaceship/tunes/build.rb', line 39 def app_name @app_name end |
#apple_id ⇒ String
Returns The App identifier of this app, provided by iTunes Connect.
12 13 14 |
# File 'lib/spaceship/tunes/build.rb', line 12 def apple_id @apple_id end |
#build_train ⇒ Spaceship::Tunes::BuildTrain
Returns A reference to the build train this build is contained in.
15 16 17 |
# File 'lib/spaceship/tunes/build.rb', line 15 def build_train @build_train end |
#build_version ⇒ String
Returns The build version (not the version number), but also is named ‘build number`.
24 25 26 |
# File 'lib/spaceship/tunes/build.rb', line 24 def build_version @build_version end |
#crash_count ⇒ Integer
Returns Might be nil. The number of crashes of this build.
82 83 84 |
# File 'lib/spaceship/tunes/build.rb', line 82 def crash_count @crash_count end |
#external_expiry_date ⇒ Integer
Returns : When is the external build going to expire?.
48 49 50 |
# File 'lib/spaceship/tunes/build.rb', line 48 def external_expiry_date @external_expiry_date end |
#external_install_count ⇒ Integer
Returns Number of installs for this build that come from external users.
76 77 78 |
# File 'lib/spaceship/tunes/build.rb', line 76 def external_install_count @external_install_count end |
#external_testing_enabled ⇒ Bool (readonly)
Returns Is external beta testing enabled for this train? Only one train can have enabled testing.
51 52 53 |
# File 'lib/spaceship/tunes/build.rb', line 51 def external_testing_enabled @external_testing_enabled end |
#external_testing_status ⇒ String (readonly)
Returns The status of internal testflight testing for this build. One of active, submitForReview, approvedInactive, waiting.
57 58 59 |
# File 'lib/spaceship/tunes/build.rb', line 57 def external_testing_status @external_testing_status end |
#icon_url ⇒ String
Returns URL to the app icon of this build (150x150px).
36 37 38 |
# File 'lib/spaceship/tunes/build.rb', line 36 def icon_url @icon_url end |
#id ⇒ Integer
Returns The ID generated by iTunes Connect.
18 19 20 |
# File 'lib/spaceship/tunes/build.rb', line 18 def id @id end |
#install_count ⇒ Integer
Returns Number of installs of this build.
70 71 72 |
# File 'lib/spaceship/tunes/build.rb', line 70 def install_count @install_count end |
#internal_expiry_date ⇒ Integer
Returns When is this build going to be invalid.
45 46 47 |
# File 'lib/spaceship/tunes/build.rb', line 45 def internal_expiry_date @internal_expiry_date end |
#internal_install_count ⇒ Integer
Returns Number of installs for this build that come from internal users.
73 74 75 |
# File 'lib/spaceship/tunes/build.rb', line 73 def internal_install_count @internal_install_count end |
#internal_testing_enabled ⇒ Bool (readonly)
Returns Is internal beta testing enabled for this train? Only one train can have enabled testing.
54 55 56 |
# File 'lib/spaceship/tunes/build.rb', line 54 def internal_testing_enabled @internal_testing_enabled end |
#platform ⇒ String
Returns The platform of this build (e.g. ‘ios’).
42 43 44 |
# File 'lib/spaceship/tunes/build.rb', line 42 def platform @platform end |
#processing ⇒ Boolean
Returns Is this build currently processing?.
30 31 32 |
# File 'lib/spaceship/tunes/build.rb', line 30 def processing @processing end |
#ready_to_install ⇒ Bool
Returns :.
63 64 65 |
# File 'lib/spaceship/tunes/build.rb', line 63 def ready_to_install @ready_to_install end |
#session_count ⇒ Integer
Returns Might be nil. The number of sessions for this build.
79 80 81 |
# File 'lib/spaceship/tunes/build.rb', line 79 def session_count @session_count end |
#train_version ⇒ String
Returns The version number (e.g. 1.3).
27 28 29 |
# File 'lib/spaceship/tunes/build.rb', line 27 def train_version @train_version end |
#upload_date ⇒ Integer
Returns The number of ticks since 1970 (e.g. 1413966436000).
33 34 35 |
# File 'lib/spaceship/tunes/build.rb', line 33 def upload_date @upload_date end |
#valid ⇒ Boolean
21 22 23 |
# File 'lib/spaceship/tunes/build.rb', line 21 def valid @valid end |
#watch_kit_enabled ⇒ Bool
Returns Does this build support WatchKit?.
60 61 62 |
# File 'lib/spaceship/tunes/build.rb', line 60 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.
112 113 114 |
# File 'lib/spaceship/tunes/build.rb', line 112 def factory(attrs) self.new(attrs) end |
Instance Method Details
#cancel_beta_review! ⇒ Object
This will cancel the review process for this TestFlight build
206 207 208 209 210 211 |
# File 'lib/spaceship/tunes/build.rb', line 206 def cancel_beta_review! client.remove_testflight_build_from_review!(app_id: self.apple_id, train: self.train_version, build_number: self.build_version, platform: self.platform) end |
#details ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/spaceship/tunes/build.rb', line 124 def details response = client.build_details(app_id: self.apple_id, train: self.train_version, build_number: self.build_version) response['apple_id'] = self.apple_id BuildDetails.factory(response) end |
#setup ⇒ Object
117 118 119 120 121 122 |
# File 'lib/spaceship/tunes/build.rb', line 117 def setup super self.external_expiry_date ||= 0 self.internal_expiry_date ||= 0 end |
#submit_for_beta_review!(metadata) ⇒ Object
This will submit this build for TestFlight beta review Note that iTC will pull a lot of this information from previous builds or the app store information, all of the required values must be set either in this hash or automatically for this to work
176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/spaceship/tunes/build.rb', line 176 def submit_for_beta_review!() parameters = { app_id: self.apple_id, train: self.train_version, build_number: self.build_version, platform: self.platform }.merge() client.submit_testflight_build_for_review!(parameters) return parameters end |
#testing_status ⇒ String
@examples:
External, Internal, Inactive, Expired
192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/spaceship/tunes/build.rb', line 192 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 |
#update_build_information!(whats_new: nil, description: nil, feedback_email: nil) ⇒ Object
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/spaceship/tunes/build.rb', line 137 def update_build_information!(whats_new: nil, description: nil, feedback_email: nil) parameters = { app_id: self.apple_id, train: self.train_version, build_number: self.build_version, platform: self.platform }.merge({ whats_new: whats_new, description: description, feedback_email: feedback_email }) client.update_build_information!(parameters) end |