8
9
10
11
12
13
14
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
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/xcode-installer/list.rb', line 8
def action(args, options)
show_all = args.include? 'all'
show_gui = args.include? 'gui'
show_cli = args.include? 'cli'
show_gui = true if !show_all && !show_gui && !show_cli
mgr = XcodeInstaller::ReleaseManager.new
gui_versions = mgr.get_all('gui')
cli_versions = mgr.get_all('cli')
if show_all || show_gui
title = 'Xcode GUI'
table = Terminal::Table.new :title => title do |t|
t << ['Version', 'Download URL']
gui_versions.each do |release|
t << :separator
row = [release['version'], release['download_url']]
t << row
end
end
puts table
end
puts if show_all
if show_all || show_cli
title = 'Xcode Command-Line'
table = Terminal::Table.new :title => title do |t|
t << ['Version', 'Download URL']
cli_versions.each do |release|
t << :separator
row = [release['version'], release['download_url']]
t << row
end
end
puts table
end
end
|