tng 0.2.5 ā 0.2.6
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/Rakefile +16 -0
- data/binaries/tng.bundle +0 -0
- data/binaries/tng.so +0 -0
- data/lib/tng/analyzers/controller.rb +0 -6
- data/lib/tng/services/test_generator.rb +11 -2
- data/lib/tng/version.rb +1 -1
- data/lib/tng.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32a8b662c4dfe266510a9191d5cb6fbb2b0d52372db4e020884967efeb761c52
|
|
4
|
+
data.tar.gz: f91b5768b12f8715fc400cef1da192d1a5b9e2ca7c941095f108b438e1674499
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 670688569bc80522d0a55b1c1625428443a015d1a1432dd8ce1851e6d7ca30dbfa528cee00d961a6b67ffeb9493678c34678766541de16596571e07448a52e1a
|
|
7
|
+
data.tar.gz: 9bce7c524936fcf7d8c8a06f7c55c546c7ea4e1757034e7812c3eb721a363bade6086b3e16ac97db64ffce1399d5c1df4c9702c90bfd656369a4456895621535
|
data/Rakefile
CHANGED
|
@@ -61,6 +61,22 @@ task :redo do
|
|
|
61
61
|
FileUtils.mkdir_p(destination_dir)
|
|
62
62
|
FileUtils.cp(source_file, File.join(destination_dir, binary_name))
|
|
63
63
|
puts "ā
Copied #{binary_name} to #{destination_dir}/"
|
|
64
|
+
|
|
65
|
+
# Code sign the bundles on macOS
|
|
66
|
+
if RUBY_PLATFORM.include?("darwin")
|
|
67
|
+
puts "š Signing bundles..."
|
|
68
|
+
system("codesign --force --sign - #{source_file}")
|
|
69
|
+
system("codesign --force --sign - #{File.join(destination_dir, binary_name)}")
|
|
70
|
+
|
|
71
|
+
# Also sign the gem installation if it exists
|
|
72
|
+
ruby_version = RUBY_VERSION.split(".")[0..1].join(".")
|
|
73
|
+
gem_bundle = File.expand_path("~/.local/share/mise/installs/ruby/#{RUBY_VERSION}/lib/ruby/gems/#{ruby_version}.0/gems/tng-*/binaries/tng.bundle")
|
|
74
|
+
Dir.glob(gem_bundle).each do |bundle|
|
|
75
|
+
system("codesign --force --sign - #{bundle}")
|
|
76
|
+
end
|
|
77
|
+
puts "ā
Bundles signed"
|
|
78
|
+
end
|
|
79
|
+
|
|
64
80
|
break
|
|
65
81
|
else
|
|
66
82
|
retries += 1
|
data/binaries/tng.bundle
CHANGED
|
Binary file
|
data/binaries/tng.so
CHANGED
|
Binary file
|
|
@@ -42,12 +42,6 @@ module Tng
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
def self.model_info_for_controller(file_path)
|
|
46
|
-
raise "file_path is required" if file_path.nil?
|
|
47
|
-
|
|
48
|
-
Tng::Analyzer::Controller.model_info_for_controller(file_path)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
45
|
def self.methods_for_controller(controller_name)
|
|
52
46
|
raise "controller_name is required" if controller_name.nil?
|
|
53
47
|
|
|
@@ -53,6 +53,15 @@ module Tng
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
job_data = JSON.parse(response.body)
|
|
56
|
+
|
|
57
|
+
# Check for forbidden responses (usage limits or invalid keys)
|
|
58
|
+
if response.status == 403
|
|
59
|
+
error_icon = Tng::UI::Theme.icon(:error)
|
|
60
|
+
error_color = Tng::UI::Theme.color(:error)
|
|
61
|
+
puts "#{error_icon} #{@pastel.decorate("Access denied:",
|
|
62
|
+
error_color)} Please check your API key and usage limits."
|
|
63
|
+
return
|
|
64
|
+
end
|
|
56
65
|
job_id = job_data["job_id"]
|
|
57
66
|
|
|
58
67
|
return unless job_id
|
|
@@ -104,7 +113,7 @@ module Tng
|
|
|
104
113
|
|
|
105
114
|
if seconds_elapsed > MAX_POLL_DURATION_SECONDS
|
|
106
115
|
progress_bar.finish
|
|
107
|
-
puts "ā Test generation timed out after #{MAX_POLL_DURATION_SECONDS} seconds (
|
|
116
|
+
puts "ā Test generation timed out after #{MAX_POLL_DURATION_SECONDS} seconds (7 minutes)"
|
|
108
117
|
return
|
|
109
118
|
end
|
|
110
119
|
|
|
@@ -138,7 +147,7 @@ module Tng
|
|
|
138
147
|
error_icon = Tng::UI::Theme.icon(:error)
|
|
139
148
|
error_color = Tng::UI::Theme.color(:error)
|
|
140
149
|
puts "#{error_icon} #{@pastel.decorate("Test generation failed:",
|
|
141
|
-
error_color)}
|
|
150
|
+
error_color)} An error occurred while generating tests. Please try again."
|
|
142
151
|
return
|
|
143
152
|
when "pending", "processing"
|
|
144
153
|
# Progress bar updates smoothly above
|
data/lib/tng/version.rb
CHANGED
data/lib/tng.rb
CHANGED
|
@@ -43,8 +43,6 @@ rescue LoadError => e
|
|
|
43
43
|
puts "Some functionality may not be available."
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
# Load Ruby analyzers after native binary to ensure Rust classes are available
|
|
47
|
-
# Ruby analyzers depend on Rust classes (e.g., Tng::Analyzer::Controller)
|
|
48
46
|
require_relative "tng/analyzers/controller"
|
|
49
47
|
require_relative "tng/analyzers/model"
|
|
50
48
|
require_relative "tng/analyzers/service"
|
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.2.
|
|
4
|
+
version: 0.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ralucab
|
|
@@ -287,7 +287,7 @@ post_install_message: "ā TNG āāāāāāāāāāāāāāāā
|
|
|
287
287
|
\ ā\nā ⢠bundle exec
|
|
288
288
|
tng --help - Show help information ā\nā ā\nā
|
|
289
289
|
\ \U0001F4A1 Generate tests for individual methods with precision ā\nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
290
|
-
v0.2.
|
|
290
|
+
v0.2.6 ā\n"
|
|
291
291
|
rdoc_options: []
|
|
292
292
|
require_paths:
|
|
293
293
|
- lib
|