lib/inch/utils/ui.rb in inch-0.4.10 vs lib/inch/utils/ui.rb in inch-0.5.0.rc1

- old
+ new

@@ -8,13 +8,13 @@ def initialize(stdout = $stdout, stderr = $stderr) @out, @err = stdout, stderr end def debug(msg) - return unless ENV["DEBUG"] + return unless ENV['DEBUG'] msg.to_s.lines.each do |line| - trace edged :dark, line.gsub(/\n$/, "").dark + trace edged :dark, line.gsub(/\n$/,'').dark end end def sub(msg = "") color = @current_header_color || :white @@ -43,26 +43,26 @@ end def header(text, color, bg_color = nil) @current_header_color = color trace __header(text, color, bg_color) - trace unless use_color? + trace if !use_color? end # @return [Boolean] true if the UI uses coloring def use_color? - Term::ANSIColor.coloring? + Term::ANSIColor::coloring? end private def __edged(color, msg, edge = "┃ ") edge.color(color) + msg end def __header(text, color, bg_color = nil) bg_color ||= "intense_#{color}" - bar = " #{text}".ljust(CLI::COLUMNS - 1) + bar = " #{text}".ljust(CLI::COLUMNS-1) .on_color(bg_color).color(:color16) "#".color(color).on_color(color) + bar end end end