class Yapt::GitLogShiv

Attributes

author[R]
message[R]
sha[R]
tracker_ids[R]

Public Class Methods

find(since_until) click to toggle source
# File lib/yapt.rb, line 45
def self.find(since_until)
  result = `git log #{since_until}`
  commits = result.split(/^commit/).reverse.collect {|c| "commit#{c}" }
  commits.pop if commits.last == 'commit'
  commits.collect {|c| new(c) }
end
new(message) click to toggle source
# File lib/yapt.rb, line 53
def initialize(message)
  lines = message.split("\n")
  @sha = lines.first[/\w+$/].strip
  author_line = lines[1]
  @author = author_line[/:[^<]+/].sub(/\A:/,'').strip
  just_message = lines[3..-1].join("\n")
  tracker_directives = just_message.scan(/\[.*\d+\]/)
  @tracker_ids = []
  tracker_directives.each do |directive|
    @tracker_ids << directive[/\d+/]
    just_message.gsub!(directive,'')
  end
  @message = just_message.strip
end

Public Instance Methods

stories() click to toggle source
# File lib/yapt.rb, line 72
def stories
  @stories ||= tracker_ids.collect {|t| Story.find(t) }
end