Class: WhatTheGem::Changes::ReleasesParser
- Extended by:
- I::Callable
- Defined in:
- lib/whatthegem/changes/releases_parser.rb
Instance Attribute Summary collapse
-
#releases ⇒ Object
readonly
Returns the value of attribute releases.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(releases) ⇒ ReleasesParser
constructor
A new instance of ReleasesParser.
- #versions ⇒ Object
Methods included from I::Callable
Constructor Details
#initialize(releases) ⇒ ReleasesParser
12 13 14 |
# File 'lib/whatthegem/changes/releases_parser.rb', line 12 def initialize(releases) @releases = releases end |
Instance Attribute Details
#releases ⇒ Object (readonly)
Returns the value of attribute releases.
10 11 12 |
# File 'lib/whatthegem/changes/releases_parser.rb', line 10 def releases @releases end |
Class Method Details
.call(releases) ⇒ Object
6 7 8 |
# File 'lib/whatthegem/changes/releases_parser.rb', line 6 def self.call(releases) new(releases).versions end |
Instance Method Details
#versions ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/whatthegem/changes/releases_parser.rb', line 16 def versions releases.map { |tag_name:, name:, body:, **| Version.new( number: tag_name[VERSION_LINE_REGEXP, :version], header: name.then.reject(&:empty?).first || tag_name, body: body ) }.sort_by(&:number) end |