class Milestoner::Commits::Collector
Collects commits since last tag, a specific range, or all commits if untagged.
Constants
- MAX
- MIN
Public Instance Methods
Source
# File lib/milestoner/commits/collector.rb, line 28 def all = git.commits end
Source
# File lib/milestoner/commits/collector.rb, line 15 def call(min: MIN, max: MAX) = git.tagged? ? slice(min, max) : all private def slice min, max case [min, max] in MIN, MAX then git.tag_last.bind { |tag| git.commits "#{tag}..#{max}" } in String, String then git.commits "#{min}..#{max}" in nil, String then git.commits max else Failure "Invalid minimum and/or maximum range: #{min}..#{max}." end end def all = git.commits end end
Source
# File lib/milestoner/commits/collector.rb, line 19 def slice min, max case [min, max] in MIN, MAX then git.tag_last.bind { |tag| git.commits "#{tag}..#{max}" } in String, String then git.commits "#{min}..#{max}" in nil, String then git.commits max else Failure "Invalid minimum and/or maximum range: #{min}..#{max}." end end