Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

add device's status to show if the device is enabled or disabled #70

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/cupertino/provisioning_portal.rb
Expand Up @@ -8,9 +8,9 @@ module ProvisioningPortal
class UnsuccessfulAuthenticationError < RuntimeError; end
class UnexpectedContentError < RuntimeError; end

class Device < Struct.new(:name, :udid)
class Device < Struct.new(:name, :udid, :enabled)
def to_s
"#{self.name} #{self.udid}"
"#{self.name} #{self.udid} #{self.enabled}"
end
end

Expand Down
1 change: 1 addition & 0 deletions lib/cupertino/provisioning_portal/agent.rb
Expand Up @@ -101,6 +101,7 @@ def list_devices
device = Device.new
device.name = row['name']
device.udid = row['deviceNumber'] # Apple doesn't provide the UDID on this page anymore
device.enabled = (row['status'] == 'c' ? 'Y' : 'N')
devices << device
end

Expand Down
6 changes: 4 additions & 2 deletions lib/cupertino/provisioning_portal/commands/devices.rb
Expand Up @@ -13,13 +13,15 @@
title += "(You can register #{pluralize(number_of_additional_devices, 'additional device')})" if number_of_additional_devices > 0

table = Terminal::Table.new :title => title do |t|
t << ["Device Name", "Device Identifier"]
t << ["Device Name", "Device Identifier", "Enabled"]
t.add_separator
devices.compact.each do |device|
t << [device.name, device.udid]
t << [device.name, device.udid, device.enabled]
end
end

table.align_column 2, :center

puts table
end
end
Expand Down