From f48b4a5be246af7ff68e89544d4c818f9eea2467 Mon Sep 17 00:00:00 2001 From: Bradley Grzesiak Date: Mon, 30 Nov 2015 15:23:41 -0600 Subject: [PATCH 1/3] Replace colorize gem with console-colors. The colorize gem is licensed under GPL v2. While I sympathize with the goal of the copyleft licenses, including library code that's licensed under GPL can cause legal headaches. The console-colors gem seems to do the exact same thing. If replacing a GPL dependency with an MIT one isn't preferred, perhaps: 1. Remove the 2 calls to `.green` and 2 calls to `.red`, or 2. Use another gem's capability like [bundler][bundler] 3. Implement the red and green in this codebase [bundler]: https://github.com/bundler/bundler/blob/20f04aa8923c0d0f02e7a74d5e9609d772351668/lib/bundler/vendor/thor/lib/thor/shell/color.rb --- deface.gemspec | 2 +- lib/deface.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deface.gemspec b/deface.gemspec index 45107ea..5f5d4d0 100644 --- a/deface.gemspec +++ b/deface.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.add_dependency('nokogiri', '~> 1.6.0') s.add_dependency('rails', '>= 4.1') - s.add_dependency('colorize', '>= 0.5.8') + s.add_dependency('console-colors', '>= 0.0.2') s.add_dependency('polyglot') s.add_development_dependency('appraisal') diff --git a/lib/deface.rb b/lib/deface.rb index 1745e30..f87cc24 100644 --- a/lib/deface.rb +++ b/lib/deface.rb @@ -36,7 +36,7 @@ require "deface/matchers/range" require "deface/environment" require "deface/precompiler" -require "colorize" +require "console-colors" module Deface if defined?(Rails) From 9919d7613b9c0e6945aa3f981ce964899b1b63b3 Mon Sep 17 00:00:00 2001 From: Bradley Grzesiak Date: Mon, 30 Nov 2015 16:33:10 -0600 Subject: [PATCH 2/3] Remove colorize in tasks --- tasks/utils.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/utils.rake b/tasks/utils.rake index 2e2b950..b96a085 100644 --- a/tasks/utils.rake +++ b/tasks/utils.rake @@ -1,6 +1,6 @@ require 'deface' require 'deface/utils/failure_finder' -require 'colorize' +require 'console-colors' namespace :deface do include Deface::TemplateHelper From 823d3c10387b8d588e27def3b9c43c2d7c6ae7dc Mon Sep 17 00:00:00 2001 From: Brad Grzesiak Date: Thu, 15 Sep 2016 14:10:34 -0500 Subject: [PATCH 3/3] Replace colorize (GPLv2) with rainbow (MIT) --- deface.gemspec | 2 +- lib/deface.rb | 1 - lib/deface/utils/failure_finder.rb | 6 ++++-- tasks/utils.rake | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deface.gemspec b/deface.gemspec index 5f5d4d0..ba6cb87 100644 --- a/deface.gemspec +++ b/deface.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.add_dependency('nokogiri', '~> 1.6.0') s.add_dependency('rails', '>= 4.1') - s.add_dependency('console-colors', '>= 0.0.2') + s.add_dependency('rainbow', '>= 2.1.0') s.add_dependency('polyglot') s.add_development_dependency('appraisal') diff --git a/lib/deface.rb b/lib/deface.rb index f87cc24..b952169 100644 --- a/lib/deface.rb +++ b/lib/deface.rb @@ -36,7 +36,6 @@ require "deface/matchers/range" require "deface/environment" require "deface/precompiler" -require "console-colors" module Deface if defined?(Rails) diff --git a/lib/deface/utils/failure_finder.rb b/lib/deface/utils/failure_finder.rb index 761babd..96cadf9 100644 --- a/lib/deface/utils/failure_finder.rb +++ b/lib/deface/utils/failure_finder.rb @@ -1,3 +1,5 @@ +require 'rainbow' + module Deface module Utils module FailureFinder @@ -28,9 +30,9 @@ def output_results_by_virtual_path(virtual_path) fails.each do |override| if override.failure.nil? - puts " '#{override.name}' reported no failures".green + puts Rainbow(" '#{override.name}' reported no failures").green else - puts " '#{override.name}' #{override.failure}".red + puts Rainbow(" '#{override.name}' #{override.failure}").red end end diff --git a/tasks/utils.rake b/tasks/utils.rake index b96a085..f669a60 100644 --- a/tasks/utils.rake +++ b/tasks/utils.rake @@ -1,6 +1,6 @@ require 'deface' require 'deface/utils/failure_finder' -require 'console-colors' +require 'rainbow' namespace :deface do include Deface::TemplateHelper @@ -68,10 +68,10 @@ namespace :deface do end if fail_count == 0 - puts "\nEverything's looking good!".green + puts Rainbow("\nEverything's looking good!").green exit(0) else - puts "\nYou had a total of #{fail_count} failures.".red + puts Rainbow("\nYou had a total of #{fail_count} failures.").red exit(1) end end