Class: Yapt::GitLogShiv
- Inherits:
-
Object
- Object
- Yapt::GitLogShiv
- Defined in:
- lib/yapt.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#tracker_ids ⇒ Object
readonly
Returns the value of attribute tracker_ids.
Class Method Summary collapse
Instance Method Summary collapse
- #github_link ⇒ Object
-
#initialize(message) ⇒ GitLogShiv
constructor
A new instance of GitLogShiv.
- #stories ⇒ Object
Constructor Details
#initialize(message) ⇒ GitLogShiv
Returns a new instance of GitLogShiv.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/yapt.rb', line 53 def initialize() lines = .split("\n") @sha = lines.first[/\w+$/].strip = lines[1] @author = [/:[^<]+/].sub(/\A:/,'').strip = lines[3..-1].join("\n") tracker_directives = .scan(/\[.*\d+\]/) @tracker_ids = [] tracker_directives.each do |directive| @tracker_ids << directive[/\d+/] .gsub!(directive,'') end @message = .strip end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
52 53 54 |
# File 'lib/yapt.rb', line 52 def @author end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
52 53 54 |
# File 'lib/yapt.rb', line 52 def @message end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
52 53 54 |
# File 'lib/yapt.rb', line 52 def sha @sha end |
#tracker_ids ⇒ Object (readonly)
Returns the value of attribute tracker_ids.
52 53 54 |
# File 'lib/yapt.rb', line 52 def tracker_ids @tracker_ids end |
Class Method Details
.find(since_until) ⇒ Object
45 46 47 48 49 50 |
# 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 |
Instance Method Details
#github_link ⇒ Object
68 69 70 |
# File 'lib/yapt.rb', line 68 def github_link "#{Yapt.github_url_base}/commit/#{sha}" end |