Class: PDFVersionMismatchWarning

Inherits:
TexWarning show all
Defined in:
lib/trex.rb

Instance Attribute Summary

Attributes inherited from TexWarning

#filestate, #limit

Instance Method Summary collapse

Methods inherited from TexWarning

#add_error, #empty?, #expand_input, #format_error, #handle, #has_error?, #render_line, #size, #sort, #to_s

Constructor Details

#initialize(limits = 10) ⇒ PDFVersionMismatchWarning

Returns a new instance of PDFVersionMismatchWarning.



749
750
751
# File 'lib/trex.rb', line 749

def initialize(limits=10)
    super('PDF Version mismatches', /PDF version/, /found PDF .*/, limits)
end

Instance Method Details

#extract_line(string, index, lines) ⇒ Object



758
759
760
# File 'lib/trex.rb', line 758

def extract_line(string, index, lines)
    /file (.*?)\):/.match(string)[1]
end

#format_warning_message(line, string) ⇒ Object



753
754
755
756
# File 'lib/trex.rb', line 753

def format_warning_message(line, string)
    result = string.match(/found PDF version <(.*?)>.*?<(.*?)>/)
    "found #{result[1]} instead of #{result[2]}"
end