class Git::Log

Attributes

commits[R]
commits[R]

Public Class Methods

new(commits = []) click to toggle source
# File lib/Git/Log.rb, line 101
def initialize(commits = [])
  @commits = commits
end
parse(log_stream) click to toggle source
# File lib/Git/Log.rb, line 82
def parse(log_stream)
  commit_log = Log.new
  commit_string = ''
  log_stream.each_line do |line|
    if line =~ /^commit/ && !commit_string.empty?
      commit_log.prepend(Commit.parse(commit_string))
      commit_string = line
    else
      commit_string << line
    end
  end
  commit_log.prepend(Commit.parse(commit_string))
  commit_log
end

Public Instance Methods

method_missing(method_name, *args, &block) click to toggle source
# File lib/Git/Log.rb, line 110
def method_missing(method_name, *args, &block)
  commits.send(method_name, *args, &block)
end
prepend(commit_object) click to toggle source
# File lib/Git/Log.rb, line 105
def prepend(commit_object)
  commits.unshift(commit_object)
end
Also aliased as: unshift
unshift(commit_object)
Alias for: prepend