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 +4 -4
- data/lib/tina4/metrics.rb +20 -1
- data/lib/tina4/version.rb +1 -1
- 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: 13acdd49bf29d256910ee8f803a6cd0983d9b38a903d3bc3e3efbba4bc07b565
|
|
4
|
+
data.tar.gz: 2e344b8b471db71b218d29e69d18d0aa0f3b3d8493e60840f5d409c9c2807c31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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