From a67ffacaef641c3fd38bf560033beb78136f9446 Mon Sep 17 00:00:00 2001 From: Nikita Shilnikov Date: Sun, 27 Aug 2023 17:57:13 +0200 Subject: [PATCH] Fix version handling --- config.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config.rb b/config.rb index 9adc3f278c..1df8c0364c 100644 --- a/config.rb +++ b/config.rb @@ -190,13 +190,14 @@ def github_url end def current_branch - versions[:branch] + current_project.versions.find { |version| version[:value] == current_version }[:branch] end def versions @versions ||= begin - vs = current_project.versions.find { |version| version[:value] == current_version }.sort_by { |version| + vs = current_project.versions.sort_by { |v| + version = v[:value] if version.match?(/[\d\.]+/) [1, *version.split('.').map(&:to_i)] else @@ -325,7 +326,7 @@ def gem_name end def set_version(url, new_version) - return url unless versions.empty? + return url unless current_project.versions.empty? version = extract_version(url)