tina4ruby 3.10.65 → 3.10.66

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6fa463a9244bec2d1144ebcdc903e19681ea7e60cc0b3ea3438e21b8388ec9e
4
- data.tar.gz: 3ac6566d7b754979331b290e9c3610778eaa69ce6c31ae0eb8d8b16dd69deaa5
3
+ metadata.gz: 13acdd49bf29d256910ee8f803a6cd0983d9b38a903d3bc3e3efbba4bc07b565
4
+ data.tar.gz: 2e344b8b471db71b218d29e69d18d0aa0f3b3d8493e60840f5d409c9c2807c31
5
5
  SHA512:
6
- metadata.gz: c40fcd4bc17ee1e0d2e41a297750210fc1e66708080a20c180dfe2f6338ce435d8e30042c0799a9455384b5808f221c00f156d13bdbd9aac4ecbbd655d9204fa
7
- data.tar.gz: 180229e03f54704f3d3455d6b1c6690aea1979fbcbbfe2b05150c1831b25630628cbeb3b52cb7810f72939d9360e40d4a0ff8c42196df46591114aa923ea1e74
6
+ metadata.gz: b314ccc66d3cc707e5efcaf27a162da73d2f84255faf1cde06369b11144591c58223f007808415f9697d3d158d496786baeda362a20ceafb7eddd4d5e4ec450c
7
+ data.tar.gz: 1117b18973c2f6c44b28caa2d18f6064b3ce63fa4f0e6d4a6a88250c448bd2133a026b05a4f85978a7cf38473043d9d41e440c7a6b92af8693ef78af3ece5a27
data/lib/tina4/metrics.rb CHANGED
@@ -21,6 +21,9 @@ module Tina4
21
21
  @full_cache_time = 0
22
22
  CACHE_TTL = 60
23
23
 
24
+ # Stores the resolved scan root so file_detail can locate framework files.
25
+ @last_scan_root = ""
26
+
24
27
  # ── Root Resolution ──────────────────────────────────────────
25
28
 
26
29
  # Pick the right directory to scan.
@@ -30,10 +33,17 @@ module Tina4
30
33
  def self._resolve_root(root = 'src')
31
34
  root_path = Pathname.new(root)
32
35
  if root_path.directory? && !Dir.glob(root_path.join('**', '*.rb')).empty?
36
+ @last_scan_root = File.expand_path(root)
33
37
  return root
34
38
  end
35
39
  # Fallback: scan the framework package itself
36
- File.dirname(__FILE__)
40
+ fw_dir = File.dirname(__FILE__)
41
+ @last_scan_root = fw_dir
42
+ fw_dir
43
+ end
44
+
45
+ def self.last_scan_root
46
+ @last_scan_root
37
47
  end
38
48
 
39
49
  # ── Quick Metrics ───────────────────────────────────────────
@@ -346,6 +356,15 @@ module Tina4
346
356
  # ── File Detail ─────────────────────────────────────────────
347
357
 
348
358
  def self.file_detail(file_path)
359
+ unless File.exist?(file_path)
360
+ # Try resolving relative to the last scan root (framework mode)
361
+ if @last_scan_root && !@last_scan_root.empty?
362
+ candidate = File.join(@last_scan_root, file_path)
363
+ if File.exist?(candidate)
364
+ file_path = candidate
365
+ end
366
+ end
367
+ end
349
368
  unless File.exist?(file_path)
350
369
  return { "error" => "File not found: #{file_path}" }
351
370
  end
data/lib/tina4/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tina4
4
- VERSION = "3.10.65"
4
+ VERSION = "3.10.66"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tina4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.65
4
+ version: 3.10.66
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tina4 Team