Class: Inch::CLI::Command::Output::Base Abstract
- Inherits:
-
Object
- Object
- Inch::CLI::Command::Output::Base
- Includes:
- TraceHelper
- Defined in:
- lib/inch/cli/command/output/base.rb
Overview
This class is abstract.
Abstract base class for CLI output
Instance Method Summary collapse
- #display_name(object) ⇒ Object
- #print_file_info(o, color) ⇒ Object
- #priority_arrow(priority, color = :white) ⇒ Object
-
#ui ⇒ Object
this is used to use Inch::Utils::BufferedIO.
Instance Method Details
#display_name(object) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/inch/cli/command/output/base.rb', line 21 def display_name(object) if object.language == :javascript object.fullname+" in #{object.filename.relative_path}".color(:dark) else object.fullname end end |
#print_file_info(o, color) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/inch/cli/command/output/base.rb', line 35 def print_file_info(o, color) o.files.each do |f| echo "-> #{f.filename}:#{f.line_no}".color(color) end echo separator end |
#priority_arrow(priority, color = :white) ⇒ Object
29 30 31 32 33 |
# File 'lib/inch/cli/command/output/base.rb', line 29 def priority_arrow(priority, color = :white) Evaluation::PriorityRange.all.each do |range| return range.arrow.color(color).dark if range.include?(priority) end end |
#ui ⇒ Object
this is used to use Inch::Utils::BufferedIO
43 44 45 |
# File 'lib/inch/cli/command/output/base.rb', line 43 def ui @options.ui end |