makit 0.0.155 → 0.0.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/makit/version.rb +13 -14
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99cc5b06f424c7833c2828dbbd4df8f1cda290cc900aae825f319467cd39d0fc
|
|
4
|
+
data.tar.gz: 48ad2c45a2d1b2a9b4ba223c1915ddb6a834b3e826b16e1c430f957edcfca6b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e35a52ee45fd084f4b8e0811a67231cd7c001b56c6d861bad1a7334884b8ba1645b83969cf2b910285a8b61417b1427e6e13aeb07be3b7c6b9944ac9be773f5
|
|
7
|
+
data.tar.gz: 4e21ae3c58f2b196a2185fe2b1a94f3b57cb685d8026b0d4e31bd08fa3ac9657326ce82452969fc413f199495e7e9c1780f295c7374368cca511a1f27c9b0701
|
data/lib/makit/version.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Makit
|
|
4
4
|
# Static version for now to avoid circular dependency issues
|
|
5
|
-
#VERSION = "0.0.
|
|
5
|
+
#VERSION = "0.0.156"
|
|
6
6
|
|
|
7
7
|
# Version management utilities for various file formats
|
|
8
8
|
#
|
|
@@ -62,13 +62,14 @@ module Makit
|
|
|
62
62
|
#
|
|
63
63
|
class Version
|
|
64
64
|
|
|
65
|
-
# Attempt to detect the version from the
|
|
66
|
-
#
|
|
65
|
+
# Attempt to detect the version from the SSOT (Single Source of Truth) version file
|
|
66
|
+
# Uses the same logic as Makit::Version.info to find version files in priority order:
|
|
67
|
+
# *.gemspec, Directory.Build.props, Cargo.toml, package.json, pyproject.toml, pom.xml
|
|
67
68
|
# Falls back to makit.gemspec only if we're in the makit gem directory
|
|
68
|
-
# @return [String] The version string, or "0.0.0" if no
|
|
69
|
-
# @raise [RuntimeError] If a
|
|
69
|
+
# @return [String] The version string, or "0.0.0" if no version file is found
|
|
70
|
+
# @raise [RuntimeError] If a version file is found but version cannot be detected
|
|
70
71
|
def self.version
|
|
71
|
-
# Try to find
|
|
72
|
+
# Try to find version file in project root using SSOT logic (same as Makit::Version.info)
|
|
72
73
|
project_root = begin
|
|
73
74
|
require_relative "directories" unless defined?(Makit::Directories)
|
|
74
75
|
Makit::Directories::PROJECT_ROOT
|
|
@@ -76,14 +77,12 @@ module Makit
|
|
|
76
77
|
find_project_root(Dir.pwd)
|
|
77
78
|
end
|
|
78
79
|
|
|
79
|
-
#
|
|
80
|
+
# Use SSOT version file detection (supports multiple file types)
|
|
80
81
|
if project_root && Dir.exist?(project_root)
|
|
81
|
-
|
|
82
|
-
if
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
match = gemspec_content.match(/spec\.version\s*=\s*["']([^"']+)["']/)
|
|
86
|
-
return match[1] if match
|
|
82
|
+
version_file = find_ssot_version_file(project_root)
|
|
83
|
+
if version_file && File.exist?(version_file)
|
|
84
|
+
version = extract_version_from_ssot_file(version_file)
|
|
85
|
+
return version if version
|
|
87
86
|
end
|
|
88
87
|
end
|
|
89
88
|
|
|
@@ -115,7 +114,7 @@ module Makit
|
|
|
115
114
|
end
|
|
116
115
|
end
|
|
117
116
|
|
|
118
|
-
# If no
|
|
117
|
+
# If no version file found, return default version (for non-gem projects)
|
|
119
118
|
"0.0.0"
|
|
120
119
|
end
|
|
121
120
|
|