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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/makit/version.rb +13 -14
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d93befa57f680339009f0de2fb5f05cc21e5568edc0d11b7b353fd286b809947
4
- data.tar.gz: 47fc7d425c73719c46a9f6230e001ed07c3c01b3aec5b0600e5b9013606970bd
3
+ metadata.gz: 99cc5b06f424c7833c2828dbbd4df8f1cda290cc900aae825f319467cd39d0fc
4
+ data.tar.gz: 48ad2c45a2d1b2a9b4ba223c1915ddb6a834b3e826b16e1c430f957edcfca6b9
5
5
  SHA512:
6
- metadata.gz: d9c1bfddaab86e85cc088d30280d1c2d8f1b0e629684b0463eed255d1ae654931136fd7484a1ccd17c62541a00d70aef8fd51b3fcfb381bfeb5fd8f2993e0684
7
- data.tar.gz: 9d9b1549633f32e224a2c490b4f9ef228a9bddb4e0a4097ec0a81aff9ca5f1c9c96c074b73dd781d341ac5ddf32553a14e476503df9e5a5288e7c9da0660bf83
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.155"
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 gemspec file
66
- # First tries to find a gemspec in the current project root
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 gemspec is found
69
- # @raise [RuntimeError] If a gemspec is found but version cannot be detected
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 gemspec in project root first (for projects using makit)
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
- # Look for any .gemspec file in project root
80
+ # Use SSOT version file detection (supports multiple file types)
80
81
  if project_root && Dir.exist?(project_root)
81
- gemspec_files = Dir.glob(File.join(project_root, "*.gemspec"))
82
- if gemspec_files.any?
83
- gemspec = gemspec_files.first
84
- gemspec_content = File.read(gemspec)
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 gemspec found, return default version (for non-gem projects)
117
+ # If no version file found, return default version (for non-gem projects)
119
118
  "0.0.0"
120
119
  end
121
120
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.155
4
+ version: 0.0.156
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow