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 --- bin/ruby2d | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/ruby2d b/bin/ruby2d index 9fe9714..9a819d9 100755 --- a/bin/ruby2d +++ b/bin/ruby2d @@ -1,15 +1,8 @@ #!/usr/bin/env ruby +require 'ruby2d/colorize' require 'ruby2d/version' require 'fileutils' -# Extending `String` to include some fancy colors -class String - def colorize(c); "\e[#{c}m#{self}\e[0m" end - def bold; colorize('1') end - def warn; colorize('1;33') end - def error; colorize('1;31') end -end - # The installed gem directory @gem_dir = "#{Gem::Specification.find_by_name('ruby2d').gem_dir}" -- cgit v1.2.3