Class: PTLog::Wrappers::Release
- Inherits:
-
Object
- Object
- PTLog::Wrappers::Release
- Defined in:
- lib/ptlog/wrappers/release.rb
Instance Method Summary collapse
- #commits(num) ⇒ Object
- #date ⇒ Object
- #get_binding ⇒ Object
-
#initialize(tag, changelog) ⇒ Release
constructor
A new instance of Release.
- #stories ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(tag, changelog) ⇒ Release
Returns a new instance of Release.
3 4 5 6 7 8 |
# File 'lib/ptlog/wrappers/release.rb', line 3 def initialize(tag, changelog) @tag = tag @initial_commit = changelog..prev_to(tag) @git = changelog.git @commit = @git.gcommit(tag) end |
Instance Method Details
#commits(num) ⇒ Object
25 26 27 28 29 |
# File 'lib/ptlog/wrappers/release.rb', line 25 def commits(num) @git.log.between(@initial_commit, @tag).select do |commit| commit. =~ (/\##{num}/) end end |
#date ⇒ Object
14 15 16 |
# File 'lib/ptlog/wrappers/release.rb', line 14 def date @commit.date.utc.strftime('%I:%M%P %D UTC') end |
#get_binding ⇒ Object
31 32 33 |
# File 'lib/ptlog/wrappers/release.rb', line 31 def get_binding binding end |
#stories ⇒ Object
18 19 20 21 22 23 |
# File 'lib/ptlog/wrappers/release.rb', line 18 def stories ids = @git.log.between(@initial_commit, @tag).map do |commit| commit..scan(/\#(\d+)/) end ids.flatten.uniq.map{ |num| PTLog::Pivotal::Story.get(num) } end |
#title ⇒ Object
10 11 12 |
# File 'lib/ptlog/wrappers/release.rb', line 10 def title @tag end |