docker-spoon 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- docker-spoon (0.4.0)
4
+ docker-spoon (0.5.0)
5
5
  docker-api (~> 1.11)
6
6
  methadone (~> 1.4.0)
7
7
  rainbow (~> 2.0)
@@ -135,13 +135,14 @@ module Spoon
135
135
  def self.instance_list
136
136
  docker_url
137
137
  puts "List of available spoon containers:"
138
- container_list = get_all_containers.sort { |c1, c2| c1.info["Names"].first.to_s <=> c2.info["Names"].first.to_s }
138
+ container_list = get_all_containers.select { |c| c.info["Names"].first.to_s.start_with? "/#{options[:prefix]}" }
139
+ .sort { |c1, c2| c1.info["Names"].first.to_s <=> c2.info["Names"].first.to_s }
140
+ max_width_container_name = remove_prefix(container_list.max_by {|c| c.info["Names"].first.to_s.length }.info["Names"].first.to_s)
141
+ max_name_width = max_width_container_name.length
139
142
  container_list.each do |container|
140
143
  name = container.info["Names"].first.to_s
141
- if name.start_with? "/#{options[:prefix]}"
142
- running = is_running?(container) ? Rainbow("Running").green : Rainbow("Stopped").red
143
- puts "#{remove_prefix(name)} [ #{running} ]".rjust(40) + " " + Rainbow(image_name(container)).yellow
144
- end
144
+ running = is_running?(container) ? Rainbow("Running").green : Rainbow("Stopped").red
145
+ puts "#{remove_prefix(name)} [ #{running} ]".rjust(max_name_width + 22) + " " + Rainbow(image_name(container)).yellow
145
146
  end
146
147
  end
147
148
 
@@ -1,3 +1,3 @@
1
1
  module Spoon
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-spoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-31 00:00:00.000000000 Z
12
+ date: 2014-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler