Class: PTLog::Wrappers::ChangeLog

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeChangeLog

Returns a new instance of ChangeLog.



5
6
7
8
9
# File 'lib/ptlog/wrappers/changelog.rb', line 5

def initialize
  @git ||= ::Git.open(Dir.getwd)
  @start = ENV['PTLOG_SINCE'] || git.lib.ordered_tags.first
  @tags = PTLog::TagList.new(@git, @start)
end

Instance Attribute Details

#gitObject (readonly)

Returns the value of attribute git.



3
4
5
# File 'lib/ptlog/wrappers/changelog.rb', line 3

def git
  @git
end

#tagsObject (readonly)

Returns the value of attribute tags.



3
4
5
# File 'lib/ptlog/wrappers/changelog.rb', line 3

def tags
  @tags
end

Instance Method Details

#dateObject



11
12
13
# File 'lib/ptlog/wrappers/changelog.rb', line 11

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

#releasesObject



15
16
17
18
19
# File 'lib/ptlog/wrappers/changelog.rb', line 15

def releases
  @tags.map do |tag|
    PTLog::Wrappers::Release.new(tag, self)
  end
end