qodex-rails 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b11d2adaab0ce0578b59e97eb0126db77c6e3ea9e574a26993fc98e5390a6625
4
- data.tar.gz: 87c38a3060afe958a318c551447b930d8f59b6f8a4d26a3ee70aec9fc77e20b1
3
+ metadata.gz: '08a5f5d7f43e4d9c091b7519e6744ec092fbffd4aa5bc478b66e0afdc7d0a8ff'
4
+ data.tar.gz: bc3ef816a36a9b63f15d28ec7a87169b87bfd1414f8a7a37126f0c9b1672843c
5
5
  SHA512:
6
- metadata.gz: ceb75b0590a4b51efc355c35851ed649d3222671196987c8807192484291305b8ce899360ee428b06f4af86261be3464c8df0ae0ccb1cb44953de38a5b264542
7
- data.tar.gz: 4e66c0e6157973b8c3e278d5ca7ed91473ddcf77367ea9c0c1b5f151f3f04749d642e19059e9763f4b763aafc8ff15aa19c4e4e737341753d2a5e82b87cba62d
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.3"
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,
@@ -45,8 +46,8 @@ module QodexRails
45
46
  url: request.url,
46
47
  status: status,
47
48
  headers: extract_headers(headers),
48
- params: request.filtered_parameters # Using Rails' parameter filtering
49
- }]
49
+ params: request.params # Using Rails' parameter filtering
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.3"
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.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sid