tng 0.3.7 → 0.3.8

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: cf4410582c80fc52dd86ab2cb7ff70bec60ec8bfe831a9cf818dab561b7f0e43
4
- data.tar.gz: 3077129527ba7cfa0855bfae29a43eb10daa1b8b12efae0704b567b44a478561
3
+ metadata.gz: cbf8e76f0412c426150b5a9cef4d3a077d9747bf02c16ea6086f621cb78236a0
4
+ data.tar.gz: 5bb42890de6580034ffc78df9b699433667e07e7877c7dc280ca53d998fa29cf
5
5
  SHA512:
6
- metadata.gz: 58e85b219ecadad22b8c607b9fcfae7b3a3f9b071d3e04b96c7efdf97de76f85220c3e8f18571026758e37b7f9f7b46c930d56fdbf2724aba9a3d15bc3d388c5
7
- data.tar.gz: b843b203b8b61489c9e28be3f7e94c51b967d024ae79be477d96cdc5117921312e38391ec4e055dd271ea362491f1b6e0c665144ef5529d527f3619f96301a2e
6
+ metadata.gz: 868acc7d7fa9b539fac0b9906662cdf906a115da97f86643f8d2c88f9015b536e3ec75bbb50537df0a2283232207d7531a12b81eb8af4bdc8a1aa4abb4a83122
7
+ data.tar.gz: 1410ad3af1e8b0bfbfa7d9849ba293cddca599e4dfda976f6433651814343592e39ef40aec5ca7c884e4ad28f004ab86bd36a384e1c334ab008629bec9ea3bd5
Binary file
Binary file
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.3.7"
4
+ VERSION = "0.3.8"
5
5
  end
data/lib/tng.rb CHANGED
@@ -14,6 +14,7 @@ require_relative "tng/railtie" if defined?(Rails)
14
14
 
15
15
  begin
16
16
  require "rbconfig"
17
+ require "fileutils"
17
18
 
18
19
  platform = RUBY_PLATFORM
19
20
  arch = RbConfig::CONFIG["host_cpu"]
@@ -30,19 +31,24 @@ begin
30
31
  ext = platform.include?("darwin") ? "bundle" : "so"
31
32
 
32
33
  # Try loading in order of preference
33
- binary_paths = [
34
- # Development: simple name (rake dev output)
34
+ # Simple-named binaries can be loaded directly
35
+ simple_binary_paths = [
35
36
  File.expand_path("tng/tng.#{ext}", __dir__),
36
37
  File.expand_path("../binaries/tng.#{ext}", __dir__),
37
- # Production: arch-specific names
38
+ File.expand_path("binaries/tng.#{ext}", Dir.pwd)
39
+ ]
40
+
41
+ # Platform-specific binaries need to be copied to temp with simple name
42
+ # because Ruby's init function lookup uses the filename
43
+ platform_binary_paths = [
38
44
  File.expand_path("../binaries/tng-#{os}-#{arch}.#{ext}", __dir__),
39
- # Fallback: current dir
40
- File.expand_path("binaries/tng.#{ext}", Dir.pwd),
41
45
  File.expand_path("binaries/tng-#{os}-#{arch}.#{ext}", Dir.pwd)
42
46
  ]
43
47
 
44
48
  loaded = false
45
- binary_paths.each do |path|
49
+
50
+ # Try simple-named binaries first (they load directly)
51
+ simple_binary_paths.each do |path|
46
52
  next unless File.exist?(path)
47
53
 
48
54
  require path
@@ -50,7 +56,27 @@ begin
50
56
  break
51
57
  end
52
58
 
53
- raise LoadError, "Could not find binary at any of: #{binary_paths.join(", ")}" unless loaded
59
+ # If not loaded, try platform-specific binaries (copy to temp first)
60
+ unless loaded
61
+ platform_binary_paths.each do |path|
62
+ next unless File.exist?(path)
63
+
64
+ # Copy to temp location with simple name so Init_tng is found
65
+ temp_dir = File.join(Dir.tmpdir, "tng-#{Process.pid}")
66
+ FileUtils.mkdir_p(temp_dir)
67
+ temp_binary = File.join(temp_dir, "tng.#{ext}")
68
+ FileUtils.cp(path, temp_binary)
69
+
70
+ require temp_binary
71
+ loaded = true
72
+ break
73
+ end
74
+ end
75
+
76
+ unless loaded
77
+ raise LoadError,
78
+ "Could not find binary at any of: #{(simple_binary_paths + platform_binary_paths).join(", ")}"
79
+ end
54
80
  rescue LoadError => e
55
81
  puts "Warning: Could not load native extension: #{e.message}"
56
82
  puts "Some functionality may not be available."
@@ -67,6 +93,7 @@ module Tng
67
93
  api_key: nil,
68
94
  base_url: "https://app.tng.sh/",
69
95
  test_helper_path: nil,
96
+ authentication_enabled: false,
70
97
  authentication_methods: []
71
98
  }
72
99
 
@@ -109,4 +136,12 @@ module Tng
109
136
  def self.authentication_methods
110
137
  @config[:authentication_methods]
111
138
  end
139
+
140
+ def self.authentication_enabled=(value)
141
+ @config[:authentication_enabled] = value
142
+ end
143
+
144
+ def self.authentication_enabled
145
+ @config[:authentication_enabled]
146
+ end
112
147
  end
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.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - ralucab
@@ -162,9 +162,9 @@ 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
165
  - binaries/tng-linux-arm64.so
167
166
  - binaries/tng-linux-x86_64.so
167
+ - binaries/tng.bundle
168
168
  - lib/generators/tng/install_generator.rb
169
169
  - lib/tng.rb
170
170
  - lib/tng/analyzers/controller.rb
@@ -217,7 +217,7 @@ post_install_message: "┌ TNG ────────────────
217
217
  \ │\n│ • bundle exec
218
218
  tng --help - Show help information │\n│ │\n│
219
219
  \ \U0001F4A1 Generate tests for individual methods with precision │\n└────────────────────────────────────────────────────────────
220
- v0.3.7 ┘\n"
220
+ v0.3.8 ┘\n"
221
221
  rdoc_options: []
222
222
  require_paths:
223
223
  - lib