spaceship 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3078ea19b608c93eb3a24244c21150926510bfb
4
- data.tar.gz: 4502e39e82ac1214bb99194d6952956fc3311a03
3
+ metadata.gz: 2f1c5ac6945f70388e4e1ad0b2f52a1f185c56fb
4
+ data.tar.gz: a925727b880ed220b5f1d85dd7b523b7354149f7
5
5
  SHA512:
6
- metadata.gz: c5c4a1641ab4dfe03f514debd2dc0a49cd6edd0502b5c4a1fde97ee6c043c40a5609a31f6d1c847044586b1160e9f0b930178a71ac74d42ba91f7d8d91392452
7
- data.tar.gz: 308b92f3e5225fbb8ad6ebed31a665ef7719211cb16cd83c1d4890f802168273bcab987090ddd485880d2e90f71c74e5076391ab3fe5e3535d28a2b2f304e44f
6
+ metadata.gz: d50ba6dc463d4b920716eb792f9a00a01240e5c7d42a7980889f32b831818c4007a440fcef48cbe4793ac764e3849646bbd7bb435d2f4bf69eccf029a0bbe11d
7
+ data.tar.gz: 1ec502faa18764220dd036e782bfafde2f9ea423469060e5b21f639454aebc0e53ffccfa7569f3cfd9f10c661726b712283377bffcb13233c0733bbeed62885a
@@ -217,11 +217,24 @@ module Spaceship
217
217
  end
218
218
  end
219
219
 
220
- profile = client.create_provisioning_profile!(name,
221
- self.type,
222
- app.app_id,
223
- certificate_parameter,
224
- devices.map {|d| d.id} )
220
+ def send_create_request(name, type, app_id, certificate_parameter, devices)
221
+ tries ||= 5
222
+ client.create_provisioning_profile!(name, type, app_id, certificate_parameter, devices)
223
+ rescue => ex
224
+ unless (tries -= 1).zero?
225
+ sleep 3
226
+ retry
227
+ end
228
+
229
+ raise ex # re-raise the exception
230
+ end
231
+
232
+ profile = send_create_request(name,
233
+ self.type,
234
+ app.app_id,
235
+ certificate_parameter,
236
+ devices.map {|d| d.id} )
237
+
225
238
  self.new(profile)
226
239
  end
227
240
 
@@ -326,7 +339,25 @@ module Spaceship
326
339
  end
327
340
  end
328
341
 
329
- client.repair_provisioning_profile!(
342
+ def send_update_request(id, name, distribution_method, app_id, certificates, devices)
343
+ tries ||= 5
344
+ client.repair_provisioning_profile!(
345
+ id,
346
+ name,
347
+ distribution_method,
348
+ app_id,
349
+ certificates,
350
+ devices
351
+ )
352
+ rescue => ex
353
+ unless (tries -= 1).zero?
354
+ sleep 3
355
+ retry
356
+ end
357
+ raise ex # re-raise the exception
358
+ end
359
+
360
+ send_update_request(
330
361
  self.id,
331
362
  self.name,
332
363
  self.distribution_method,
@@ -81,13 +81,16 @@ module Spaceship
81
81
  # @param sku (String): A unique ID for your app that is not visible on the App Store.
82
82
  # @param bundle_id (String): The bundle ID must match the one you used in Xcode. It
83
83
  # can't be changed after you submit your first build.
84
- def create!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil)
84
+ # @param company_name (String): The company name or developer name to display on the App Store for your apps.
85
+ # It cannot be changed after you create your first app.
86
+ def create!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil)
85
87
  client.create_application!(name: name,
86
88
  primary_language: primary_language,
87
89
  version: version,
88
90
  sku: sku,
89
91
  bundle_id: bundle_id,
90
- bundle_id_suffix: bundle_id_suffix)
92
+ bundle_id_suffix: bundle_id_suffix,
93
+ company_name: company_name)
91
94
  end
92
95
  end
93
96
 
@@ -27,7 +27,7 @@ module Spaceship
27
27
  url = host + request(:get, self.class.hostname).body.match(/action="(\/WebObjects\/iTunesConnect.woa\/wo\/.*)"/)[1]
28
28
  raise "" unless url.length > 0
29
29
 
30
- File.write(cache_path, url) # TODO
30
+ File.write(cache_path, url)
31
31
  return url
32
32
  rescue => ex
33
33
  puts ex
@@ -140,7 +140,7 @@ module Spaceship
140
140
  # @param sku (String): A unique ID for your app that is not visible on the App Store.
141
141
  # @param bundle_id (String): The bundle ID must match the one you used in Xcode. It
142
142
  # can't be changed after you submit your first build.
143
- def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil)
143
+ def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil)
144
144
  # First, we need to fetch the data from Apple, which we then modify with the user's values
145
145
  r = request(:get, 'ra/apps/create/?appType=ios')
146
146
  data = parse_response(r, 'data')
@@ -152,6 +152,7 @@ module Spaceship
152
152
  data['newApp']['primaryLanguage']['value'] = primary_language || 'English'
153
153
  data['newApp']['vendorId']['value'] = sku
154
154
  data['newApp']['bundleIdSuffix']['value'] = bundle_id_suffix
155
+ data['companyName']['value'] = company_name if company_name
155
156
 
156
157
  # Now send back the modified hash
157
158
  r = request(:post) do |req|
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-23 00:00:00.000000000 Z
12
+ date: 2015-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager