Class: Fastlane::Wpmreleasetoolkit::Versioning::DateVersionCalculator
- Inherits:
-
AbstractVersionCalculator
- Object
- AbstractVersionCalculator
- Fastlane::Wpmreleasetoolkit::Versioning::DateVersionCalculator
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_version_calculator.rb
Overview
The ‘DateVersionCalculator` class is a specialized version calculator for date-based versions of an app, extending the `AbstractVersionCalculator` class.
Instance Method Summary collapse
-
#next_release_version(version:, increment_to_next_year: false) ⇒ AppVersion
Calculate the next date-based release version.
Methods inherited from AbstractVersionCalculator
#next_build_number, #next_major_version, #next_minor_version, #next_patch_version, #previous_patch_version, #release_is_hotfix?
Instance Method Details
#next_release_version(version:, increment_to_next_year: false) ⇒ AppVersion
Calculate the next date-based release version.
When increment_to_next_year is true, increments the major version (representing the year) and resets all other components (minor to 1, patch and build number to 0). Otherwise, calculates the next minor version using the parent class implementation.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/versioning/calculators/date_version_calculator.rb', line 20 def next_release_version(version:, increment_to_next_year: false) if increment_to_next_year new_version = version.dup new_version.major += 1 new_version.minor = 1 new_version.patch = 0 new_version.build_number = 0 new_version else next_minor_version(version: version) end end |