lib/rugged/diff/line.rb in rugged-0.19.0 vs lib/rugged/diff/line.rb in rugged-0.21.0

- old
+ new

@@ -1,9 +1,9 @@ module Rugged class Diff class Line - attr_reader :line_origin, :content, :owner, :old_lineno, :new_lineno + attr_reader :line_origin, :content, :owner, :old_lineno, :new_lineno, :content_offset alias hunk owner def context? @line_origin == :context @@ -15,11 +15,31 @@ def deletion? @line_origin == :deletion end - def eof_newline? - @line_origin == :eof_newline + def eof_no_newline? + @line_origin == :eof_no_newline + end + + def eof_newline_added? + @line_origin == :eof_newline_added + end + + def eof_newline_removed? + @line_origin == :eof_newline_removed + end + + def file_header? + @line_origin == :file_header + end + + def hunk_header? + @line_origin == :hunk_header + end + + def binary? + @line_origin == :binary end def inspect "#<#{self.class.name}:#{object_id} {line_origin: #{line_origin.inspect}, content: #{content.inspect}>" end