module DocDiff::ContextDiff
Public Instance Methods
add()
click to toggle source
# File lib/viewdiff.rb, line 164 def add "(?:^\\+ #{noneol}*?#{eol})" end
any()
click to toggle source
# File lib/viewdiff.rb, line 173 def any "(?:#{del}+|#{add}+|#{change}+|#{misc}+)" end
change()
click to toggle source
# File lib/viewdiff.rb, line 167 def change "(?:^! #{noneol}*?#{eol})" end
del()
click to toggle source
# File lib/viewdiff.rb, line 161 def del "(?:^- #{noneol}*?#{eol})" end
elements()
click to toggle source
# File lib/viewdiff.rb, line 179 def elements "(?:#{file_header}|#{hunk_header}#{hunk_subheader_former}#{any}*?#{hunk_subheader_latter}#{any}+|#{misc}|#{noneol}+#{eol})" end
eol()
click to toggle source
# File lib/viewdiff.rb, line 146 def eol "(?:\r\n|\n|\r|\\z)" end
file_header()
click to toggle source
# File lib/viewdiff.rb, line 176 def file_header "(?:[-\\*]{3} #{noneol}+?#{eol})" end
hunk_header()
click to toggle source
# File lib/viewdiff.rb, line 152 def hunk_header "(?:\\*+#{eol})" end
hunk_subheader_former()
click to toggle source
# File lib/viewdiff.rb, line 155 def hunk_subheader_former "(?:^\\*+ [0-9]+,[0-9]+ \\*+#{eol})" end
hunk_subheader_latter()
click to toggle source
# File lib/viewdiff.rb, line 158 def hunk_subheader_latter "(?:^-+ [0-9]+,[0-9]+ -+#{eol})" end
misc()
click to toggle source
# File lib/viewdiff.rb, line 170 def misc "(?:^[^-+!*]+?#{eol}+?)" end
noneol()
click to toggle source
# File lib/viewdiff.rb, line 149 def noneol "(?:[^\r\n])" end