Class: Inch::CLI::Command::Output::Base Abstract

Inherits:
Object
  • Object
show all
Includes:
TraceHelper
Defined in:
lib/inch/cli/command/output/base.rb

Overview

This class is abstract.

Abstract base class for CLI output

Direct Known Subclasses

Console, Diff, Inspect, List, Show, Stats, Suggest

Instance Method Summary collapse

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


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

#uiObject

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