6
7
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
|
# File 'lib/webbynode/commands/webbies.rb', line 6
def execute
puts "Fetching list of your Webbies..."
puts ""
= " "
<< "Webbies".ljust(15).color(:white).bright.underline
<< " "
<< "IP".ljust(15).color(:white).bright.underline
<< " "
<< "Node".ljust(11).color(:white).bright.underline
<< " "
<< "Plan".ljust(15).color(:white).bright.underline
<< " "
<< "Status".ljust(14).color(:white).bright.underline
<< " "
puts
webbies = spinner { api.webbies }
webbies.each_pair do |name, webby|
str = " "
str << name.ljust(16).color(:yellow).bright
str << webby['ip'].ljust(16).color(:cyan).bright
str << webby['node'].ljust(12).color(:cyan).bright
str << webby['plan'].ljust(16).color(:cyan).bright
str << (webby['status'] == 'on' ? "on".color(:cyan).bright : "off")
puts str
end
end
|