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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11458e5ed9eda12f4414dc98635ec95082b50246c8eb8dad8a49cf17ea5e9746
4
- data.tar.gz: edba8d3b38a64c8564a2e2a9f8ad76a3d39e1e4ba5b9748c4d1f4823f3284338
3
+ metadata.gz: 32a8b662c4dfe266510a9191d5cb6fbb2b0d52372db4e020884967efeb761c52
4
+ data.tar.gz: f91b5768b12f8715fc400cef1da192d1a5b9e2ca7c941095f108b438e1674499
5
5
  SHA512:
6
- metadata.gz: 6114f3dacbf6d98e8a33e5fec6d511aa0de333d0e59a58b1243af1211316849018fa60cc728c8bcc2fd0bd076c0d15f19052eb1509527ae98abeec9323c79f78
7
- data.tar.gz: 5b6876e63d05241f8b585e5491c83a7a39b6dc5bd32f64033cb27b3774ba9fd31646dc13d89ecde256b0d0a4e9261ca1ee696fc9801697ecd0f4ae31d9981d3e
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 (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.5"
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"
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.5
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.5 ā”˜\n"
290
+ v0.2.6 ā”˜\n"
291
291
  rdoc_options: []
292
292
  require_paths:
293
293
  - lib