15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/collins_shell/provision.rb', line 15
def list
table = Terminal::Table.new
table.title = set_color("Provisioning Profiles", :bold, :magenta)
table << [
"Profile", "Label", "Prefix", "Pool", split("Primary Role"), split("Secondary Role"),
split("Suffix Allowed?"), split("Requires Primary Role?"),
split("Requires Secondary Role?"), split("Requires Pool?")
]
table << :separator
data = call_collins get_collins_client, '/api/provision/profiles' do |client|
profs = client.provisioning_profiles
last = profs.size - 1
profs.each_with_index do |profile, idx|
table << [
profile.profile, split(profile.label), profile.prefix, optional_string(profile.pool),
optional_string(profile.primary_role), optional_string(profile.secondary_role),
centered(profile.suffix_allowed?), centered(profile.requires_primary_role?),
centered(profile.requires_secondary_role?), centered(profile.requires_pool?)
]
if idx != last && too_wide? then
table << :separator
end
end
end
puts table
end
|