From 1b646f82c67e7c38df08113bcc3323c7aaf4639f Mon Sep 17 00:00:00 2001 From: Tom Black Date: Tue, 16 Oct 2018 23:24:18 -0700 Subject: Move `String#colorize` to a separate file to require --- ext/ruby2d/extconf.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'ext') diff --git a/ext/ruby2d/extconf.rb b/ext/ruby2d/extconf.rb index d3ddac0..3cd2302 100644 --- a/ext/ruby2d/extconf.rb +++ b/ext/ruby2d/extconf.rb @@ -1,17 +1,12 @@ require 'mkmf' +require_relative '../../lib/ruby2d/colorize' S2D_VERSION = '1.0.1' # Simple 2D minimum version required $errors = [] -class String - def colorize(c); "\e[#{c}m#{self}\e[0m" end - def bold; colorize('1') end - def red; colorize('1;31') end -end - def print_errors puts " -#{"== #{"Ruby 2D Installation Errors".red} =======================================\n"} +#{"== #{"Ruby 2D Installation Errors".error} =======================================\n"} #{$errors.join("\n ")}\n #{"======================================================================="}" end -- cgit v1.2.3