meta_request 0.7.4 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/meta_request/event.rb +11 -1
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e49088dd0f59edb460bd290208da99950c27d80b53a89ec118eff7e92456081
4
- data.tar.gz: 176cf5c3b6acc39a80c962e3e1bc6d2d2a7bbce8c492bd5055bcb18d592fc1a5
3
+ metadata.gz: 5dd75bc4f5710d89b2ee41d7fd9be191aab640b74a28ca5456b197842a44a270
4
+ data.tar.gz: c14b48d129d46390f8c1b08a700f9cc45b5d7e5c4046ceba373733d9e64d9d85
5
5
  SHA512:
6
- metadata.gz: 8c91cd99b7cbf908d8aa04fd2781296be408921eb4ea1b4504fa10a586fa216f55f68798bd2f6304ab0e5be3a1300c00347adcc3add55ffb15285298b2db3e5f
7
- data.tar.gz: 6ef328ed871cc4705fece9ffc7ab0642a8763b40d24848ecedc9e7754a5636164484be069d6655596a1be7be2a8b94fab28fab5916645a577bdb148ca736df0a
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 runing 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 enviroment variable `SOURCE_PATH`. With docker-compose it can be done like this:
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:
@@ -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.7.4
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: 2023-03-08 00:00:00.000000000 Z
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.7
121
+ rubygems_version: 3.3.5
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Request your Rails request