Exception: Fastlane::Helper::SyncDevicesHelper::UnsupportedOperation

Inherits:
StandardError
  • Object
show all
Defined in:
lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/device_patch.rb

Overview

Generic error that is raised if no operation is defined in AppStore Connect API for diff of devices.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, old_device, new_device) ⇒ UnsupportedOperation



81
82
83
84
85
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/device_patch.rb', line 81

def initialize(message, old_device, new_device)
  super(message)
  @old_device = old_device
  @new_device = new_device
end

Instance Attribute Details

#new_deviceSpaceship::ConnectAPI::Device (readonly)



76
77
78
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/device_patch.rb', line 76

def new_device
  @new_device
end

#old_deviceSpaceship::ConnectAPI::Device (readonly)



76
77
78
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/device_patch.rb', line 76

def old_device
  @old_device
end

Class Method Details

.change_platform(old_device, new_device) ⇒ UnsupportedOperation



90
91
92
93
94
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/device_patch.rb', line 90

def self.change_platform(old_device, new_device)
  message = "Cannot change platform of the device '#{new_device.udid}' " \
            "(#{old_device.platform} -> #{new_device.platform})"
  new(message, old_device, new_device)
end

.internal_inconsistency(patch, old_device, new_device) ⇒ UnsupportedOperation



100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/fastlane/plugin/sync_devices/helper/sync_devices_helper/device_patch.rb', line 100

def self.internal_inconsistency(patch, old_device, new_device)
  info = {
    renamed?: patch.renamed?,
    enabled?: patch.enabled?,
    disabled?: patch.disabled?,
    created?: patch.created?
  }
  new(
    "Cannot change #{old_device} to #{new_device} because of internal inconsistency. #{info}",
    old_device,
    new_device
  )
end