Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
wants to merge 2 commits into from

3 participants

@dnonnenm

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

@rackliu

not work, lose agent.rb update.
lib/cupertino/provisioning_portal/agent.rb -> 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") # c=Enabled , r=Disabled

Sorry, I didn't check the commit.

@dnonnenm dnonnenm closed this
@dnonnenm dnonnenm reopened this
@mattt
Owner

Thanks for the pull request, @dnonnenm. I squashed your commits down and merged them in ff3233c. Much appreciated!

@mattt mattt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
4 lib/cupertino/provisioning_portal.rb
@@ -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
View
1  lib/cupertino/provisioning_portal/agent.rb
@@ -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
View
6 lib/cupertino/provisioning_portal/commands/devices.rb
@@ -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
Something went wrong with that request. Please try again.