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

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 2f4e949
Author: David Nonnenmacher <dnonnenm@gmail.com>
Date:   Fri Sep 13 12:03:16 2013 +0200

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

commit a0a81e1
Author: David Nonnenmacher <dnonnenm@gmail.com>
Date:   Tue Sep 10 16:19:03 2013 +0200

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

Signed-off-by: Mattt Thompson <m@mattt.me>
  • Loading branch information
dnonnenm authored and mattt committed Oct 4, 2013
1 parent 695e1a1 commit ff3233c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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

0 comments on commit ff3233c

Please sign in to comment.