app/models/release.rb
# If Github already has a version tagged for this commit, use it unless it is smaller.
# If the commit is after a known tag, bump it once.
# Othervise bump latest release number.
If Github already has a version tagged for this commit, use it unless it is smaller.
If the commit is after a known tag, bump it once.
Othervise bump latest release number.
If Github already has a version tagged for this commit use it unless it is smaller . If the commit is after a known tag bump it once . Othervise bump latest release number .
def next_release_number
    latest_samson_number = project.releases.last&.number || "0"
    next_samson_number = next_number(latest_samson_number)
    return next_samson_number if commit.blank?
    return next_samson_number unless fuzzy_tag = project.repository.fuzzy_tag_from_ref(commit)&.split('-', 2)
    return next_samson_number unless latest_github_number = fuzzy_tag.first[VERSION_REGEX, 1]
    next_github_number = (fuzzy_tag.size == 1 ? latest_github_number : next_number(latest_github_number))
    if Gem::Version.new(next_samson_number) > Gem::Version.new(next_github_number)
      next_samson_number
    else
      next_github_number
    end
  end
def next_release_number latest_samson_number = project . releases . last &. number || "0" next_samson_number = next_number ( latest_samson_number ) return next_samson_number if commit . blank? return next_samson_number unless fuzzy_tag = project . repository . fuzzy_tag_from_ref ( commit ) &. split ( '-' , 2 ) return next_samson_number unless latest_github_number = fuzzy_tag . first [ VERSION_REGEX , 1 ] next_github_number = ( fuzzy_tag . size == 1 ? latest_github_number : next_number ( latest_github_number ) ) if Gem :: Version . new ( next_samson_number ) > Gem :: Version . new ( next_github_number ) next_samson_number else next_github_number end end
If Github already has a version tagged for this commit, use it unless it is smaller.
If Github already has a version tagged for this commit use it unless it is smaller .