spaceship 0.12.2 → 0.12.3

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: 8b59995247731753e5f6f2df714702057046e3a2
4
- data.tar.gz: f659309515870ba2a574ea55fe52f039aa845f8a
3
+ metadata.gz: a5e10edaa81463ade7270eab6924946ba77d9d5c
4
+ data.tar.gz: da2ba6567d281e66330b93ad1de33a8d77008beb
5
5
  SHA512:
6
- metadata.gz: a8771b4859b567372bc903bf84ba8bcde129ad3e10070cefa5130a049dadfdaaec9e86d8575f1b4999260e4275f8835c3671fee50cb010730a61e8608a2269e8
7
- data.tar.gz: 4bcb81f616001c9971d8ff6089a428974a856379b4b404963bc58c0a759f18466cfa348484237add35dee5a3bbf0a9b8779ff3244c430a2492ace4c6754da9fc
6
+ metadata.gz: a6e16adf655c57aa21706b3695ffa5508b0d9ec1ea9c03e104e439bddc485c7b00963994903eb2fc42967c7ce5fe8101f914bbe20288a189e56349dcdb693298
7
+ data.tar.gz: 4d5af58985c1131466d504b433244cb7dfd522d451b5a6dce990191c6ff376851e58da4654302902759174e7346a0b0fea970d2af2fd971752697558f369c0e2
data/README.md CHANGED
@@ -6,18 +6,18 @@
6
6
  </a>
7
7
  </h3>
8
8
  <p align="center">
9
- <a href="https://github.com/KrauseFx/deliver">deliver</a> &bull;
10
- <a href="https://github.com/KrauseFx/snapshot">snapshot</a> &bull;
11
- <a href="https://github.com/KrauseFx/frameit">frameit</a> &bull;
12
- <a href="https://github.com/KrauseFx/PEM">PEM</a> &bull;
13
- <a href="https://github.com/KrauseFx/sigh">sigh</a> &bull;
9
+ <a href="https://github.com/KrauseFx/deliver">deliver</a> &bull;
10
+ <a href="https://github.com/KrauseFx/snapshot">snapshot</a> &bull;
11
+ <a href="https://github.com/KrauseFx/frameit">frameit</a> &bull;
12
+ <a href="https://github.com/KrauseFx/PEM">PEM</a> &bull;
13
+ <a href="https://github.com/KrauseFx/sigh">sigh</a> &bull;
14
14
  <a href="https://github.com/KrauseFx/produce">produce</a> &bull;
15
15
  <a href="https://github.com/KrauseFx/cert">cert</a> &bull;
16
- <a href="https://github.com/KrauseFx/codes">codes</a> &bull;
17
16
  <b>spaceship</b> &bull;
18
17
  <a href="https://github.com/fastlane/pilot">pilot</a> &bull;
19
18
  <a href="https://github.com/fastlane/boarding">boarding</a> &bull;
20
- <a href="https://github.com/fastlane/gym">gym</a>
19
+ <a href="https://github.com/fastlane/gym">gym</a> &bull;
20
+ <a href="https://github.com/fastlane/scan">scan</a>
21
21
  </p>
22
22
  -------
23
23
 
@@ -21,7 +21,7 @@ module Spaceship
21
21
  class Base
22
22
  class DataHash
23
23
  def initialize(hash)
24
- @hash = hash
24
+ @hash = hash || {}
25
25
  end
26
26
 
27
27
  def get(*keys)
@@ -34,12 +34,11 @@ module Spaceship
34
34
 
35
35
  # @return (String) Device type
36
36
  # @example
37
- # 'pc' - Apple TV
38
37
  # 'watch' - Apple Watch
39
38
  # 'ipad' - iPad
40
39
  # 'iphone' - iPhone
41
40
  # 'ipod' - iPod
42
- # 'pc' - Apple TV
41
+ # 'tvOS' - Apple TV
43
42
  attr_accessor :device_type
44
43
 
45
44
  attr_mapping({
@@ -66,7 +65,7 @@ module Spaceship
66
65
 
67
66
  # @return (Array) Returns all Apple TVs registered for this account
68
67
  def all_apple_tvs
69
- client.devices_by_class('pc').map { |device| self.factory(device) }
68
+ client.devices_by_class('tvOS').map { |device| self.factory(device) }
70
69
  end
71
70
 
72
71
  # @return (Array) Returns all Watches registered for this account
@@ -89,6 +88,20 @@ module Spaceship
89
88
  client.devices_by_class('ipod').map { |device| self.factory(device) }
90
89
  end
91
90
 
91
+ # @return (Array) Returns all devices that can be used for iOS profiles (all devices except TVs)
92
+ def all_ios_profile_devices
93
+ all.select { |device| device.device_type != "tvOS" }
94
+ end
95
+
96
+ # @return (Array) Returns all devices that can be used for iOS profiles (all devices except TVs)
97
+ def all_for_profile_type(profile_type)
98
+ if profile_type.include? "tvOS"
99
+ Spaceship::Device.all_apple_tvs
100
+ else
101
+ Spaceship::Device.all_ios_profile_devices
102
+ end
103
+ end
104
+
92
105
  # @return (Device) Find a device based on the ID of the device. *Attention*:
93
106
  # This is *not* the UDID. nil if no device was found.
94
107
  def find(device_id)
@@ -212,8 +212,8 @@ module Spaceship
212
212
 
213
213
  if devices.nil? or devices.count == 0
214
214
  if self == Development or self == AdHoc
215
- # For Development and AdHoc we usually want all devices by default
216
- devices = Spaceship::Device.all.find_all { |d| d.device_type != 'pc' }
215
+ # For Development and AdHoc we usually want all compatible devices by default
216
+ devices = Spaceship::Device.all_for_profile_type(self.type)
217
217
  end
218
218
  end
219
219
 
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.12.2"
2
+ VERSION = "0.12.3"
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.12.2
4
+ version: 0.12.3
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: 2015-10-19 00:00:00.000000000 Z
12
+ date: 2015-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager