From 991b1b694b6b9851a45c73ebebc92ff81fb257f7 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Sat, 11 Feb 2023 07:00:36 +0900 Subject: [PATCH] Add SuperDiff::Configuration#color_enabled= (#138) Currently, you need to use merge!(), which doesn't look pretty. --- README.md | 8 ++++++++ lib/super_diff/configuration.rb | 1 + 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 20afbb83..10cf5293 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,14 @@ end See [eight_bit_color.rb](lib/super_diff/csi/eight_bit_color.rb) for the list of available colors. +You can also completely disable colorized output. + +``` ruby +SuperDiff.configure do |config| + config.color_enabled = false +end +``` + ### Disabling the key You can disable the key by changing the following config (default: true): diff --git a/lib/super_diff/configuration.rb b/lib/super_diff/configuration.rb index 3c3e6bb4..e460dd23 100644 --- a/lib/super_diff/configuration.rb +++ b/lib/super_diff/configuration.rb @@ -10,6 +10,7 @@ class Configuration attr_accessor( :actual_color, :border_color, + :color_enabled, :diff_elision_enabled, :diff_elision_maximum, :elision_marker_color,