Class: PTLog::Wrappers::Release

Inherits:
Object
  • Object
show all
Defined in:
lib/ptlog/wrappers/release.rb

Instance Method Summary collapse

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.tags.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.message =~ (/\##{num}/)
  end
end

#dateObject



14
15
16
# File 'lib/ptlog/wrappers/release.rb', line 14

def date
  @commit.date.utc.strftime('%I:%M%P %D UTC')
end

#get_bindingObject



31
32
33
# File 'lib/ptlog/wrappers/release.rb', line 31

def get_binding
  binding
end

#storiesObject



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.message.scan(/\#(\d+)/)
  end
  ids.flatten.uniq.map{ |num| PTLog::Pivotal::Story.get(num) }
end

#titleObject



10
11
12
# File 'lib/ptlog/wrappers/release.rb', line 10

def title
  @tag
end