capify-ec2 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.3.6 (Jan 17, 2013)
2
+
3
+ Bugfixes:
4
+
5
+ - Fix ec2:status alignment issues when the column contents are smaller than the column headings.
6
+
1
7
  ## 1.3.5 (Jan 11, 2013)
2
8
 
3
9
  Features:
data/lib/capify-ec2.rb CHANGED
@@ -18,7 +18,7 @@ class CapifyEc2
18
18
  @ec2_config = ec2_config
19
19
  when String
20
20
  @ec2_config = YAML.load_file ec2_config
21
-
21
+
22
22
  # Maintain backward compatibility with previous config format
23
23
  @ec2_config[:project_tags] ||= []
24
24
  # User can change the Roles tag string
@@ -49,11 +49,11 @@ class CapifyEc2
49
49
  column_widths = { :name_min => 4, :type_min => 4, :dns_min => 5, :roles_min => 5, :options_min => 6 }
50
50
 
51
51
  # Find the longest attribute across all instances, to format the columns properly.
52
- column_widths[:name] = desired_instances.map{|i| i.name || ' ' * column_widths[:name_min] }.max_by(&:length).length
53
- column_widths[:type] = desired_instances.map{|i| i.flavor_id || ' ' * column_widths[:type_min] }.max_by(&:length).length
54
- column_widths[:dns] = desired_instances.map{|i| i.contact_point || ' ' * column_widths[:dns_min] }.max_by(&:length).length
55
- column_widths[:roles] = desired_instances.map{|i| i.tags[@ec2_config[:aws_roles_tag]] || ' ' * column_widths[:roles_min] }.max_by(&:length).length
56
- column_widths[:options] = desired_instances.map{|i| i.tags["Options"] || ' ' * column_widths[:options_min] }.max_by(&:length).length
52
+ column_widths[:name] = desired_instances.map{|i| i.name.to_s.ljust( column_widths[:name_min] ) || ' ' * column_widths[:name_min] }.max_by(&:length).length
53
+ column_widths[:type] = desired_instances.map{|i| i.flavor_id || ' ' * column_widths[:type_min] }.max_by(&:length).length
54
+ column_widths[:dns] = desired_instances.map{|i| i.contact_point.to_s.ljust( column_widths[:dns_min] ) || ' ' * column_widths[:dns_min] }.max_by(&:length).length
55
+ column_widths[:roles] = desired_instances.map{|i| i.tags[@ec2_config[:aws_roles_tag]].to_s.ljust( column_widths[:roles_min] ) || ' ' * column_widths[:roles_min] }.max_by(&:length).length
56
+ column_widths[:options] = desired_instances.map{|i| i.tags["Options"].to_s.ljust( column_widths[:options_min] ) || ' ' * column_widths[:options_min] }.max_by(&:length).length
57
57
 
58
58
  # Title row.
59
59
  puts sprintf "%-3s %s %s %s %s %s %s %s",
@@ -1,6 +1,6 @@
1
1
  module Capify
2
2
  module Ec2
3
- VERSION = "1.3.5"
3
+ VERSION = "1.3.6"
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capify-ec2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 5
10
- version: 1.3.5
9
+ - 6
10
+ version: 1.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Noah Cantor
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-01-11 00:00:00 Z
19
+ date: 2013-01-17 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: fog