qodex-rails 0.1.4 → 0.1.5

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: 9be5a381de2a7b86049cbaa9febd701729d429a08cf467a71b3b6ff963b1ee49
4
- data.tar.gz: 21975c62120e9b4a2c591e2253da5e510ad554babb53c7ae38dfd2419132a44a
3
+ metadata.gz: '08a5f5d7f43e4d9c091b7519e6744ec092fbffd4aa5bc478b66e0afdc7d0a8ff'
4
+ data.tar.gz: bc3ef816a36a9b63f15d28ec7a87169b87bfd1414f8a7a37126f0c9b1672843c
5
5
  SHA512:
6
- metadata.gz: a0bfaf78e17ff909346b5471731a7ae03a92ca06a9f1f1d179bfedb98bb4324268508edeb6ead23dc2820f5b4dfbb098dfa857deac804565d0baf906dfe5b27f
7
- data.tar.gz: 4c42c05445f578b0eec502d447e789ff1362ea07b83c7e93a47722031f39c8ce656a502a41fa6c5cfc46fb5b4aac04dd8cb1bed63734c13b8dfbe1e0d18688cc
6
+ metadata.gz: cf376639be8f8e5be908baff12364ba0963431f34fac18fd2b396c465b01e5e71ecf37c49e92dd1aa2b3695bf14309a5f8b3e1570cf02539dac88414c8abb3d5
7
+ data.tar.gz: ff94f6372beafce723904933d555d409f7efba485067ea4c307b7cea91b3e41fb84f7d9aa5c9530f9535811964af2e328c93c00e241b2434037fdfd72b619144
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Qodex
4
4
  module Rails
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
@@ -17,7 +17,7 @@ module QodexRails
17
17
  end
18
18
 
19
19
  # Print the initializer keys to the output
20
- Rails.logger.info "QodexRails Initializer Keys: Collection Name: #{QodexRails.configuration.collection_name}, API Key: #{QodexRails.configuration.api_key}"
20
+ # Rails.logger.info "QodexRails Initializer Keys: Collection Name: #{QodexRails.configuration.collection_name}, API Key: #{QodexRails.configuration.api_key}"
21
21
 
22
22
  start_time = Time.now
23
23
 
@@ -37,7 +37,8 @@ module QodexRails
37
37
  logs = {
38
38
  collection_name: QodexRails.configuration.collection_name,
39
39
  api_key: QodexRails.configuration.api_key,
40
- apis: [{
40
+ api: {
41
+ time_spent: (end_time - start_time).to_i,
41
42
  body: response_body,
42
43
  body_type: 'none-type',
43
44
  request_type: request.request_method,
@@ -46,7 +47,7 @@ module QodexRails
46
47
  status: status,
47
48
  headers: extract_headers(headers),
48
49
  params: request.params # Using Rails' parameter filtering
49
- }]
50
+ }
50
51
  }
51
52
 
52
53
  # Send the logs to the external API
@@ -68,7 +69,7 @@ module QodexRails
68
69
  end
69
70
 
70
71
  def send_to_api(logs)
71
- uri = URI("https://api.app.qodex.ai/api/v1/collections/create_with_folder/#{QodexRails.configuration.api_key}")
72
+ uri = URI("https://api.app.qodex.ai/api/v1/collections/create_sample_data/#{QodexRails.configuration.api_key}")
72
73
  request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
73
74
  request.body = JSON.generate(logs)
74
75
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
@@ -76,7 +77,7 @@ module QodexRails
76
77
  end
77
78
 
78
79
  # Optionally log the response from the external API
79
- Rails.logger.info "URI: #{uri}, API Response: #{response.body}" if response
80
+ # Rails.logger.info "URI: #{uri}, API Response: #{response.body}" if response
80
81
  end
81
82
  end
82
83
  end
@@ -1,3 +1,3 @@
1
1
  module QodexRails
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qodex-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sid