Skip to content

Commit 6b9b4ea

Browse files
author
Samuel Beaulieu
committed
(DIO-2700) Vmfloaty should not use the Colorize gem
removing cosmetic use of colorize
1 parent 1b64ce3 commit 6b9b4ea

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

Diff for: lib/vmfloaty.rb

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require 'rubygems'
44
require 'commander'
5-
require 'colorize'
65
require 'json'
76
require 'pp'
87
require 'uri'

Diff for: lib/vmfloaty/utils.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def self.pretty_print_hosts(verbose, service, hostnames = [], print_to_stderr =
137137
metadata = [host_data['state'], host_data['template'], duration, *tag_pairs]
138138
message = "- #{hostname}.#{host_data['domain']} (#{metadata.join(', ')})".gsub(/^/, ' ' * indent)
139139
if host_data['state'] && host_data['state'] == 'destroyed'
140-
output_target.puts message.colorize(:red)
140+
output_target.puts "- DESTROYED #{hostname}.#{host_data['domain']}".gsub(/^/, ' ' * indent)
141141
else
142142
output_target.puts message
143143
end
@@ -201,7 +201,7 @@ def self.pretty_print_status(verbose, service)
201201
rescue StandardError => e
202202
FloatyLogger.error "#{name.ljust(width)} #{e.red}"
203203
end
204-
puts message.colorize(status_response['status']['ok'] ? :default : :red)
204+
puts message
205205
when 'NonstandardPooler'
206206
pools = status_response
207207
pools.delete 'ok'

Diff for: lib/vmfloaty/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
class Vmfloaty
4-
VERSION = '1.5.0'
4+
VERSION = '1.6.0'
55
end

Diff for: spec/vmfloaty/utils_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,13 @@ class Service
466466
subject
467467
end
468468

469-
it 'prints in red when destroyed' do
469+
it 'prints DESTROYED and hostname when destroyed' do
470470
fallback = { 'vmpooler_fallback' => 'vmpooler' }
471471
service.config.merge! fallback
472472
response_body_vmpooler[fqdn_hostname]['state'] = 'destroyed'
473-
default_output_second_line_red = " - #{fqdn} (destroyed, #{template}, 7.67/48 hours, user: bob, role: agent)".red
473+
default_output_second_line = " - DESTROYED #{fqdn}"
474474
expect($stdout).to receive(:puts).with(default_output_first_line)
475-
expect($stdout).to receive(:puts).with(default_output_second_line_red)
475+
expect($stdout).to receive(:puts).with(default_output_second_line)
476476

477477
subject
478478
end

Diff for: vmfloaty.gemspec

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
2424
s.test_files = Dir['spec/**/*']
2525
s.require_path = 'lib'
2626

27-
s.add_dependency 'colorize', '~> 0.8.1'
2827
s.add_dependency 'commander', '>= 4.4.3', '< 4.7.0'
2928
s.add_dependency 'faraday', '~> 1.5', '>= 1.5.1'
3029
end

0 commit comments

Comments
 (0)