class Yapt::GitLogShiv
Attributes
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
github_link()
click to toggle source
# File lib/yapt.rb, line 68 def github_link "#{Yapt.github_url_base}/commit/#{sha}" end
stories()
click to toggle source
# File lib/yapt.rb, line 72 def stories @stories ||= tracker_ids.collect {|t| Story.find(t) } end