class Git::Diff::DiffFile
Constants
- NIL_BLOB_REGEXP
Attributes
dst[RW]
mode[RW]
patch[RW]
path[RW]
src[RW]
type[RW]
Public Class Methods
new(base, hash)
click to toggle source
# File lib/git/diff.rb, line 77 def initialize(base, hash) @base = base @patch = hash[:patch] @path = hash[:path] @mode = hash[:mode] @src = hash[:src] @dst = hash[:dst] @type = hash[:type] @binary = hash[:binary] end
Public Instance Methods
binary?()
click to toggle source
# File lib/git/diff.rb, line 88 def binary? !!@binary end
blob(type = :dst)
click to toggle source
# File lib/git/diff.rb, line 92 def blob(type = :dst) if type == :src && !NIL_BLOB_REGEXP.match(@src) @base.object(@src) elsif !NIL_BLOB_REGEXP.match(@dst) @base.object(@dst) end end