tina4ruby 3.10.41 → 3.10.42

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: 9ce1c810129bd38cc0cb779f3f9dd1c63914e9cccbf9e5c704b85502da5e8255
4
- data.tar.gz: 19dd3a30fc0a16c65824867829448a96a75e3eccdda4548540dcd84c7b8b18a1
3
+ metadata.gz: e2ef9ca3ce2b80dad4b7179527bf4b3cc2de210e8fd5b5df4922337e84e56beb
4
+ data.tar.gz: 7bda41dbe6ef16d81e1a1f6e6b262ac3027ea71afdc0cc0c85546fda4582181d
5
5
  SHA512:
6
- metadata.gz: 410b5805f04b18011d4a7b4bd4cf09c66f457c837d3a65ebe7b71ef849f4b089b0900072fd0a0172c8c93757cce6306db1c535ec558a71dd28148f211fc62b38
7
- data.tar.gz: 539f1b4dc7e0aa29c4ae3a5a9ef3dea49f9bb91381772ccbd490e7a254d33550247f2a17177f7caabc8ec72dbdda8648e24c576388aef574404553da4e8cba84
6
+ metadata.gz: eeb6b96351e27089eb7b4e8bd7b5bcbb4fc3cbba5c178f7f188ae91f41c28c9d3445af52338a2968a701abe7a86eabb51b0b1085c629a270611539b47eeaabb3
7
+ data.tar.gz: 20c4e4be361fe1b2a7f3ad402a4e8f5ce81e991effcb7af5142e1b1c4d2dbed9f7dc73b3133f1431155c73c3680978717ec109c7784163cf7300a6e6aa257377
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <p align="center">54 built-in features. Zero runtime dependencies. One require, everything works.</p>
7
7
  <p align="center">
8
8
  <a href="https://rubygems.org/gems/tina4ruby"><img src="https://img.shields.io/gem/v/tina4ruby?color=7b1fa2&label=RubyGems" alt="RubyGems"></a>
9
- <img src="https://img.shields.io/badge/tests-1%2C793%20passing-brightgreen" alt="Tests">
9
+ <img src="https://img.shields.io/badge/tests-1%2C578%20passing-brightgreen" alt="Tests">
10
10
  <img src="https://img.shields.io/badge/features-54-blue" alt="Features">
11
11
  <img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="Zero Deps">
12
12
  <a href="https://tina4.com"><img src="https://img.shields.io/badge/docs-tina4.com-7b1fa2" alt="Docs"></a>
@@ -1523,6 +1523,15 @@ function drillDownFile(path){
1523
1523
  });
1524
1524
  html+='</div>';
1525
1525
  }
1526
+ if(d.warnings&&d.warnings.length){
1527
+ html+='<h3 style="margin:0.75rem 0 0.25rem;color:#eab308;font-size:0.85rem">&#9888; Warnings</h3>';
1528
+ html+='<div style="display:flex;flex-direction:column;gap:4px">';
1529
+ d.warnings.forEach(function(w){
1530
+ html+='<div style="padding:4px 8px;background:rgba(234,179,8,0.08);border-left:3px solid #eab308;border-radius:0 4px 4px 0;font-size:0.75rem;font-family:var(--mono);color:var(--text)">';
1531
+ html+='<span style="color:#eab308;margin-right:6px">L'+w.line+'</span>'+w.message+'</div>';
1532
+ });
1533
+ html+='</div>';
1534
+ }
1526
1535
  dd.querySelector('.p-md').innerHTML=html;
1527
1536
  }).catch(function(e){
1528
1537
  dd.querySelector('.p-md').innerHTML='<p style="color:var(--danger)">Error: '+e.message+'</p>';
data/lib/tina4/metrics.rb CHANGED
@@ -339,6 +339,16 @@ module Tina4
339
339
  classes = lines.count { |l| l.strip.match?(/\A(class|module)\s+/) }
340
340
  imports = _extract_imports(lines)
341
341
 
342
+ warnings = []
343
+ functions.each do |f|
344
+ if f["loc"] <= 1
345
+ warnings << { "type" => "empty_method", "message" => "Method '#{f["name"]}' appears to be empty", "line" => f["line"] }
346
+ end
347
+ end
348
+ if classes > 0 && functions.empty? && loc <= 1
349
+ warnings << { "type" => "empty_class", "message" => "Class/module appears to be empty", "line" => 1 }
350
+ end
351
+
342
352
  {
343
353
  "path" => file_path,
344
354
  "loc" => loc,
@@ -353,7 +363,8 @@ module Tina4
353
363
  "args" => f["args"]
354
364
  }
355
365
  },
356
- "imports" => imports
366
+ "imports" => imports,
367
+ "warnings" => warnings
357
368
  }
358
369
  end
359
370
 
@@ -132,6 +132,14 @@ module Tina4
132
132
  handle_500(e, env)
133
133
  end
134
134
 
135
+ # Dispatch a pre-built Request through the Rack app and return the Rack response triple.
136
+ # Useful for testing and embedding without starting an HTTP server.
137
+ def handle(request)
138
+ env = request.env
139
+ env["rack.input"].rewind if env["rack.input"].respond_to?(:rewind)
140
+ call(env)
141
+ end
142
+
135
143
  private
136
144
 
137
145
  def handle_route(env, route, path_params)
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.41"
4
+ VERSION = "3.10.42"
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.41
4
+ version: 3.10.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tina4 Team