Class: Apadmi::Grout::CheckUnfinishedReleasesAction
- Inherits:
-
Object
- Object
- Apadmi::Grout::CheckUnfinishedReleasesAction
- Defined in:
- lib/apadmi/grout/actions/check_unfinished_releases_action.rb
Overview
Checks that all releases before this one are ancestors in the commit history to ensure that any unmerged fixes don't get missed
Instance Method Summary collapse
-
#initialize(git_utils, logger) ⇒ CheckUnfinishedReleasesAction
constructor
A new instance of CheckUnfinishedReleasesAction.
-
#run(current_version, suppress_error_versions) ⇒ Object
Runs the action.
Constructor Details
#initialize(git_utils, logger) ⇒ CheckUnfinishedReleasesAction
Returns a new instance of CheckUnfinishedReleasesAction.
12 13 14 15 |
# File 'lib/apadmi/grout/actions/check_unfinished_releases_action.rb', line 12 def initialize(git_utils, logger) @git_utils = git_utils @logger = logger end |
Instance Method Details
#run(current_version, suppress_error_versions) ⇒ Object
Runs the action.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/apadmi/grout/actions/check_unfinished_releases_action.rb', line 20 def run(current_version, suppress_error_versions) @git_utils.fetch_all @logger.("Checking for unmerged versions") @logger.("Suppressing checks for versions: #{suppress_error_versions}") if suppress_error_versions this_version = Semantic::Version.new current_version versions = extract_non_ancestor_versions suppressed = suppress_error_versions.map do |version| Semantic::Version.new version end # Only older versions should cause errors since features in newer # versions have legitimate reasons not to be in this release versions.select do |version| version < this_version && !suppressed.include?(version) end end |