ftl 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ftl.gemspec +1 -1
- data/lib/ftl/client.rb +12 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/ftl.gemspec
CHANGED
data/lib/ftl/client.rb
CHANGED
@@ -37,7 +37,9 @@ module FTL
|
|
37
37
|
if args.first.nil?
|
38
38
|
puts "Please provide the name (or partial name for the instance(s) you want to delete. For instance, like: ftl destroy ninja"
|
39
39
|
end
|
40
|
-
|
40
|
+
puts "Looking for connection to #{args.first}..."
|
41
|
+
server = response.detect{|r| r['name'].first[args.first] }
|
42
|
+
puts "Connecting to #{args.first}..."
|
41
43
|
if server.nil?
|
42
44
|
puts "Couldn't find that server name. try: ftl list"
|
43
45
|
end
|
@@ -58,7 +60,7 @@ module FTL
|
|
58
60
|
def list(args={})
|
59
61
|
response = self.class.get('/machines')
|
60
62
|
column_widths = {'#' => 4}
|
61
|
-
if response.
|
63
|
+
if response.empty?
|
62
64
|
puts "No machines are running"
|
63
65
|
return
|
64
66
|
end
|
@@ -67,11 +69,18 @@ module FTL
|
|
67
69
|
separator = ' |'
|
68
70
|
|
69
71
|
|
72
|
+
p keys
|
70
73
|
keys.each {|r|
|
71
74
|
widths = [r.length + separator.length]
|
72
75
|
widths = widths + response.collect {|pm|
|
73
76
|
# WOW right_aws sucks. Why is everything an array. BS
|
74
|
-
pm[r]
|
77
|
+
p pm[r]
|
78
|
+
p pm
|
79
|
+
if pm[r].nil?
|
80
|
+
0
|
81
|
+
else
|
82
|
+
pm[r].first.length + separator.length
|
83
|
+
end
|
75
84
|
}
|
76
85
|
column_widths[r] = widths.max
|
77
86
|
}
|