Class: Glark::Lines

Inherits:
Lines show all
Includes:
Format
Defined in:
lib/glark/output/glark_lines.rb

Direct Known Subclasses

UnfilteredLines

Constant Summary

Constants included from Highlight

Highlight::RESET

Instance Attribute Summary

Attributes inherited from Formatted

#formatted

Attributes inherited from Results

#count

Instance Method Summary collapse

Methods included from Format

#print_line, #print_line_number, #println, #show_file_header

Methods included from Highlight

#adorn

Methods inherited from Lines

#at_match_limit?, #display_matches?, #displayed_name, #print_line, #print_line_number, #process_end, #process_match, #set_status, #write_matches

Methods inherited from Common

#at_match_limit?, #display_matches?, #displayed_name, #process_match

Methods inherited from Formatted

#get_line_to_print

Methods inherited from Results

#matched?

Constructor Details

#initialize(file, spec) ⇒ Lines

Returns a new instance of Lines.



16
17
18
19
# File 'lib/glark/output/glark_lines.rb', line 16

def initialize file, spec
  super
  @print_context = @after != 0 || @before != 0
end

Instance Method Details

#add_match(startline, endline) ⇒ Object



31
32
33
34
# File 'lib/glark/output/glark_lines.rb', line 31

def add_match startline, endline
  super
  set_status startline, endline
end

#write_matching(from, to) ⇒ Object



21
22
23
24
# File 'lib/glark/output/glark_lines.rb', line 21

def write_matching from, to
  show_file_header
  super
end

#write_nonmatching(from, to) ⇒ Object



26
27
28
29
# File 'lib/glark/output/glark_lines.rb', line 26

def write_nonmatching from, to
  show_file_header
  super
end