ftl 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/ftl.gemspec +1 -1
  3. data/lib/ftl/client.rb +12 -3
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/ftl.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ftl}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Petty"]
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
- server = response.detect{|r| r['name'][args.first] }
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.blank?
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].first.length + separator.length
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
  }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt Petty