meta_request 0.7.4 → 0.8.0
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 +4 -4
- data/README.md +1 -1
- data/lib/meta_request/event.rb +11 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dd75bc4f5710d89b2ee41d7fd9be191aab640b74a28ca5456b197842a44a270
|
4
|
+
data.tar.gz: c14b48d129d46390f8c1b08a700f9cc45b5d7e5c4046ceba373733d9e64d9d85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6516f1e0c9421f5fb73f7ee060adf96098d3fdb5297550140aa989e71e287ba67a971348f8c1c54445ae87b3446201f07f773e18c14dcce79b5d1ea73bcc6418
|
7
|
+
data.tar.gz: e10c9c16c1cb030ee4db01e316a519dd179baa91d530663cebc6bec8257e392734129eba9e5bee15ce27aa51922e4d6af95cf74cb30a1aa87e045910d67cf225
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ List of available attributes and defaults can be found in [lib/meta_request/conf
|
|
37
37
|
|
38
38
|
## Docker
|
39
39
|
|
40
|
-
Apps
|
40
|
+
Apps running in Docker container will have filepaths of the container so links to editor would not work. To fix this, you need to propagate working directory through environment variable `SOURCE_PATH`. With docker-compose it can be done like this:
|
41
41
|
|
42
42
|
```yaml
|
43
43
|
services:
|
data/lib/meta_request/event.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'active_support'
|
4
|
+
require 'active_support/cache'
|
4
5
|
require 'active_support/json'
|
5
6
|
require 'active_support/core_ext'
|
6
7
|
|
@@ -13,6 +14,7 @@ module MetaRequest
|
|
13
14
|
attr_reader :duration
|
14
15
|
|
15
16
|
def initialize(name, start, ending, transaction_id, payload)
|
17
|
+
@name = name
|
16
18
|
super(name, start, ending, transaction_id, json_encodable(payload))
|
17
19
|
@duration = 1000.0 * (ending - start)
|
18
20
|
end
|
@@ -37,7 +39,7 @@ module MetaRequest
|
|
37
39
|
def json_encodable(payload)
|
38
40
|
return {} unless payload.is_a?(Hash)
|
39
41
|
|
40
|
-
transform_hash(payload, deep: true) do |hash, key, value|
|
42
|
+
transform_hash(sanitize_hash(payload), deep: true) do |hash, key, value|
|
41
43
|
if value.class.to_s == 'ActionDispatch::Http::Headers'
|
42
44
|
value = value.to_h.select { |k, _| k.upcase == k }
|
43
45
|
elsif not_encodable?(value)
|
@@ -54,6 +56,14 @@ module MetaRequest
|
|
54
56
|
end.with_indifferent_access
|
55
57
|
end
|
56
58
|
|
59
|
+
def sanitize_hash(payload)
|
60
|
+
if @name =~ /\Acache_\w+\.active_support\z/
|
61
|
+
payload[:key] = ActiveSupport::Cache::Store.new.send(:normalize_key, payload[:key])
|
62
|
+
end
|
63
|
+
|
64
|
+
payload
|
65
|
+
end
|
66
|
+
|
57
67
|
def not_encodable?(value)
|
58
68
|
(defined?(ActiveRecord) && value.is_a?(ActiveRecord::ConnectionAdapters::AbstractAdapter)) ||
|
59
69
|
(defined?(ActionDispatch) &&
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dejan Simic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack-contrib
|
@@ -37,7 +37,7 @@ dependencies:
|
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: 3.0.0
|
40
|
-
- - "
|
40
|
+
- - "<="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '7.1'
|
43
43
|
type: :runtime
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 3.0.0
|
50
|
-
- - "
|
50
|
+
- - "<="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '7.1'
|
53
53
|
- !ruby/object:Gem::Dependency
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.3.
|
121
|
+
rubygems_version: 3.3.5
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Request your Rails request
|