Class: VersionCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_releases/version_calculator.rb

Constant Summary collapse

MAJOR_RELEASE_MONTH =

represents the month major releases are performed, in this case May

5

Instance Method Summary collapse

Constructor Details

#initialize(version:, candidate_date:) ⇒ VersionCalculator

Returns a new instance of VersionCalculator.



6
7
8
9
# File 'lib/gitlab_releases/version_calculator.rb', line 6

def initialize(version:, candidate_date:)
  @version = version
  @candidate_date = candidate_date
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
# File 'lib/gitlab_releases/version_calculator.rb', line 11

def execute
  if candidate_date.month == (MAJOR_RELEASE_MONTH - 1)
    next_major
  else
    next_minor
  end
end