object that holds the last X commits on given branch
# File lib/git/diff.rb, line 7 def initialize(base, from = nil, to = nil) @base = base @from = from.to_s @to = to.to_s @path = nil @full_diff = nil @full_diff_files = nil @stats = nil end
enumerable methods
# File lib/git/diff.rb, line 58 def [](key) process_full @full_diff_files.assoc(key)[1] end
# File lib/git/diff.rb, line 34 def deletions cache_stats @stats[:total][:deletions] end
# File lib/git/diff.rb, line 63 def each(&block) # :yields: each Git::DiffFile in turn process_full @full_diff_files.map { |file| file[1] }.each(&block) end
# File lib/git/diff.rb, line 39 def insertions cache_stats @stats[:total][:insertions] end
# File lib/git/diff.rb, line 29 def lines cache_stats @stats[:total][:lines] end
if file is provided and is writable, it will write the patch into the file
# File lib/git/diff.rb, line 50 def patch(file = nil) cache_full @full_diff end
# File lib/git/diff.rb, line 19 def path(path) @path = path return self end
# File lib/git/diff.rb, line 24 def size cache_stats @stats[:total][:files] end
# File lib/git/diff.rb, line 44 def stats cache_stats @stats end