lib/inch/utils/ui.rb in inch-0.5.0.rc5 vs lib/inch/utils/ui.rb in inch-0.5.0.rc6
- old
+ new
@@ -8,39 +8,39 @@
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 = "")
+ def sub(msg = '')
color = @current_header_color || :white
trace __edged(color, msg)
end
- def edged(color, msg, edge = "┃ ")
+ def edged(color, msg, edge = '┃ ')
trace __edged(color, msg, edge)
end
# Writes the given +text+ to out
#
# @param text [String]
# @return [void]
- def trace(text = "")
+ def trace(text = '')
@current_header_color = nil if text.to_s.empty?
out.puts text
end
# Writes the given +text+ to err
#
# @param text [String]
# @return [void]
- def warn(text = "")
+ def warn(text = '')
err.puts text
end
def header(text, color, bg_color = nil)
@current_header_color = color
@@ -53,18 +53,18 @@
Term::ANSIColor.coloring?
end
private
- def __edged(color, msg, edge = "┃ ")
+ 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)
.on_color(bg_color).color(:color16)
- "#".color(color).on_color(color) + bar
+ '#'.color(color).on_color(color) + bar
end
end
end
end