qodex-rails 0.1.6 → 0.1.8

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: 37bec67a7b6e132899a672b96d6580e22c3fe0937888cf62b227c11de157b6ae
4
- data.tar.gz: 4786488f646d75452ab083f90eca0b26dd97a6a3ba35c1406ae4e42ae392caf5
3
+ metadata.gz: 50c9fdf2734e600fcc50f191f56c69db6c3d573c15f45bda0e61db9971243d8e
4
+ data.tar.gz: 7359015e40d8d9c9d1c03f3cc36b0a3f69e03a2deed88c897a56341a521423e3
5
5
  SHA512:
6
- metadata.gz: '08654fc0a2d2901005831a7156ccbcfa7eb58c01645235bbcf90b5bfa98e8270be9c295c59c6cbb3296fcac2eb88867e256cee3d80dffa5383044ffd610c7f06'
7
- data.tar.gz: 74f481441fabd88e32392327cc762ec74464c0cf9751399c1047e8c70e0354a2a61a74707df9eb3fa095e05d0e79ebaf71864adf929f48062c1b514fa3064389
6
+ metadata.gz: '0960805548f39fc94b951164cbc7a3c1e1a0fbd0beab47d692949c6d3fb21c704e2eafdd06ec68a7af214906cd7949d517382e928e330cf160148f6f83116b56'
7
+ data.tar.gz: f5b8974602327d861b001226325ede10bd819da4791d597a02cf33d48297e06d096ed9adb3ad0fcec06c3b42abb26acd6a0f49a531f4b17fd6d604ab19c076a4
data/README.md CHANGED
@@ -8,7 +8,11 @@ TODO: Delete this and the text above, and describe your gem
8
8
 
9
9
  Install the gem and add to the application's Gemfile by executing:
10
10
 
11
- $ bundle add qodex-rails
11
+ $ # Gemfile
12
+
13
+ group :staging do
14
+ gem 'qodex-rails'
15
+ end
12
16
 
13
17
  If bundler is not being used to manage dependencies, install the gem by executing:
14
18
 
@@ -22,6 +26,16 @@ If bundler is not being used to manage dependencies, install the gem by executin
22
26
  config.api_key = 'Your_API_Key' # API key for authentication
23
27
  end
24
28
 
29
+ # config/initializers/qodex_rails.rb
30
+
31
+ if Rails.env.staging?
32
+ QodexRails.configure do |config|
33
+ # Your configuration settings for qodex-rails in the staging environment
34
+ project_name = Rails.application.class.module_parent_name rescue 'qodex'
35
+ config.collection_name = "#{project_name}-#{Rails.env}" # Name of the collection where logs will be stored
36
+ config.api_key = 'Your API Key'
37
+ end
38
+ end
25
39
 
26
40
  ## Usage
27
41
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Qodex
4
4
  module Rails
5
- VERSION = "0.1.6"
5
+ VERSION = "0.1.8"
6
6
  end
7
7
  end
@@ -64,6 +64,7 @@ module QodexRails
64
64
  env.select { |k, v| k.start_with?('HTTP_') }
65
65
  .map { |pair| [pair[0].sub(/^HTTP_/, ''), pair[1]] }
66
66
  .map { |pair| [pair[0].split('_').collect(&:capitalize).join('-'), pair[1]] }
67
+ .to_h
67
68
  end
68
69
 
69
70
  def extract_body(response)
@@ -73,7 +74,7 @@ module QodexRails
73
74
  end
74
75
 
75
76
  def extract_headers(headers)
76
- headers.map { |name, value| { name: name, value: value } } if headers.respond_to?(:map)
77
+ headers.to_h if headers.respond_to?(:map)
77
78
  end
78
79
 
79
80
  def send_to_api(logs)
@@ -1,3 +1,3 @@
1
1
  module QodexRails
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qodex-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - sid
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-03 00:00:00.000000000 Z
11
+ date: 2023-10-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Intercept your rails application to power Qodex.ai AI copilot.
14
14
  email: