fastlane 2.149.1 → 2.150.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/deliver/lib/deliver.rb +0 -1
  3. data/deliver/lib/deliver/app_screenshot.rb +26 -25
  4. data/deliver/lib/deliver/options.rb +6 -11
  5. data/deliver/lib/deliver/runner.rb +7 -4
  6. data/deliver/lib/deliver/setup.rb +5 -30
  7. data/deliver/lib/deliver/submit_for_review.rb +124 -87
  8. data/deliver/lib/deliver/upload_metadata.rb +284 -143
  9. data/deliver/lib/deliver/upload_price_tier.rb +15 -8
  10. data/deliver/lib/deliver/upload_screenshots.rb +86 -37
  11. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  12. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +3 -11
  13. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +3 -2
  14. data/fastlane/lib/fastlane/actions/download_dsyms.rb +7 -1
  15. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  16. data/fastlane/lib/fastlane/actions/slack.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  18. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -32
  19. data/fastlane/lib/fastlane/lane.rb +3 -3
  20. data/fastlane/lib/fastlane/swift_fastlane_function.rb +8 -4
  21. data/fastlane/lib/fastlane/version.rb +1 -1
  22. data/fastlane/swift/ControlCommand.swift +1 -0
  23. data/fastlane/swift/Fastlane.swift +48 -12
  24. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +3 -9
  25. data/fastlane/swift/LaneFileProtocol.swift +2 -5
  26. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  27. data/fastlane/swift/RubyCommand.swift +29 -6
  28. data/fastlane/swift/RubyCommandable.swift +1 -0
  29. data/fastlane/swift/Runner.swift +85 -13
  30. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  31. data/fastlane/swift/SnapshotfileProtocol.swift +3 -3
  32. data/fastlane/swift/SocketClient.swift +76 -45
  33. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  34. data/fastlane/swift/SocketResponse.swift +1 -0
  35. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -3
  36. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +7 -0
  37. data/frameit/lib/frameit/device_types.rb +100 -100
  38. data/produce/lib/produce/itunes_connect.rb +20 -20
  39. data/produce/lib/produce/options.rb +3 -3
  40. data/sigh/lib/assets/resign.sh +7 -7
  41. data/snapshot/lib/assets/SnapshotHelper.swift +5 -5
  42. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +3 -3
  43. data/snapshot/lib/snapshot/options.rb +0 -1
  44. data/snapshot/lib/snapshot/reports_generator.rb +8 -1
  45. data/spaceship/lib/spaceship/.DS_Store +0 -0
  46. data/spaceship/lib/spaceship/connect_api.rb +21 -2
  47. data/spaceship/lib/spaceship/connect_api/client.rb +47 -11
  48. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  49. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +109 -0
  50. data/spaceship/lib/spaceship/connect_api/models/app.rb +113 -3
  51. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  52. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +74 -0
  53. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +38 -0
  54. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  55. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  56. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +81 -0
  57. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +117 -0
  58. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +101 -0
  59. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
  60. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +182 -0
  61. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +70 -0
  62. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +36 -0
  63. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
  64. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -0
  65. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +40 -0
  66. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
  67. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +10 -3
  68. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +33 -0
  69. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +703 -0
  70. data/spaceship/lib/spaceship/spaceauth_runner.rb +2 -2
  71. data/supply/lib/supply/client.rb +19 -0
  72. data/supply/lib/supply/reader.rb +16 -0
  73. metadata +27 -24
  74. data/deliver/lib/deliver/upload_assets.rb +0 -27
  75. data/scan/lib/scan/.test_command_generator.rb.swp +0 -0
  76. data/snapshot/lib/snapshot/.test_command_generator_base.rb.swp +0 -0
@@ -258,4 +258,4 @@ extension ScanfileProtocol {
258
258
 
259
259
  // Please don't remove the lines below
260
260
  // They are used to detect outdated files
261
- // FastlaneRunnerAPIVersion [0.9.30]
261
+ // FastlaneRunnerAPIVersion [0.9.23]
@@ -64,7 +64,7 @@ protocol SnapshotfileProtocol: class {
64
64
  var addVideos: [String]? { get }
65
65
 
66
66
  /// A path to screenshots.html template
67
- var htmlTemplate: String { get }
67
+ var htmlTemplate: String? { get }
68
68
 
69
69
  /// The directory where to store the build log
70
70
  var buildlogPath: String { get }
@@ -149,7 +149,7 @@ extension SnapshotfileProtocol {
149
149
  var appIdentifier: String? { return nil }
150
150
  var addPhotos: [String]? { return nil }
151
151
  var addVideos: [String]? { return nil }
152
- var htmlTemplate: String { return "/Users/josh/Projects/fastlane/fastlane/snapshot/lib/snapshot/page.html.erb" }
152
+ var htmlTemplate: String? { return nil }
153
153
  var buildlogPath: String { return "~/Library/Logs/snapshot" }
154
154
  var clean: Bool { return false }
155
155
  var testWithoutBuilding: Bool? { return nil }
@@ -174,4 +174,4 @@ extension SnapshotfileProtocol {
174
174
 
175
175
  // Please don't remove the lines below
176
176
  // They are used to detect outdated files
177
- // FastlaneRunnerAPIVersion [0.9.10]
177
+ // FastlaneRunnerAPIVersion [0.9.7]
@@ -13,6 +13,7 @@
13
13
  //
14
14
 
15
15
  import Foundation
16
+ import Dispatch
16
17
 
17
18
  public enum SocketClientResponse: Error {
18
19
  case alreadyClosedSockets
@@ -41,8 +42,12 @@ class SocketClient: NSObject {
41
42
  fileprivate var outputStream: OutputStream!
42
43
  fileprivate var cleaningUpAfterDone = false
43
44
  fileprivate let dispatchGroup: DispatchGroup = DispatchGroup()
45
+ fileprivate let readSemaphore = DispatchSemaphore(value: 1)
46
+ fileprivate let writeSemaphore = DispatchSemaphore(value: 1)
44
47
  fileprivate let commandTimeoutSeconds: Int
45
48
 
49
+ private let writeQueue: DispatchQueue
50
+ private let readQueue: DispatchQueue
46
51
  private let streamQueue: DispatchQueue
47
52
  private let host: String
48
53
  private let port: UInt32
@@ -58,7 +63,9 @@ class SocketClient: NSObject {
58
63
  self.host = host
59
64
  self.port = port
60
65
  self.commandTimeoutSeconds = commandTimeoutSeconds
61
- self.streamQueue = DispatchQueue(label: "streamQueue")
66
+ self.readQueue = DispatchQueue(label: "readQueue", qos: .background, attributes: .concurrent)
67
+ self.writeQueue = DispatchQueue(label: "writeQueue", qos: .background, attributes: .concurrent)
68
+ self.streamQueue = DispatchQueue.global(qos: .background)
62
69
  self.socketStatus = .closed
63
70
  self.socketDelegate = socketDelegate
64
71
  super.init()
@@ -68,7 +75,7 @@ class SocketClient: NSObject {
68
75
  var readStream: Unmanaged<CFReadStream>?
69
76
  var writeStream: Unmanaged<CFWriteStream>?
70
77
 
71
- self.streamQueue.async {
78
+ self.streamQueue.sync {
72
79
  CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, self.host as CFString, self.port, &readStream, &writeStream)
73
80
 
74
81
  self.inputStream = readStream!.takeRetainedValue()
@@ -82,12 +89,12 @@ class SocketClient: NSObject {
82
89
  }
83
90
 
84
91
  self.dispatchGroup.enter()
85
- self.streamQueue.async {
92
+ self.readQueue.sync {
86
93
  self.inputStream.open()
87
94
  }
88
95
 
89
96
  self.dispatchGroup.enter()
90
- self.streamQueue.async {
97
+ self.writeQueue.sync {
91
98
  self.outputStream.open()
92
99
  }
93
100
 
@@ -100,7 +107,7 @@ class SocketClient: NSObject {
100
107
  let success = testDispatchTimeoutResult(timeoutResult, failureMessage: failureMessage, timeToWait: secondsToWait)
101
108
 
102
109
  guard success else {
103
- self.socketDelegate?.commandExecuted(serverResponse: .connectionFailure)
110
+ self.socketDelegate?.commandExecuted(serverResponse: .connectionFailure) { _ in }
104
111
  return
105
112
  }
106
113
 
@@ -125,7 +132,7 @@ class SocketClient: NSObject {
125
132
  log(message: "Timeout: \(failureMessage)")
126
133
 
127
134
  if case .seconds(let seconds) = timeToWait {
128
- socketDelegate?.commandExecuted(serverResponse: .commandTimeout(seconds: seconds))
135
+ socketDelegate?.commandExecuted(serverResponse: .commandTimeout(seconds: seconds)) { _ in }
129
136
  }
130
137
  return false
131
138
  }
@@ -140,29 +147,30 @@ class SocketClient: NSObject {
140
147
  }
141
148
 
142
149
  private func sendThroughQueue(string: String) {
143
- streamQueue.async {
144
- let data = string.data(using: .utf8)!
145
- _ = data.withUnsafeBytes { self.outputStream.write($0, maxLength: data.count) }
146
- }
150
+ let data = string.data(using: .utf8)!
151
+ _ = data.withUnsafeBytes { self.outputStream.write($0, maxLength: data.count) }
147
152
  }
148
153
 
149
154
  private func privateSend(string: String) {
150
- self.dispatchGroup.enter()
151
- sendThroughQueue(string: string)
152
-
153
- let timeoutSeconds = self.cleaningUpAfterDone ? 1 : self.commandTimeoutSeconds
154
- let timeToWait = DispatchTimeInterval.seconds(timeoutSeconds)
155
- let commandTimeout = DispatchTime.now() + timeToWait
156
- let timeoutResult = self.dispatchGroup.wait(timeout: commandTimeout)
157
-
158
- _ = testDispatchTimeoutResult(timeoutResult, failureMessage: "Ruby process didn't return after: \(SocketClient.connectTimeoutSeconds) seconds", timeToWait: timeToWait)
155
+ writeQueue.sync {
156
+ writeSemaphore.wait()
157
+ self.sendThroughQueue(string: string)
158
+ writeSemaphore.signal()
159
+ let timeoutSeconds = self.cleaningUpAfterDone ? 1 : self.commandTimeoutSeconds
160
+ let timeToWait = DispatchTimeInterval.seconds(timeoutSeconds)
161
+ let commandTimeout = DispatchTime.now() + timeToWait
162
+ let timeoutResult = writeSemaphore.wait(timeout: commandTimeout)
163
+
164
+ _ = self.testDispatchTimeoutResult(timeoutResult, failureMessage: "Ruby process didn't return after: \(SocketClient.connectTimeoutSeconds) seconds", timeToWait: timeToWait)
165
+
166
+ }
159
167
  }
160
168
 
161
169
  private func send(string: String) {
162
170
  guard !self.cleaningUpAfterDone else {
163
171
  // This will happen after we abort if there are commands waiting to be executed
164
172
  // Need to check state of SocketClient in command runner to make sure we can accept `send`
165
- socketDelegate?.commandExecuted(serverResponse: .alreadyClosedSockets)
173
+ socketDelegate?.commandExecuted(serverResponse: .alreadyClosedSockets) { _ in }
166
174
  return
167
175
  }
168
176
 
@@ -185,6 +193,15 @@ class SocketClient: NSObject {
185
193
  stopOutputSession()
186
194
  self.socketDelegate?.connectionsClosed()
187
195
  }
196
+
197
+ public func enter() {
198
+ dispatchGroup.enter()
199
+ }
200
+
201
+ public func leave() {
202
+ readSemaphore.signal()
203
+ writeSemaphore.signal()
204
+ }
188
205
  }
189
206
 
190
207
  extension SocketClient: StreamDelegate {
@@ -246,18 +263,24 @@ extension SocketClient: StreamDelegate {
246
263
  }
247
264
 
248
265
  func read() {
249
- var buffer = [UInt8](repeating: 0, count: maxReadLength)
250
- var output = ""
251
- while self.inputStream!.hasBytesAvailable {
252
- let bytesRead: Int = inputStream!.read(&buffer, maxLength: buffer.count)
253
- if bytesRead >= 0 {
254
- output += NSString(bytes: UnsafePointer(buffer), length: bytesRead, encoding: String.Encoding.utf8.rawValue)! as String
255
- } else {
256
- verbose(message: "Stream read() error")
266
+ readQueue.sync {
267
+ self.readSemaphore.wait()
268
+ var buffer = [UInt8](repeating: 0, count: maxReadLength)
269
+ var output = ""
270
+ while self.inputStream!.hasBytesAvailable {
271
+ let bytesRead: Int = inputStream!.read(&buffer, maxLength: buffer.count)
272
+ if bytesRead >= 0 {
273
+ guard let read = String(bytes: buffer[..<bytesRead], encoding: .utf8) else {
274
+ fatalError("Unable to decode bytes from buffer \(buffer[..<bytesRead])")
275
+ }
276
+ output.append(contentsOf: read)
277
+ } else {
278
+ verbose(message: "Stream read() error")
279
+ }
257
280
  }
281
+ self.processResponse(string: output, socket: self)
282
+ readSemaphore.signal()
258
283
  }
259
-
260
- processResponse(string: output)
261
284
  }
262
285
 
263
286
  func handleFailure(message: [String]) {
@@ -266,11 +289,12 @@ extension SocketClient: StreamDelegate {
266
289
  self.send(rubyCommand: shutdownCommand)
267
290
  }
268
291
 
269
- func processResponse(string: String) {
292
+ func processResponse(string: String, socket: SocketClient) {
270
293
  guard string.count > 0 else {
271
- self.socketDelegate?.commandExecuted(serverResponse: .malformedResponse)
272
- self.handleFailure(message: ["empty response from ruby process"])
273
-
294
+ self.socketDelegate?.commandExecuted(serverResponse: .malformedResponse) {
295
+ self.handleFailure(message: ["empty response from ruby process"])
296
+ $0.writeSemaphore.signal()
297
+ }
274
298
  return
275
299
  }
276
300
 
@@ -279,24 +303,31 @@ extension SocketClient: StreamDelegate {
279
303
  verbose(message: "response is: \(responseString)")
280
304
  switch socketResponse.responseType {
281
305
  case .clientInitiatedCancel:
282
- self.socketDelegate?.commandExecuted(serverResponse: .clientInitiatedCancelAcknowledged)
283
- self.closeSession(sendAbort: false)
306
+ self.socketDelegate?.commandExecuted(serverResponse: .clientInitiatedCancelAcknowledged) {
307
+ self.closeSession(sendAbort: false)
308
+ $0.writeSemaphore.signal()
309
+ }
310
+
284
311
 
285
312
  case .failure(let failureInformation):
286
- self.socketDelegate?.commandExecuted(serverResponse: .serverError)
287
- self.handleFailure(message: failureInformation)
313
+ self.socketDelegate?.commandExecuted(serverResponse: .serverError) {
314
+ self.handleFailure(message: failureInformation)
315
+ $0.writeSemaphore.signal()
316
+ }
317
+
288
318
 
289
319
  case .parseFailure(let failureInformation):
290
- self.socketDelegate?.commandExecuted(serverResponse: .malformedResponse)
291
- self.handleFailure(message: failureInformation)
320
+ self.socketDelegate?.commandExecuted(serverResponse: .malformedResponse) {
321
+ self.handleFailure(message: failureInformation)
322
+ $0.writeSemaphore.signal()
323
+ }
324
+
292
325
 
293
326
  case .readyForNext(let returnedObject, let closureArgumentValue):
294
- self.socketDelegate?.commandExecuted(serverResponse: .success(returnedObject: returnedObject, closureArgumentValue: closureArgumentValue))
295
- // cool, ready for next command
296
- break
327
+ self.socketDelegate?.commandExecuted(serverResponse: .success(returnedObject: returnedObject, closureArgumentValue: closureArgumentValue)) {
328
+ $0.writeSemaphore.signal()
329
+ }
297
330
  }
298
-
299
- self.dispatchGroup.leave() // should now pull the next piece of work
300
331
  }
301
332
  }
302
333
 
@@ -17,7 +17,7 @@ import Foundation
17
17
  protocol SocketClientDelegateProtocol: class {
18
18
  func connectionsOpened()
19
19
  func connectionsClosed()
20
- func commandExecuted(serverResponse: SocketClientResponse)
20
+ func commandExecuted(serverResponse: SocketClientResponse, completion: (SocketClient) -> Void)
21
21
  }
22
22
 
23
23
  // Please don't remove the lines below
@@ -28,6 +28,7 @@ struct SocketResponse {
28
28
  }
29
29
 
30
30
  if status == "ready_for_next" {
31
+ verbose(message: "ready for next")
31
32
  let returnedObject = statusDictionary["return_object"] as? String
32
33
  let closureArgumentValue = statusDictionary["closure_argument_value"] as? String
33
34
  self = .readyForNext(returnedObject: returnedObject, closureArgumentValue: closureArgumentValue)
@@ -264,9 +264,7 @@ module FastlaneCore
264
264
 
265
265
  # Determines the defined data type of this ConfigItem
266
266
  def data_type
267
- if @data_type.kind_of?(Symbol)
268
- nil
269
- elsif @data_type
267
+ if @data_type
270
268
  @data_type
271
269
  else
272
270
  (@is_string ? String : nil)
@@ -17,6 +17,13 @@ module FastlaneCore
17
17
  return nil
18
18
  end
19
19
 
20
+ # Fetches the app version from the given pkg file.
21
+ def self.fetch_app_build(path)
22
+ xml = self.fetch_distribution_xml_file(path)
23
+ return xml.elements['installer-gui-script/pkg-ref/bundle-version/bundle'].attributes['CFBundleVersion'] if xml
24
+ return nil
25
+ end
26
+
20
27
  def self.fetch_distribution_xml_file(path)
21
28
  Dir.mktmpdir do |dir|
22
29
  Helper.backticks("xar -C #{dir.shellescape} -xf #{path.shellescape}")
@@ -1,50 +1,50 @@
1
- require_relative 'device'
2
1
  require_relative 'module'
2
+ require_relative './device'
3
3
  require 'deliver/app_screenshot'
4
4
 
5
5
  module Frameit
6
6
  module Color
7
- MATTE_BLACK = "Matte Black"
8
- SPACE_GRAY = "Space Gray"
9
- ROSE_GOLD = "Rose Gold"
10
- CLEARLY_WHITE = "Clearly White"
11
- JUST_BLACK = "Just Black"
12
- NOT_PINK = "Not Pink"
13
- SILVER_TITANIUM = "Silver Titanium"
14
- ARCTIC_SILVER = "Arctic Silver"
15
- CORAL_BLUE = "Coral Blue"
16
- MAPLE_GOLD = "Maple Gold"
17
- MIDNIGHT_BLACK = "Midnight Black"
18
- MIDNIGHT_GREEN = "Midnight Green"
19
- ORCHID_GRAY = "Orchid Gray"
20
- BURGUNDY_RED = "Burgundy Red"
21
- LILAC_PURPLE = "Lilac Purple"
22
- SUNRISE_GOLD = "Sunrise Gold"
23
- TITANIUM_GRAY = "Titanium Gray"
24
- FLAMINGO_PINK = "Flamingo Pink"
25
- PRISM_BLACK = "Prism Black"
26
- PRISM_BLUE = "Prism Blue"
27
- PRISM_GREEN = "Prism Green"
28
- PRISM_WHITE = "Prism White"
29
- CERAMIC_WHITE = "Ceramic White"
30
- OH_SO_ORANGE = "Oh So Orange"
31
- AURA_BLACK = "Aura Black"
32
- AURA_GLOW = "Aura Glow"
33
- AURA_PINK = "Aura Pink"
34
- AURA_RED = "Aura Red"
35
- AURA_WHITE = "Aura White"
36
- AURA_BLUE = "Aura Blue"
37
- CORAL = "Coral"
38
- BLACK = "Black"
39
- WHITE = "White"
40
- GOLD = "Gold"
41
- SILVER = "Silver"
42
- BLUE = "Blue"
43
- RED = "Red"
44
- YELLOW = "Yellow"
45
- GREEN = "Green"
46
- PINK = "Pink"
47
- PURPLE = "Purple"
7
+ MATTE_BLACK ||= "Matte Black"
8
+ SPACE_GRAY ||= "Space Gray"
9
+ ROSE_GOLD ||= "Rose Gold"
10
+ CLEARLY_WHITE ||= "Clearly White"
11
+ JUST_BLACK ||= "Just Black"
12
+ NOT_PINK ||= "Not Pink"
13
+ SILVER_TITANIUM ||= "Silver Titanium"
14
+ ARCTIC_SILVER ||= "Arctic Silver"
15
+ CORAL_BLUE ||= "Coral Blue"
16
+ MAPLE_GOLD ||= "Maple Gold"
17
+ MIDNIGHT_BLACK ||= "Midnight Black"
18
+ MIDNIGHT_GREEN ||= "Midnight Green"
19
+ ORCHID_GRAY ||= "Orchid Gray"
20
+ BURGUNDY_RED ||= "Burgundy Red"
21
+ LILAC_PURPLE ||= "Lilac Purple"
22
+ SUNRISE_GOLD ||= "Sunrise Gold"
23
+ TITANIUM_GRAY ||= "Titanium Gray"
24
+ FLAMINGO_PINK ||= "Flamingo Pink"
25
+ PRISM_BLACK ||= "Prism Black"
26
+ PRISM_BLUE ||= "Prism Blue"
27
+ PRISM_GREEN ||= "Prism Green"
28
+ PRISM_WHITE ||= "Prism White"
29
+ CERAMIC_WHITE ||= "Ceramic White"
30
+ OH_SO_ORANGE ||= "Oh So Orange"
31
+ AURA_BLACK ||= "Aura Black"
32
+ AURA_GLOW ||= "Aura Glow"
33
+ AURA_PINK ||= "Aura Pink"
34
+ AURA_RED ||= "Aura Red"
35
+ AURA_WHITE ||= "Aura White"
36
+ AURA_BLUE ||= "Aura Blue"
37
+ CORAL ||= "Coral"
38
+ BLACK ||= "Black"
39
+ WHITE ||= "White"
40
+ GOLD ||= "Gold"
41
+ SILVER ||= "Silver"
42
+ BLUE ||= "Blue"
43
+ RED ||= "Red"
44
+ YELLOW ||= "Yellow"
45
+ GREEN ||= "Green"
46
+ PINK ||= "Pink"
47
+ PURPLE ||= "Purple"
48
48
 
49
49
  def self.all_colors
50
50
  Color.constants.map { |c| Color.const_get(c).upcase.gsub(' ', '_') }
@@ -52,14 +52,14 @@ module Frameit
52
52
  end
53
53
 
54
54
  module Orientation
55
- PORTRAIT = "PORTRAIT"
56
- LANDSCAPE = "LANDSCAPE"
55
+ PORTRAIT ||= "PORTRAIT"
56
+ LANDSCAPE ||= "LANDSCAPE"
57
57
  end
58
58
 
59
59
  module Platform
60
- ANDROID = "ANDROID"
61
- IOS = "IOS"
62
- ANY = "ANY"
60
+ ANDROID ||= "ANDROID"
61
+ IOS ||= "IOS"
62
+ ANY ||= "ANY"
63
63
 
64
64
  def self.all_platforms
65
65
  Platform.constants.map { |c| Platform.const_get(c) }
@@ -75,67 +75,67 @@ module Frameit
75
75
  end
76
76
 
77
77
  module Devices
78
- GOOGLE_PIXEL_3 = Frameit::Device.new("google-pixel-3", "Google Pixel 3", 7, [[1080, 2160], [2160, 1080]], 443, Color::JUST_BLACK, Platform::ANDROID)
79
- GOOGLE_PIXEL_3_XL = Frameit::Device.new("google-pixel-3-xl", "Google Pixel 3 XL", 7, [[1440, 2960], [2960, 1440]], 523, Color::JUST_BLACK, Platform::ANDROID)
78
+ GOOGLE_PIXEL_3 ||= Frameit::Device.new("google-pixel-3", "Google Pixel 3", 7, [[1080, 2160], [2160, 1080]], 443, Color::JUST_BLACK, Platform::ANDROID)
79
+ GOOGLE_PIXEL_3_XL ||= Frameit::Device.new("google-pixel-3-xl", "Google Pixel 3 XL", 7, [[1440, 2960], [2960, 1440]], 523, Color::JUST_BLACK, Platform::ANDROID)
80
80
  # Google Pixel 4's priority should be higher than Samsung Galaxy S10+ (priority 8):
81
- GOOGLE_PIXEL_4 = Frameit::Device.new("google-pixel-4", "Google Pixel 4", 9, [[1080, 2280], [2280, 1080]], 444, Color::JUST_BLACK, Platform::ANDROID)
82
- GOOGLE_PIXEL_4_XL = Frameit::Device.new("google-pixel-4-xl", "Google Pixel 4 XL", 9, [[1440, 3040], [3040, 1440]], 537, Color::JUST_BLACK, Platform::ANDROID)
83
- HTC_ONE_A9 = Frameit::Device.new("htc-one-a9", "HTC One A9", 6, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
84
- HTC_ONE_M8 = Frameit::Device.new("htc-one-m8", "HTC One M8", 3, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
85
- HUAWEI_P8 = Frameit::Device.new("huawei-p8", "Huawei P8", 5, [[1080, 1920], [1920, 1080]], 424, Color::BLACK, Platform::ANDROID)
86
- MOTOROLA_MOTO_E = Frameit::Device.new("motorola-moto-e", "Motorola Moto E", 3, [[540, 960], [960, 540]], 245, Color::BLACK, Platform::ANDROID)
87
- MOTOROLA_MOTO_G = Frameit::Device.new("motorola-moto-g", "Motorola Moto G", 4, [[1080, 1920], [1920, 1080]], 401, nil, Platform::ANDROID, nil)
88
- NEXUS_4 = Frameit::Device.new("nexus-4", "Nexus 4", 7, [[768, 1280], [1820, 768]], 318, nil, Platform::ANDROID)
89
- NEXUS_5X = Frameit::Device.new("nexus-5x", "Nexus 5X", 7, [[1080, 1920], [1920, 1080]], 423, nil, Platform::ANDROID)
90
- NEXUS_6P = Frameit::Device.new("nexus-6p", "Nexus 6P", 7, [[1440, 2560], [2560, 1440]], 518, nil, Platform::ANDROID)
91
- NEXUS_9 = Frameit::Device.new("nexus-9", "Nexus 9", 7, [[1536, 2048], [2048, 1536]], 281, nil, Platform::ANDROID)
92
- SAMSUNG_GALAXY_GRAND_PRIME = Frameit::Device.new("samsung-galaxy-grand-prime", "Samsung Galaxy Grand Prime", 5, [[540, 960], [960, 540]], 220, Color::BLACK, Platform::ANDROID)
93
- SAMSUNG_GALAXY_NOTE_5 = Frameit::Device.new("samsung-galaxy-note-5", "Samsung Galaxy Note 5", 5, [[1440, 2560], [2560, 1440]], 518, Color::BLACK, Platform::ANDROID)
94
- SAMSUNG_GALAXY_NOTE_10 = Frameit::Device.new("samsung-galaxy-note-10", "Samsung Galaxy Note 10", 6, [[1080, 2280], [2280, 1080]], 401, Color::AURA_BLACK, Platform::ANDROID)
95
- SAMSUNG_GALAXY_NOTE_10_PLUS = Frameit::Device.new("samsung-galaxy-note-10-plus", "Samsung Galaxy Note 10+", 7, [[1440, 3040], [3040, 1440]], 498, Color::AURA_BLACK, Platform::ANDROID)
96
- SAMSUNG_GALAXY_S_DUOS = Frameit::Device.new("samsung-galaxy-s-duos", "Samsung Galaxy S Duos", 3, [[480, 800], [800, 480]], 233, nil, Platform::ANDROID)
97
- SAMSUNG_GALAXY_S3 = Frameit::Device.new("samsung-galaxy-s3", "Samsung Galaxy S3", 3, [[720, 1280], [1280, 720]], 306, nil, Platform::ANDROID)
98
- SAMSUNG_GALAXY_S5 = Frameit::Device.new("samsung-galaxy-s5", "Samsung Galaxy S5", 3, [[1080, 1920], [1920, 1080]], 432, Color::BLACK, Platform::ANDROID)
99
- SAMSUNG_GALAXY_S7 = Frameit::Device.new("samsung-galaxy-s7", "Samsung Galaxy S7", 4, [[1440, 2560], [2560, 1440]], 577, Color::BLACK, Platform::ANDROID)
100
- SAMSUNG_GALAXY_S8 = Frameit::Device.new("samsung-galaxy-s8", "Samsung Galaxy S8", 5, [[1440, 2960], [2960, 1440]], 570, Color::MIDNIGHT_BLACK, Platform::ANDROID)
101
- SAMSUNG_GALAXY_S9 = Frameit::Device.new("samsung-galaxy-s9", "Samsung Galaxy S9", 6, [[1440, 2960], [2960, 1440]], 570, Color::MIDNIGHT_BLACK, Platform::ANDROID)
102
- SAMSUNG_GALAXY_S10 = Frameit::Device.new("samsung-galaxy-s10", "Samsung Galaxy S10", 7, [[1440, 3040], [3040, 1440]], 550, Color::PRISM_BLACK, Platform::ANDROID)
103
- SAMSUNG_GALAXY_S10_PLUS = Frameit::Device.new("samsung-galaxy-s10-plus", "Samsung Galaxy S10+", 8, [[1440, 3040], [3040, 1440]], 522, Color::PRISM_BLACK, Platform::ANDROID)
104
- XIAOMI_MI_MIX_ALPHA = Frameit::Device.new("xiaomi-mi-mix-alpha", "Xiaomi Mi Mix Alpha", 1, [[2088, 2250], [2250, 2088]], 388, nil, Platform::ANDROID)
105
- IPHONE_5S = Frameit::Device.new("iphone-5s", "Apple iPhone 5s", 2, [[640, 1096], [640, 1136], [1136, 600], [1136, 640]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_40, :use_legacy_iphone5s)
106
- IPHONE_5C = Frameit::Device.new("iphone-5c", "Apple iPhone 5c", 2, [[640, 1136], [1136, 640]], 326, Color::WHITE)
107
- IPHONE_SE = Frameit::Device.new("iphone-se", "Apple iPhone SE", 3, [[640, 1096], [640, 1136], [1136, 600], [1136, 640]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_40)
108
- IPHONE_6S = Frameit::Device.new("iphone-6s", "Apple iPhone 6s", 4, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone6s)
109
- IPHONE_6S_PLUS = Frameit::Device.new("iphone-6s-plus", "Apple iPhone 6s Plus", 4, [[1242, 2208], [2208, 1242]], 401, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone6s)
110
- IPHONE_7 = Frameit::Device.new("iphone-7", "Apple iPhone 7", 5, [[750, 1334], [1334, 750]], 326, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone7)
111
- IPHONE_7_PLUS = Frameit::Device.new("iphone-7-plus", "Apple iPhone 7 Plus", 5, [[1242, 2208], [2208, 1242]], 401, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone7)
112
- IPHONE_8 = Frameit::Device.new("iphone-8", "Apple iPhone 8", 6, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY)
113
- IPHONE_8_PLUS = Frameit::Device.new("iphone-8-plus", "Apple iPhone 8 Plus", 6, [[1080, 1920], [1920, 1080]], 401, Color::SPACE_GRAY)
114
- IPHONE_X = Frameit::Device.new("iphone-X", "Apple iPhone X", 7, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonex)
115
- IPHONE_XS = Frameit::Device.new("iphone-XS", "Apple iPhone XS", 8, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonexs)
116
- IPHONE_XR = Frameit::Device.new("iphone-XR", "Apple iPhone XR", 8, [[828, 1792], [1792, 828]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_61, :use_legacy_iphonexr)
117
- IPHONE_XS_MAX = Frameit::Device.new("iphone-XS-Max", "Apple iPhone XS Max", 8, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_65, :use_legacy_iphonexsmax)
118
- IPHONE_11 = Frameit::Device.new("iphone-11", "Apple iPhone 11", 9, [[828, 1792], [1792, 828]], 326, Color::BLACK, Platform::IOS)
119
- IPHONE_11_PRO = Frameit::Device.new("iphone-11-pro", "Apple iPhone 11 Pro", 9, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS)
120
- IPHONE_11_PRO_MAX = Frameit::Device.new("iphone11-pro-max", "Apple iPhone 11 Pro Max", 9, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS)
121
- IPAD_10_2 = Frameit::Device.new("ipad-10-2", "Apple iPad 10.2", 1, [[1620, 2160], [2160, 1620]], 264, Color::SPACE_GRAY, Platform::IOS)
122
- IPAD_AIR_2 = Frameit::Device.new("ipad-air-2", "Apple iPad Air 2", 1, [[1536, 2048], [2048, 1536]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD)
123
- IPAD_AIR_2019 = Frameit::Device.new("ipad-air-2019", "Apple iPad Air (2019)", 2, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS)
124
- IPAD_MINI_4 = Frameit::Device.new("ipad-mini-4", "Apple iPad Mini 4", 2, [[1536, 2048], [2048, 1536]], 324, Color::SPACE_GRAY)
125
- IPAD_MINI_2019 = Frameit::Device.new("ipad-mini-2019", "Apple iPad Mini (2019)", 3, [[1536, 2048], [2048, 1536]], 324, Color::SPACE_GRAY)
81
+ GOOGLE_PIXEL_4 ||= Frameit::Device.new("google-pixel-4", "Google Pixel 4", 9, [[1080, 2280], [2280, 1080]], 444, Color::JUST_BLACK, Platform::ANDROID)
82
+ GOOGLE_PIXEL_4_XL ||= Frameit::Device.new("google-pixel-4-xl", "Google Pixel 4 XL", 9, [[1440, 3040], [3040, 1440]], 537, Color::JUST_BLACK, Platform::ANDROID)
83
+ HTC_ONE_A9 ||= Frameit::Device.new("htc-one-a9", "HTC One A9", 6, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
84
+ HTC_ONE_M8 ||= Frameit::Device.new("htc-one-m8", "HTC One M8", 3, [[1080, 1920], [1920, 1080]], 441, Color::BLACK, Platform::ANDROID)
85
+ HUAWEI_P8 ||= Frameit::Device.new("huawei-p8", "Huawei P8", 5, [[1080, 1920], [1920, 1080]], 424, Color::BLACK, Platform::ANDROID)
86
+ MOTOROLA_MOTO_E ||= Frameit::Device.new("motorola-moto-e", "Motorola Moto E", 3, [[540, 960], [960, 540]], 245, Color::BLACK, Platform::ANDROID)
87
+ MOTOROLA_MOTO_G ||= Frameit::Device.new("motorola-moto-g", "Motorola Moto G", 4, [[1080, 1920], [1920, 1080]], 401, nil, Platform::ANDROID, nil)
88
+ NEXUS_4 ||= Frameit::Device.new("nexus-4", "Nexus 4", 7, [[768, 1280], [1820, 768]], 318, nil, Platform::ANDROID)
89
+ NEXUS_5X ||= Frameit::Device.new("nexus-5x", "Nexus 5X", 7, [[1080, 1920], [1920, 1080]], 423, nil, Platform::ANDROID)
90
+ NEXUS_6P ||= Frameit::Device.new("nexus-6p", "Nexus 6P", 7, [[1440, 2560], [2560, 1440]], 518, nil, Platform::ANDROID)
91
+ NEXUS_9 ||= Frameit::Device.new("nexus-9", "Nexus 9", 7, [[1536, 2048], [2048, 1536]], 281, nil, Platform::ANDROID)
92
+ SAMSUNG_GALAXY_GRAND_PRIME ||= Frameit::Device.new("samsung-galaxy-grand-prime", "Samsung Galaxy Grand Prime", 5, [[540, 960], [960, 540]], 220, Color::BLACK, Platform::ANDROID)
93
+ SAMSUNG_GALAXY_NOTE_5 ||= Frameit::Device.new("samsung-galaxy-note-5", "Samsung Galaxy Note 5", 5, [[1440, 2560], [2560, 1440]], 518, Color::BLACK, Platform::ANDROID)
94
+ SAMSUNG_GALAXY_NOTE_10 ||= Frameit::Device.new("samsung-galaxy-note-10", "Samsung Galaxy Note 10", 6, [[1080, 2280], [2280, 1080]], 401, Color::AURA_BLACK, Platform::ANDROID)
95
+ SAMSUNG_GALAXY_NOTE_10_PLUS ||= Frameit::Device.new("samsung-galaxy-note-10-plus", "Samsung Galaxy Note 10+", 7, [[1440, 3040], [3040, 1440]], 498, Color::AURA_BLACK, Platform::ANDROID)
96
+ SAMSUNG_GALAXY_S_DUOS ||= Frameit::Device.new("samsung-galaxy-s-duos", "Samsung Galaxy S Duos", 3, [[480, 800], [800, 480]], 233, nil, Platform::ANDROID)
97
+ SAMSUNG_GALAXY_S3 ||= Frameit::Device.new("samsung-galaxy-s3", "Samsung Galaxy S3", 3, [[720, 1280], [1280, 720]], 306, nil, Platform::ANDROID)
98
+ SAMSUNG_GALAXY_S5 ||= Frameit::Device.new("samsung-galaxy-s5", "Samsung Galaxy S5", 3, [[1080, 1920], [1920, 1080]], 432, Color::BLACK, Platform::ANDROID)
99
+ SAMSUNG_GALAXY_S7 ||= Frameit::Device.new("samsung-galaxy-s7", "Samsung Galaxy S7", 4, [[1440, 2560], [2560, 1440]], 577, Color::BLACK, Platform::ANDROID)
100
+ SAMSUNG_GALAXY_S8 ||= Frameit::Device.new("samsung-galaxy-s8", "Samsung Galaxy S8", 5, [[1440, 2960], [2960, 1440]], 570, Color::MIDNIGHT_BLACK, Platform::ANDROID)
101
+ SAMSUNG_GALAXY_S9 ||= Frameit::Device.new("samsung-galaxy-s9", "Samsung Galaxy S9", 6, [[1440, 2960], [2960, 1440]], 570, Color::MIDNIGHT_BLACK, Platform::ANDROID)
102
+ SAMSUNG_GALAXY_S10 ||= Frameit::Device.new("samsung-galaxy-s10", "Samsung Galaxy S10", 7, [[1440, 3040], [3040, 1440]], 550, Color::PRISM_BLACK, Platform::ANDROID)
103
+ SAMSUNG_GALAXY_S10_PLUS ||= Frameit::Device.new("samsung-galaxy-s10-plus", "Samsung Galaxy S10+", 8, [[1440, 3040], [3040, 1440]], 522, Color::PRISM_BLACK, Platform::ANDROID)
104
+ XIAOMI_MI_MIX_ALPHA ||= Frameit::Device.new("xiaomi-mi-mix-alpha", "Xiaomi Mi Mix Alpha", 1, [[2088, 2250], [2250, 2088]], 388, nil, Platform::ANDROID)
105
+ IPHONE_5S ||= Frameit::Device.new("iphone-5s", "Apple iPhone 5s", 2, [[640, 1096], [640, 1136], [1136, 600], [1136, 640]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_40, :use_legacy_iphone5s)
106
+ IPHONE_5C ||= Frameit::Device.new("iphone-5c", "Apple iPhone 5c", 2, [[640, 1136], [1136, 640]], 326, Color::WHITE)
107
+ IPHONE_SE ||= Frameit::Device.new("iphone-se", "Apple iPhone SE", 3, [[640, 1096], [640, 1136], [1136, 600], [1136, 640]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_40)
108
+ IPHONE_6S ||= Frameit::Device.new("iphone-6s", "Apple iPhone 6s", 4, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone6s)
109
+ IPHONE_6S_PLUS ||= Frameit::Device.new("iphone-6s-plus", "Apple iPhone 6s Plus", 4, [[1242, 2208], [2208, 1242]], 401, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone6s)
110
+ IPHONE_7 ||= Frameit::Device.new("iphone-7", "Apple iPhone 7", 5, [[750, 1334], [1334, 750]], 326, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone7)
111
+ IPHONE_7_PLUS ||= Frameit::Device.new("iphone-7-plus", "Apple iPhone 7 Plus", 5, [[1242, 2208], [2208, 1242]], 401, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone7)
112
+ IPHONE_8 ||= Frameit::Device.new("iphone-8", "Apple iPhone 8", 6, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY)
113
+ IPHONE_8_PLUS ||= Frameit::Device.new("iphone-8-plus", "Apple iPhone 8 Plus", 6, [[1080, 1920], [1920, 1080]], 401, Color::SPACE_GRAY)
114
+ IPHONE_X ||= Frameit::Device.new("iphone-X", "Apple iPhone X", 7, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonex)
115
+ IPHONE_XS ||= Frameit::Device.new("iphone-XS", "Apple iPhone XS", 8, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonexs)
116
+ IPHONE_XR ||= Frameit::Device.new("iphone-XR", "Apple iPhone XR", 8, [[828, 1792], [1792, 828]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_61, :use_legacy_iphonexr)
117
+ IPHONE_XS_MAX ||= Frameit::Device.new("iphone-XS-Max", "Apple iPhone XS Max", 8, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_65, :use_legacy_iphonexsmax)
118
+ IPHONE_11 ||= Frameit::Device.new("iphone-11", "Apple iPhone 11", 9, [[828, 1792], [1792, 828]], 326, Color::BLACK, Platform::IOS)
119
+ IPHONE_11_PRO ||= Frameit::Device.new("iphone-11-pro", "Apple iPhone 11 Pro", 9, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS)
120
+ IPHONE_11_PRO_MAX ||= Frameit::Device.new("iphone11-pro-max", "Apple iPhone 11 Pro Max", 9, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS)
121
+ IPAD_10_2 ||= Frameit::Device.new("ipad-10-2", "Apple iPad 10.2", 1, [[1620, 2160], [2160, 1620]], 264, Color::SPACE_GRAY, Platform::IOS)
122
+ IPAD_AIR_2 ||= Frameit::Device.new("ipad-air-2", "Apple iPad Air 2", 1, [[1536, 2048], [2048, 1536]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD)
123
+ IPAD_AIR_2019 ||= Frameit::Device.new("ipad-air-2019", "Apple iPad Air (2019)", 2, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS)
124
+ IPAD_MINI_4 ||= Frameit::Device.new("ipad-mini-4", "Apple iPad Mini 4", 2, [[1536, 2048], [2048, 1536]], 324, Color::SPACE_GRAY)
125
+ IPAD_MINI_2019 ||= Frameit::Device.new("ipad-mini-2019", "Apple iPad Mini (2019)", 3, [[1536, 2048], [2048, 1536]], 324, Color::SPACE_GRAY)
126
126
  # this is 1st or 2nd gen of iPad Pro 12.9:
127
- IPAD_PRO = Frameit::Device.new("ipad-pro", "Apple iPad Pro", 3, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO)
127
+ IPAD_PRO ||= Frameit::Device.new("ipad-pro", "Apple iPad Pro", 3, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO)
128
128
  # 3rd generation:
129
- IPAD_PRO_12_9 = Frameit::Device.new("ipadPro129", "Apple iPad Pro (12.9-inch) (3rd generation)", 4, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO_12_9)
129
+ IPAD_PRO_12_9 ||= Frameit::Device.new("ipadPro129", "Apple iPad Pro (12.9-inch) (3rd generation)", 4, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO_12_9)
130
130
  # 4th generation:
131
- IPAD_PRO_12_9_4 = Frameit::Device.new("ipadPro129", "Apple iPad Pro (12.9-inch) (4th generation)", 5, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO_12_9)
131
+ IPAD_PRO_12_9_4 ||= Frameit::Device.new("ipadPro129", "Apple iPad Pro (12.9-inch) (4th generation)", 5, [[2048, 2732], [2732, 2048]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_PRO_12_9)
132
132
  # iPad Pro (10.5-inch) is not in frameit-frames repo, but must be included so that we are backward compatible with PR #15373
133
133
  # priority must be lower so that users who didn't copy the frame to their frameit frames folder will not get an error
134
134
  # ID and formatted name must be exactly as specified so that device.detect_device() will select this device if the filename includes them
135
- IPAD_PRO_10_5 = Frameit::Device.new("ipad105", "Apple iPad Pro (10.5-inch)", 1, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_10_5)
136
- IPAD_PRO_11 = Frameit::Device.new("ipadPro11", "Apple iPad Pro (11-inch)", 1, [[1668, 2388], [2388, 1668]], 265, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_11)
135
+ IPAD_PRO_10_5 ||= Frameit::Device.new("ipad105", "Apple iPad Pro (10.5-inch)", 1, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_10_5)
136
+ IPAD_PRO_11 ||= Frameit::Device.new("ipadPro11", "Apple iPad Pro (11-inch)", 1, [[1668, 2388], [2388, 1668]], 265, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD_11)
137
137
 
138
- MAC = Frameit::Device.new("mac", "Apple MacBook", 0, [[1280, 800], [1440, 900], [2560, 1600], [2880, 1800]], nil, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::MAC)
138
+ MAC ||= Frameit::Device.new("mac", "Apple MacBook", 0, [[1280, 800], [1440, 900], [2560, 1600], [2880, 1800]], nil, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::MAC)
139
139
 
140
140
  def self.all_device_names_without_apple
141
141
  Devices.constants.map { |c| Devices.const_get(c).formatted_name_without_apple }