spaceship 0.21.1 → 0.22.0

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: 5ce52c239b938c9368777decf6b3b239a32c93de
4
- data.tar.gz: 6c5cc9ef074cc1216b07d76c2454ea8fb593e501
3
+ metadata.gz: 9dabed49c4d052da742b042c98736c63fafc03b5
4
+ data.tar.gz: 40407f493497ce523fd4bdc84ab5924624582e7d
5
5
  SHA512:
6
- metadata.gz: 0f2e0c03d6ecb1695326598096e8356d6894db28c206d55c27898ba720f87c9c41dfd6c429b31bd41a43404201252691f640f3be6aa0b25e103a901cf6857f46
7
- data.tar.gz: f7a42c64841df2afd1cef01e8660b2e69ecc76c6d40a847d01033e0b6a95b3010786fc206bcd717b98884c397fd661faf13aeca98f8b7d1488cd6b046781a995
6
+ metadata.gz: 2529e7e6f98a626626ce8036a20f94cc18843f79bfbe8d63b118ea2aacded8504d406b34ffd455481d537f15ebae708586e5c5a7cc9b7ff8f399a348790b33bb
7
+ data.tar.gz: 119f3f29a9c16a7fbb5ebb6889658621abdf5e061c6674031c3f2508d8f54f6eada1e3879750b7dba87a159cae03bd2c8f0af7b925ecc26d1498f048c790488a
@@ -121,7 +121,7 @@ module Spaceship
121
121
  # @return (Device) Find a device based on the UDID of the device. nil if no device was found.
122
122
  def find_by_udid(device_udid, mac: false)
123
123
  all(mac: mac).find do |device|
124
- device.udid == device_udid
124
+ device.udid.casecmp(device_udid) == 0
125
125
  end
126
126
  end
127
127
 
@@ -299,9 +299,9 @@ module Spaceship
299
299
  def download_certificate(certificate_id, type, mac: false)
300
300
  { type: type, certificate_id: certificate_id }.each { |k, v| raise "#{k} must not be nil" if v.nil? }
301
301
 
302
- r = request(:post, "https://developer.apple.com/account/#{platform_slug(mac)}/certificate/certificateContentDownload.action", {
302
+ r = request(:get, "account/#{platform_slug(mac)}/certificate/downloadCertificateContent.action", {
303
303
  teamId: team_id,
304
- displayId: certificate_id,
304
+ certificateId: certificate_id,
305
305
  type: type
306
306
  })
307
307
  a = parse_response(r)
@@ -353,9 +353,9 @@ module Spaceship
353
353
  end
354
354
 
355
355
  def download_provisioning_profile(profile_id, mac: false)
356
- r = request(:get, "https://developer.apple.com/account/#{platform_slug(mac)}/profile/profileContentDownload.action", {
356
+ r = request(:get, "account/#{platform_slug(mac)}/profile/downloadProfileContent", {
357
357
  teamId: team_id,
358
- displayId: profile_id
358
+ provisioningProfileId: profile_id
359
359
  })
360
360
  a = parse_response(r)
361
361
  if r.success? && a.include?("DOCTYPE plist PUBLIC")
@@ -0,0 +1,59 @@
1
+ module Spaceship
2
+ module Tunes
3
+ # Represents a read only version of an iTunes Connect Versions State History
4
+ class AppVersionHistory < TunesBase
5
+ # @return (Spaceship::Tunes::Application) A reference to the application
6
+ # this version is for
7
+ attr_accessor :application
8
+
9
+ # @return (String) The version in string format (e.g. "1.0")
10
+ attr_reader :version_string
11
+
12
+ # @return (String) The platform value of this version.
13
+ attr_reader :version_id
14
+
15
+ # @return ([Spaceship::Tunes::AppVersionStatesHistory]) the array of version states
16
+ attr_reader :items
17
+
18
+ attr_mapping({
19
+ 'versionString' => :version_string,
20
+ 'versionId' => :version_id,
21
+ 'items' => :items
22
+ })
23
+
24
+ class << self
25
+ # Create a new object based on a hash.
26
+ # This is used to create a new object based on the server response.
27
+ def factory(attrs)
28
+ obj = self.new(attrs)
29
+ return obj
30
+ end
31
+ end
32
+
33
+ # Returns an array of all builds that can be sent to review
34
+ def items
35
+ @items ||= fetch_items
36
+ end
37
+
38
+ # Private methods
39
+ def setup
40
+ # Properly parse the AppStatus
41
+ items = raw_data['items']
42
+ @items = map_items(items) if items
43
+ end
44
+
45
+ private
46
+
47
+ def map_items(items)
48
+ items.map do |attrs|
49
+ Tunes::AppVersionStatesHistory.factory(attrs)
50
+ end
51
+ end
52
+
53
+ def fetch_items
54
+ items = client.version_states_history(application.apple_id, application.platform, version_id)['items']
55
+ map_items(items)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,34 @@
1
+ module Spaceship
2
+ module Tunes
3
+ # Represents a read only version of an iTunes Connect Versions State History
4
+ class AppVersionStatesHistory < TunesBase
5
+ # @return (String) the state
6
+ attr_reader :state_key
7
+
8
+ # @return (String) The name of the user who made the change
9
+ attr_reader :user_name
10
+
11
+ # @return (String) the email of the user or nil
12
+ attr_reader :user_email
13
+
14
+ # @return (Integer) the date of the state
15
+ attr_reader :date
16
+
17
+ attr_mapping({
18
+ 'stateKey' => :state_key,
19
+ 'userName' => :user_name,
20
+ 'userEmail' => :user_email,
21
+ 'date' => :date
22
+ })
23
+
24
+ class << self
25
+ # Create a new object based on a hash.
26
+ # This is used to create a new object based on the server response.
27
+ def factory(attrs)
28
+ obj = self.new(attrs)
29
+ return obj
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -134,6 +134,15 @@ module Spaceship
134
134
  Tunes::AppDetails.factory(attrs)
135
135
  end
136
136
 
137
+ def versions_history
138
+ ensure_not_a_bundle
139
+ versions = client.versions_history(apple_id, platform)
140
+ versions.map do |attrs|
141
+ attrs.merge!(application: self)
142
+ Tunes::AppVersionHistory.factory(attrs)
143
+ end
144
+ end
145
+
137
146
  #####################################################
138
147
  # @!group Modifying
139
148
  #####################################################
@@ -335,6 +344,13 @@ module Spaceship
335
344
 
336
345
  tester.remove_from_app!(self.apple_id)
337
346
  end
347
+
348
+ # private to module
349
+ def ensure_not_a_bundle
350
+ # we only support applications
351
+ platform = Spaceship::Tunes::AppVersionCommon.find_platform(raw_data['versionSets'])
352
+ raise "We do not support BUNDLE types right now" if platform['type'] == 'BUNDLE'
353
+ end
338
354
  end
339
355
  end
340
356
  end
@@ -8,6 +8,8 @@ require 'spaceship/tunes/language_item'
8
8
  require 'spaceship/tunes/app_status'
9
9
  require 'spaceship/tunes/app_image'
10
10
  require 'spaceship/tunes/app_version_ref'
11
+ require 'spaceship/tunes/app_version_history'
12
+ require 'spaceship/tunes/app_version_states_history'
11
13
  require 'spaceship/tunes/transit_app_file'
12
14
  require 'spaceship/tunes/user_detail'
13
15
  require 'spaceship/tunes/app_screenshot'
@@ -790,6 +790,19 @@ module Spaceship
790
790
  update_tester_from_app!(tester, app_id, false)
791
791
  end
792
792
 
793
+ #####################################################
794
+ # @!group State History
795
+ #####################################################
796
+ def versions_history(app_id, platform)
797
+ r = request(:get, "ra/apps/#{app_id}/stateHistory?platform=#{platform}")
798
+ parse_response(r, 'data')['versions']
799
+ end
800
+
801
+ def version_states_history(app_id, platform, version_id)
802
+ r = request(:get, "ra/apps/#{app_id}/versions/#{version_id}/stateHistory?platform=#{platform}")
803
+ parse_response(r, 'data')
804
+ end
805
+
793
806
  private
794
807
 
795
808
  def with_tunes_retry(tries = 5, &_block)
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.21.1"
2
+ VERSION = "0.22.0"
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.21.1
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-26 00:00:00.000000000 Z
12
+ date: 2016-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager
@@ -292,7 +292,9 @@ files:
292
292
  - lib/spaceship/tunes/app_trailer.rb
293
293
  - lib/spaceship/tunes/app_version.rb
294
294
  - lib/spaceship/tunes/app_version_common.rb
295
+ - lib/spaceship/tunes/app_version_history.rb
295
296
  - lib/spaceship/tunes/app_version_ref.rb
297
+ - lib/spaceship/tunes/app_version_states_history.rb
296
298
  - lib/spaceship/tunes/application.rb
297
299
  - lib/spaceship/tunes/build.rb
298
300
  - lib/spaceship/tunes/build_train.rb
@@ -329,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
329
331
  version: '0'
330
332
  requirements: []
331
333
  rubyforge_project:
332
- rubygems_version: 2.2.2
334
+ rubygems_version: 2.4.0
333
335
  signing_key:
334
336
  specification_version: 4
335
337
  summary: Because you would rather spend your time building stuff than fighting provisioning