chalk_ruby 0.4.2 → 0.4.3

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: 4165478b519e054426f89a0e2a5baa7a8f1ef2e4eb3d23a4489bb478e96adca2
4
- data.tar.gz: c51633a4a2a3ee79dfb2f1a22d9bf80d9a6c8719f587f71d894b7be877f1fa91
3
+ metadata.gz: 41aeb7dd875f71ac96acd9d74dc75f583d59bc21a8611002996de8915ef92c11
4
+ data.tar.gz: dd7ff83b7c46fdfc1dd9cddba6cf874113c3ad64a0126e3efbf5b0abd4b31da9
5
5
  SHA512:
6
- metadata.gz: 3a52b774af1729f1ba7194c97aa9ba8b323b3bbb47efe06dd9e8cfd5124e3fe963eb5fab5ecf698614cc9a3f4ae6aa09a65c6ff1f770f0d0ae6e257be80a1036
7
- data.tar.gz: a4f91f89f52e8b3b036e3d19c1dde26845e430fa69e766cf88e0e7122f5a12f2750c8d689bfa7cdfc5d6094b307b608a8d79aeec9c5df0c462cf7a19450e38aa
6
+ metadata.gz: fb9fc19e2b66f1ad829b3024d6d63a3aa28be882501689a56193424e447a3f98ebd49e795b0f3f8983052b7447afe6e767a4454923598f5625345c0361750d6e
7
+ data.tar.gz: e4f11dfeb743205a724e890335d6811f4f36eb93157da25874196f18bf8c26d52bb1149909f8760026414205a896ab3f6f42f78aa1096af02baa56dcec370adc
@@ -228,7 +228,7 @@ module ChalkRuby
228
228
  end
229
229
 
230
230
  # Warm up connections to the API and query servers by establishing
231
- # TCP connections with lightweight HEAD requests
231
+ # connections without making actual requests
232
232
  def warm_connections
233
233
  # Get the query server host
234
234
  query_host = query_server_host
@@ -242,23 +242,13 @@ module ChalkRuby
242
242
 
243
243
  private
244
244
 
245
- # Establish a connection to a host by making a lightweight request
245
+ # Establish a connection to a host without making a request
246
246
  def warm_connection(host)
247
247
  # Access the underlying HTTP requester
248
248
  requester = @transporter.instance_variable_get(:@http_requester)
249
249
 
250
- # Create the Faraday connection object
251
- connection = requester.connection(host)
252
-
253
- # Make a HEAD request to "/" to actually establish the TCP connection
254
- # HEAD is used as it's lightweight and most servers support it
255
- begin
256
- connection.head('/')
257
- rescue => e
258
- # Ignore errors - we're just warming the connection
259
- # The server might not support HEAD on /, but the TCP connection
260
- # will still be established
261
- end
250
+ # This will create and cache the Faraday connection
251
+ requester.connection(host)
262
252
  end
263
253
 
264
254
  def api_server_request(method:, path:, body:, headers:)
@@ -248,7 +248,7 @@ module ChalkRuby
248
248
  end
249
249
 
250
250
  def get_token
251
- response = @auth_stub.get_token(
251
+ response = auth_service.get_token(
252
252
  Chalk::Server::V1::GetTokenRequest.new(
253
253
  client_id: @config.client_id,
254
254
  client_secret: @config.client_secret
@@ -1,3 +1,3 @@
1
1
  module ChalkRuby
2
- VERSION = '0.4.2'.freeze
2
+ VERSION = '0.4.3'.freeze
3
3
  end
@@ -3,8 +3,8 @@ require 'rspec/autorun'
3
3
  require 'chalk_ruby/client'
4
4
  require 'chalk_ruby/error'
5
5
 
6
- CLIENT_ID = 'client-9314816c664be6cb04678e5e3d0e50e2'
7
- CLIENT_SECRET = 'secret-51f3ce3d4f701f23afdd622015732edf1eb62d0d678b3511b615f9b1f00b4a7d'
6
+ CLIENT_ID = ''
7
+ CLIENT_SECRET = ''
8
8
 
9
9
  RSpec.describe 'Online query' do
10
10
  it 'should accept valid queries' do
@@ -14,8 +14,6 @@ require 'chalk_ruby/protos/chalk/engine/v1/query_server_services_pb'
14
14
  require 'arrow'
15
15
 
16
16
 
17
- CLIENT_ID = 'client-9314816c664be6cb04678e5e3d0e50e2'
18
- CLIENT_SECRET = 'secret-51f3ce3d4f701f23afdd622015732edf1eb62d0d678b3511b615f9b1f00b4a7d'
19
17
 
20
18
 
21
19
  RSpec.describe ChalkRuby::GrpcClient do
@@ -75,4 +73,32 @@ RSpec.describe ChalkRuby::GrpcClient do
75
73
  expect(response[:data][0]['user.id']).to eq(1)
76
74
  end
77
75
  end
76
+
77
+ describe '#get_token' do
78
+ let(:client) do
79
+ ChalkRuby::GrpcClient.new(
80
+ ChalkRuby::Config.new(
81
+ query_server: "standard-gke.chalk-develop.gcp.chalk.ai",
82
+ api_server: "api.staging.chalk.ai:443",
83
+ client_id: CLIENT_ID,
84
+ client_secret: CLIENT_SECRET,
85
+ environment: "tmnmc9beyujew"
86
+ )
87
+ )
88
+ end
89
+
90
+ it 'can get auth token successfully' do
91
+ token = client.get_token
92
+
93
+ expect(token).not_to be_nil
94
+ expect(token).to be_a(String)
95
+ expect(token.length).to be > 0
96
+ end
97
+
98
+ it 'uses auth_service instead of undefined @auth_stub' do
99
+ # This test ensures the fix for the NoMethodError is working
100
+ # The method should not raise an error about undefined @auth_stub
101
+ expect { client.get_token }.not_to raise_error(NoMethodError)
102
+ end
103
+ end
78
104
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chalk_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chalk AI, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-01 00:00:00.000000000 Z
11
+ date: 2025-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -376,7 +376,7 @@ metadata:
376
376
  bug_tracker_uri: https://github.com/chalk-ai/chalk-ruby/issues
377
377
  documentation_uri: https://docs.chalk.ai/docs
378
378
  source_code_uri: https://github.com/chalk-ai/chalk-ruby
379
- post_install_message:
379
+ post_install_message:
380
380
  rdoc_options: []
381
381
  require_paths:
382
382
  - lib
@@ -391,8 +391,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
391
391
  - !ruby/object:Gem::Version
392
392
  version: '0'
393
393
  requirements: []
394
- rubygems_version: 3.5.22
395
- signing_key:
394
+ rubygems_version: 3.0.3.1
395
+ signing_key:
396
396
  specification_version: 4
397
397
  summary: A simple Ruby client for Chalk
398
398
  test_files: