lib/github_cli/vendor/thor/shell/html.rb in github_cli-0.5.3 vs lib/github_cli/vendor/thor/shell/html.rb in github_cli-0.5.4

- old
+ new

@@ -71,10 +71,14 @@ raise NotImplementedError, "Implement #ask for Thor::Shell::HTML" end protected + def can_display_colors? + true + end + # Overwrite show_diff to show diff with colors if Diff::LCS is # available. # def show_diff(destination, content) #:nodoc: if diff_lcs_loaded? && ENV['THOR_DIFF'].nil? && ENV['RAILS_DIFF'].nil? @@ -89,18 +93,18 @@ end end def output_diff_line(diff) #:nodoc: case diff.action - when '-' - say "- #{diff.old_element.chomp}", :red, true - when '+' - say "+ #{diff.new_element.chomp}", :green, true - when '!' - say "- #{diff.old_element.chomp}", :red, true - say "+ #{diff.new_element.chomp}", :green, true - else - say " #{diff.old_element.chomp}", nil, true + when '-' + say "- #{diff.old_element.chomp}", :red, true + when '+' + say "+ #{diff.new_element.chomp}", :green, true + when '!' + say "- #{diff.old_element.chomp}", :red, true + say "+ #{diff.new_element.chomp}", :green, true + else + say " #{diff.old_element.chomp}", nil, true end end # Check if Diff::LCS is loaded. If it is, use it to create pretty output # for diff.