diff --git a/Gemfile.lock b/Gemfile.lock index 443d8f9..dd9f1c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,6 @@ PATH remote: . specs: puma-status (1.6) - colorize (~> 1.1) net_http_unix (~> 0.2) parallel (~> 1) @@ -10,7 +9,6 @@ GEM remote: https://rubygems.org/ specs: climate_control (0.2.0) - colorize (1.1.0) diff-lcs (1.5.0) net_http_unix (0.2.2) parallel (1.24.0) diff --git a/lib/helpers.rb b/lib/helpers.rb index ba14441..8f345ec 100644 --- a/lib/helpers.rb +++ b/lib/helpers.rb @@ -1,5 +1,3 @@ -require 'colorize' - def debug(str) puts str if ENV.key?('DEBUG') end @@ -14,7 +12,16 @@ def red(str) def colorize(str, color_name) return str if ENV.key?('NO_COLOR') - str.to_s.colorize(color_name) + case color_name + when :red + "\e[0;31;49m#{str}\e[0m" + when :yellow + "\e[0;33;49m#{str}\e[0m" + when :green + "\e[0;32;49m#{str}\e[0m" + else + str + end end def color(critical, warn, value, str = nil) diff --git a/puma-status.gemspec b/puma-status.gemspec index 875d330..8db3e5e 100644 --- a/puma-status.gemspec +++ b/puma-status.gemspec @@ -12,7 +12,6 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.executables = ['puma-status'] - s.add_runtime_dependency "colorize", '~> 1.1' s.add_runtime_dependency "net_http_unix", '~> 0.2' s.add_runtime_dependency "parallel", '~> 1'