tng 0.2.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98da639352758b3b24da35177573d67e7e51860b85121eb0037926601d141027
4
- data.tar.gz: 7f289b904f527e8f055e0b4586dc0242d678f4b590112ad16b028ae50d793581
3
+ metadata.gz: 32a8b662c4dfe266510a9191d5cb6fbb2b0d52372db4e020884967efeb761c52
4
+ data.tar.gz: f91b5768b12f8715fc400cef1da192d1a5b9e2ca7c941095f108b438e1674499
5
5
  SHA512:
6
- metadata.gz: 5ddc1271b830f67a918c8998397df4afa28e7fb679192eae280a95d3d4aa47a724f013c7aacd08f7f143063e1fcafe0cac732d6b866c9308582057125bd15c21
7
- data.tar.gz: ad5fb8e2a558f3b2f46cfe646c9abb1b8bf2861d8761ec2bf5c980fe7832068f45b53418e01c4f1bcdfc1ab91556a890d678405a10ade4e24d57c16dda09d59d
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 ADDED
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 (6 minutes)"
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)} #{status_data["error"] || "Unknown error"}"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tng
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.6"
5
5
  end
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"
data/tng.gemspec CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.extensions = []
33
33
 
34
34
  spec.add_dependency "httpx", "~> 1.5"
35
+ spec.add_dependency "openssl", "~> 3.3"
35
36
  spec.add_dependency "pastel", "~> 0.8.0"
36
37
  spec.add_dependency "prism", "~> 1.4.0"
37
38
  spec.add_dependency "rb_sys", "~> 0.9.91"
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
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ralucab
@@ -23,6 +23,20 @@ dependencies:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
25
  version: '1.5'
26
+ - !ruby/object:Gem::Dependency
27
+ name: openssl
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.3'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.3'
26
40
  - !ruby/object:Gem::Dependency
27
41
  name: pastel
28
42
  requirement: !ruby/object:Gem::Requirement
@@ -209,6 +223,7 @@ files:
209
223
  - bin/load_dev
210
224
  - bin/tng
211
225
  - binaries/tng.bundle
226
+ - binaries/tng.so
212
227
  - lib/generators/tng/install_generator.rb
213
228
  - lib/tng.rb
214
229
  - lib/tng/analyzers/controller.rb
@@ -272,7 +287,7 @@ post_install_message: "ā”Œ TNG ────────────────
272
287
  \ │\n│ • bundle exec
273
288
  tng --help - Show help information │\n│ │\n│
274
289
  \ \U0001F4A1 Generate tests for individual methods with precision │\n└────────────────────────────────────────────────────────────
275
- v0.2.4 ā”˜\n"
290
+ v0.2.6 ā”˜\n"
276
291
  rdoc_options: []
277
292
  require_paths:
278
293
  - lib