spaceship 0.32.3 → 0.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f86e2d7063e85473a86952fb951e76229f569ef1
4
- data.tar.gz: c9eaae0e51a6afa2f528b7c9dc1e479425b50e33
3
+ metadata.gz: c1ed1ed0e0ca3f83e0938bfef281e22c419dda58
4
+ data.tar.gz: 671c565c25a2f2f36471ad8a11409a6f2d857067
5
5
  SHA512:
6
- metadata.gz: d3b222516451a9fe5e7cb22c8d0bd27a13e1bcc394bf1aa182859d22305594dd819310d7a3d0e8668f7a675086497a8ca180d78959859112a0b45c56dfdbdf82
7
- data.tar.gz: fc66e1542b2ee6879e5255258ad25b001a88fef898f122a8995a9e01d47b911bf070e265662bc3227d178be18aae97670e2bdee4506a7da1881b7a808f51c2a5
6
+ metadata.gz: cd6289e6ba47c42d84ed2f6e077f891510b4c03538e3d786a434610755768ef995f34aa87846e5c8a454fc4bb86e267971d3724276f5e0a87dbc45653446bee1
7
+ data.tar.gz: cd6b1a3daa56dbc8ab755e8f49ca653c2992988572e586c521e111b98c85d9d4ff11459f98051becb66891a0c4e61fad3a17b59039eb65c51af84a90a5ea23a0
@@ -119,6 +119,11 @@ module Spaceship
119
119
  # profile.devices.first.name
120
120
  attr_accessor :devices
121
121
 
122
+ # This is the second level request, which is done before creating the object
123
+ # this includes information about the devices and the certificates
124
+ # more information on this issue https://github.com/fastlane/fastlane/issues/6137
125
+ attr_accessor :profile_details
126
+
122
127
  attr_mapping({
123
128
  'provisioningProfileId' => :id,
124
129
  'UUID' => :uuid,
@@ -148,7 +153,12 @@ module Spaceship
148
153
  # This is used to create a new object based on the server response.
149
154
  def factory(attrs)
150
155
  # Ad Hoc Profiles look exactly like App Store profiles, but usually include devices
151
- attrs['distributionMethod'] = 'adhoc' if attrs['distributionMethod'] == 'store' && attrs['devices'].size > 0
156
+ profile_details = client.provisioning_profile_details(provisioning_profile_id: attrs["provisioningProfileId"])
157
+
158
+ # The only difference between App Store and Ad Hoc provisioniong profile is the devices that are attached
159
+ if attrs['distributionMethod'] == 'store' && (profile_details['devices'] || []).size > 0
160
+ attrs['distributionMethod'] = 'adhoc'
161
+ end
152
162
  # available values of `distributionMethod` at this point: ['adhoc', 'store', 'limited']
153
163
 
154
164
  klass = case attrs['distributionMethod']
@@ -164,12 +174,30 @@ module Spaceship
164
174
  raise "Can't find class '#{attrs['distributionMethod']}'"
165
175
  end
166
176
 
167
- # eagerload the Apps and Devices using the same client if we have to.
177
+ # eagerload the Apps using the same client if we have to.
168
178
  attrs['appId'] = App.set_client(@client).factory(attrs['appId'])
169
- attrs['devices'].map! { |device| Device.set_client(@client).factory(device) }
170
179
 
171
180
  klass.client = @client
172
- klass.new(attrs)
181
+ obj = klass.new(attrs)
182
+
183
+ # Set the response of the details request, in case we want to access it later on
184
+ obj.profile_details = profile_details
185
+
186
+ # Since 15th September 2016 certificates and devices are hidden behind another request
187
+ # see https://github.com/fastlane/fastlane/issues/6137 for more information
188
+ # That's why we set it here
189
+
190
+ # Parse all the devices from the details request
191
+ obj.devices = (profile_details["devices"] || []).collect do |device|
192
+ Device.set_client(client).factory(device)
193
+ end
194
+
195
+ # Parse all the certificates from the details request
196
+ obj.certificates = (profile_details["certificates"] || []).collect do |cert|
197
+ Certificate.set_client(client).factory(cert)
198
+ end
199
+
200
+ return obj
173
201
  end
174
202
 
175
203
  # @return (String) The human readable name of this profile type.
@@ -390,19 +418,6 @@ module Spaceship
390
418
  def mac?
391
419
  platform == 'mac'
392
420
  end
393
-
394
- # Since 15th September 2016 this hidden behind another request
395
- # see https://github.com/fastlane/fastlane/issues/6137 for more information
396
- def certificates
397
- @internal_certificates ||= (details["certificates"] || []).collect do |cert|
398
- Certificate.set_client(client).factory(cert)
399
- end
400
- end
401
-
402
- # This is data that can only be fetched from the getProvisioningProfile.action API endpoint
403
- def details
404
- @details ||= client.provisioning_profile_details(provisioning_profile_id: self.id)
405
- end
406
421
  end
407
422
  end
408
423
  end
@@ -1,4 +1,4 @@
1
1
  module Spaceship
2
- VERSION = "0.32.3".freeze
2
+ VERSION = "0.32.4".freeze
3
3
  DESCRIPTION = "Ruby library to access the Apple Dev Center and iTunes Connect".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.3
4
+ version: 0.32.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -392,7 +392,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
392
392
  version: '0'
393
393
  requirements: []
394
394
  rubyforge_project:
395
- rubygems_version: 2.5.1
395
+ rubygems_version: 2.6.6
396
396
  signing_key:
397
397
  specification_version: 4
398
398
  summary: Ruby library to access the Apple Dev Center and iTunes Connect