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 +4 -4
- data/README.md +15 -1
- data/lib/qodex/rails/version.rb +1 -1
- data/lib/qodex-rails/middleware.rb +2 -1
- data/lib/qodex-rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50c9fdf2734e600fcc50f191f56c69db6c3d573c15f45bda0e61db9971243d8e
|
4
|
+
data.tar.gz: 7359015e40d8d9c9d1c03f3cc36b0a3f69e03a2deed88c897a56341a521423e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
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
|
-
$
|
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
|
|
data/lib/qodex/rails/version.rb
CHANGED
@@ -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.
|
77
|
+
headers.to_h if headers.respond_to?(:map)
|
77
78
|
end
|
78
79
|
|
79
80
|
def send_to_api(logs)
|
data/lib/qodex-rails/version.rb
CHANGED
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.
|
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-
|
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:
|