Method: Fast.report
- Defined in:
- lib/fast/cli.rb
.report(result, show_link: false, show_permalink: false, show_sexp: false, file: nil, headless: false, bodyless: false, colorize: true) ⇒ Object
Combines highlight with files printing file name in the head with the source line.
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/fast/cli.rb', line 68 def report(result, show_link: false, show_permalink: false, show_sexp: false, file: nil, headless: false, bodyless: false, colorize: true) # rubocop:disable Metrics/ParameterLists if file line = result.loc.expression.line if result.is_a?(Parser::AST::Node) if show_link puts(result.link) elsif show_permalink puts(result.permalink) elsif !headless puts(highlight("# #{file}:#{line}", colorize: colorize)) end end puts(highlight(result, show_sexp: show_sexp, colorize: colorize)) unless bodyless end |