class Git::Timesheet::Entry

Attributes

message[R]
repository[R]
timestamp[R]

Public Class Methods

load(git_root, since: nil, author: nil) click to toggle source
# File lib/git/timesheet/entry.rb, line 38
def self.load(git_root, since: nil, author: nil)
        log_lines = []
        
        Dir.chdir(git_root) do
                log_lines = `git log --no-merges --simplify-merges --author="#{author.gsub('"','\\"')}" --format="%ad %s <%h>" --date=iso --since="#{since.gsub('"','\\"')}"`.split("\n")
        end
        
        log_lines.collect do |line|
                timestamp = Time.parse line.slice!(0,25)
                message = line
                
                Entry.new(timestamp, message, git_root)
        end
end
new(timestamp, message, repository) click to toggle source
# File lib/git/timesheet/entry.rb, line 24
def initialize(timestamp, message, repository)
        @timestamp = timestamp
        @message = message
        @repository = repository
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/git/timesheet/entry.rb, line 34
def <=> other
        self.timestamp <=> other.timestamp
end