tng 0.3.8 → 0.4.0
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/bin/tng +404 -19
- data/binaries/go-ui-darwin-amd64 +0 -0
- data/binaries/go-ui-darwin-arm64 +0 -0
- data/binaries/go-ui-linux-amd64 +0 -0
- data/binaries/go-ui-linux-arm64 +0 -0
- data/binaries/tng-darwin-arm64.bundle +0 -0
- data/binaries/tng-darwin-x86_64.bundle +0 -0
- data/binaries/tng-linux-arm64.so +0 -0
- data/binaries/tng-linux-x86_64.so +0 -0
- data/binaries/tng.bundle +0 -0
- data/lib/tng/analyzers/controller.rb +0 -6
- data/lib/tng/analyzers/model.rb +4 -9
- data/lib/tng/analyzers/service.rb +1 -7
- data/lib/tng/services/direct_generation.rb +57 -27
- data/lib/tng/services/fix_orchestrator.rb +92 -0
- data/lib/tng/services/repair_service.rb +48 -0
- data/lib/tng/services/test_generator.rb +87 -5
- data/lib/tng/ui/go_ui_session.rb +27 -4
- data/lib/tng/ui/json_session.rb +198 -0
- data/lib/tng/utils.rb +25 -2
- data/lib/tng/version.rb +1 -1
- data/lib/tng.rb +7 -3
- metadata +7 -2
data/lib/tng/utils.rb
CHANGED
|
@@ -287,7 +287,7 @@ module Tng
|
|
|
287
287
|
end
|
|
288
288
|
end
|
|
289
289
|
|
|
290
|
-
|
|
290
|
+
def self.count_test_nodes(node)
|
|
291
291
|
return 0 unless node.respond_to?(:child_nodes)
|
|
292
292
|
|
|
293
293
|
count = 0
|
|
@@ -303,7 +303,7 @@ module Tng
|
|
|
303
303
|
count
|
|
304
304
|
end
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
def self.test_node?(node)
|
|
307
307
|
case node
|
|
308
308
|
when Prism::DefNode
|
|
309
309
|
# Minitest: def test_something
|
|
@@ -456,5 +456,28 @@ module Tng
|
|
|
456
456
|
"#{minutes}m #{remaining_seconds}s"
|
|
457
457
|
end
|
|
458
458
|
end
|
|
459
|
+
|
|
460
|
+
def self.validate_ruby_syntax(file_path)
|
|
461
|
+
output = `ruby -c #{file_path} 2>&1`
|
|
462
|
+
{ success: $?.success?, output: output }
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
def self.validate_rubocop(file_path)
|
|
466
|
+
# Run rubocop with JSON output
|
|
467
|
+
output = `bundle exec rubocop #{file_path} --format json 2>&1`
|
|
468
|
+
{ success: $?.success?, output: output }
|
|
469
|
+
rescue StandardError => e
|
|
470
|
+
{ success: false, output: "Rubocop error: #{e.message}" }
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
def self.run_tests(file_path)
|
|
474
|
+
command = if file_path.include?("/spec/")
|
|
475
|
+
"bundle exec rspec #{file_path}"
|
|
476
|
+
else
|
|
477
|
+
"bundle exec rails test #{file_path}"
|
|
478
|
+
end
|
|
479
|
+
output = `#{command} 2>&1`
|
|
480
|
+
{ success: $?.success?, output: output, command: command }
|
|
481
|
+
end
|
|
459
482
|
end
|
|
460
483
|
end
|
data/lib/tng/version.rb
CHANGED
data/lib/tng.rb
CHANGED
|
@@ -51,9 +51,13 @@ begin
|
|
|
51
51
|
simple_binary_paths.each do |path|
|
|
52
52
|
next unless File.exist?(path)
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
begin
|
|
55
|
+
require path
|
|
56
|
+
loaded = true
|
|
57
|
+
break
|
|
58
|
+
rescue LoadError
|
|
59
|
+
# If this fails (e.g. wrong architecture), silently continue to try platform-specific ones
|
|
60
|
+
end
|
|
57
61
|
end
|
|
58
62
|
|
|
59
63
|
# If not loaded, try platform-specific binaries (copy to temp first)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tng
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ralucab
|
|
@@ -162,6 +162,8 @@ files:
|
|
|
162
162
|
- binaries/go-ui-darwin-arm64
|
|
163
163
|
- binaries/go-ui-linux-amd64
|
|
164
164
|
- binaries/go-ui-linux-arm64
|
|
165
|
+
- binaries/tng-darwin-arm64.bundle
|
|
166
|
+
- binaries/tng-darwin-x86_64.bundle
|
|
165
167
|
- binaries/tng-linux-arm64.so
|
|
166
168
|
- binaries/tng-linux-x86_64.so
|
|
167
169
|
- binaries/tng.bundle
|
|
@@ -176,10 +178,13 @@ files:
|
|
|
176
178
|
- lib/tng/services/direct_generation.rb
|
|
177
179
|
- lib/tng/services/extract_methods.rb
|
|
178
180
|
- lib/tng/services/file_type_detector.rb
|
|
181
|
+
- lib/tng/services/fix_orchestrator.rb
|
|
182
|
+
- lib/tng/services/repair_service.rb
|
|
179
183
|
- lib/tng/services/test_generator.rb
|
|
180
184
|
- lib/tng/services/testng.rb
|
|
181
185
|
- lib/tng/services/user_app_config.rb
|
|
182
186
|
- lib/tng/ui/go_ui_session.rb
|
|
187
|
+
- lib/tng/ui/json_session.rb
|
|
183
188
|
- lib/tng/ui/post_install_box.rb
|
|
184
189
|
- lib/tng/ui/theme.rb
|
|
185
190
|
- lib/tng/utils.rb
|
|
@@ -217,7 +222,7 @@ post_install_message: "┌ TNG ────────────────
|
|
|
217
222
|
\ │\n│ • bundle exec
|
|
218
223
|
tng --help - Show help information │\n│ │\n│
|
|
219
224
|
\ \U0001F4A1 Generate tests for individual methods with precision │\n└────────────────────────────────────────────────────────────
|
|
220
|
-
v0.
|
|
225
|
+
v0.4.0 ┘\n"
|
|
221
226
|
rdoc_options: []
|
|
222
227
|
require_paths:
|
|
223
228
|
- lib
|