rails_spotlight 0.3.5 → 0.3.7
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/lib/rails_spotlight/configuration.rb +2 -1
- data/lib/rails_spotlight/event.rb +5 -4
- data/lib/rails_spotlight/middlewares/concerns/skip_request_paths.rb +1 -1
- data/lib/rails_spotlight/middlewares/handlers/sql_action_handler.rb +1 -1
- data/lib/rails_spotlight/middlewares/header_marker.rb +1 -1
- data/lib/rails_spotlight/version.rb +1 -1
- data/lib/tasks/init.rake +7 -4
- 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: efdd8f359ad7c5595ebfba64a41d2c64aafd8e3e717c5ada9493966904ca87d4
|
4
|
+
data.tar.gz: 1d48a210e44ae24f6b396ae4fa7472d1e22684c8ce9b32a42fa81691766608a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01c5512c7a93794a8b145e6bacb7d6c401a39e72edbad9ef9bd0a0f2e0d04041edbe3fb8d38e43c0790d80aaebc3dd7dcee0753d7598ee8371131b20401a012b
|
7
|
+
data.tar.gz: 5767e5660c23614263ab9ee19fadbeca5d7302795a8c7d40df4c7d404dfbfb2f8973e00cd07d725b22742c2f0f3c36fae7c62bd34184f274353eb1c80f7fb85f
|
@@ -10,7 +10,8 @@ module RailsSpotlight
|
|
10
10
|
'ActiveRecord::ConnectionAdapters::AbstractAdapter',
|
11
11
|
'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter',
|
12
12
|
'ActiveRecord::ConnectionAdapters::RealTransaction',
|
13
|
-
'ActiveRecord::SchemaMigration'
|
13
|
+
'ActiveRecord::SchemaMigration',
|
14
|
+
'ActiveRecord::Transaction'
|
14
15
|
],
|
15
16
|
'ActionDispatch' => ['ActionDispatch::Request', 'ActionDispatch::Response']
|
16
17
|
}.freeze
|
@@ -38,9 +38,10 @@ module RailsSpotlight
|
|
38
38
|
return {} unless payload.is_a?(Hash)
|
39
39
|
|
40
40
|
transform_hash(payload, deep: true) do |hash, key, value|
|
41
|
-
|
41
|
+
value_class = value.class.to_s
|
42
|
+
if value_class == 'ActionDispatch::Http::Headers'
|
42
43
|
value = value.to_h.select { |k, _| k.upcase == k }
|
43
|
-
elsif not_encodable?(value)
|
44
|
+
elsif value_class == 'SystemStackError' || not_encodable?(value)
|
44
45
|
value = NOT_JSON_ENCODABLE
|
45
46
|
end
|
46
47
|
|
@@ -59,8 +60,8 @@ module RailsSpotlight
|
|
59
60
|
next unless defined?(module_name.constantize)
|
60
61
|
|
61
62
|
class_names.any? { |class_name| value.is_a?(class_name.constantize) }
|
62
|
-
rescue
|
63
|
-
|
63
|
+
rescue # rubocop:disable Lint/RescueException, Lint/RedundantCopDisableDirective, Style/RescueStandardError
|
64
|
+
true
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
@@ -20,7 +20,7 @@ module RailsSpotlight
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def skip_paths
|
23
|
-
additional_skip_paths + default_skip_paths + ::RailsSpotlight.config.middleware_skipped_paths
|
23
|
+
@skip_paths ||= (additional_skip_paths + default_skip_paths + ::RailsSpotlight.config.middleware_skipped_paths).uniq
|
24
24
|
end
|
25
25
|
|
26
26
|
def asset?(path)
|
@@ -54,7 +54,7 @@ module RailsSpotlight
|
|
54
54
|
|
55
55
|
def logger(_, started, finished, unique_id, payload)
|
56
56
|
logs << { time: started, end: finished, unique_id: unique_id }.merge(
|
57
|
-
payload.as_json(except: %i[connection method name filename line])
|
57
|
+
payload.as_json(except: %i[connection method name filename line transaction])
|
58
58
|
)
|
59
59
|
end
|
60
60
|
|
data/lib/tasks/init.rake
CHANGED
@@ -16,24 +16,27 @@ namespace :rails_spotlight do # rubocop:disable Metrics/BlockLength
|
|
16
16
|
STORAGE_PATH: <%=Rails.root.join('tmp', 'data', 'rails_spotlight')%>
|
17
17
|
STORAGE_POOL_SIZE: 20
|
18
18
|
LOGGER: <%=Logger.new(Rails.root.join('log', 'rails_spotlight.log'))%>
|
19
|
+
# Prevent from processing and sending some data to the extension
|
19
20
|
MIDDLEWARE_SKIPPED_PATHS: []
|
20
21
|
NOT_ENCODABLE_EVENT_VALUES:
|
21
22
|
SKIP_RENDERED_IVARS: []
|
23
|
+
# File manager configuration
|
22
24
|
BLOCK_EDITING_FILES: false
|
23
25
|
BLOCK_EDITING_FILES_OUTSIDE_OF_THE_PROJECT: true
|
24
26
|
DIRECTORY_INDEX_IGNORE: ['/.git', '**/*.lock', '**/.DS_Store', '/app/assets/images/**', '/app/assets/fonts/**', '/app/assets/builds/**']
|
25
27
|
RUBOCOP_CONFIG_PATH: '.rubocop.yml'
|
28
|
+
# Workarounds of CSP restrictions for form JS execution from the extension
|
29
|
+
FORM_JS_EXECUTION_TOKEN: <%= Digest::MD5.hexdigest(Rails.application.class.respond_to?(:module_parent_name) ? Rails.application.class.module_parent_name : Rails.application.class.parent_name)%>
|
26
30
|
# Rest of the configuration is required for ActionCable. It will be disabled automatically in when ActionCable is not available.
|
27
31
|
AUTO_MOUNT_ACTION_CABLE: false
|
28
32
|
ACTION_CABLE_MOUNT_PATH: /cable
|
29
33
|
# Required for all action cable features
|
30
34
|
USE_ACTION_CABLE: false
|
31
|
-
LIVE_CONSOLE_ENABLED: false
|
32
35
|
# Experimental feature.
|
33
|
-
REQUEST_COMPLETED_BROADCAST_ENABLED: false
|
34
36
|
LIVE_LOGS_ENABLED: false
|
35
37
|
DEFAULT_RS_SRC: default
|
36
|
-
|
38
|
+
LIVE_CONSOLE_ENABLED: false
|
39
|
+
REQUEST_COMPLETED_BROADCAST_ENABLED: false
|
37
40
|
YAML
|
38
41
|
|
39
42
|
if File.exist?(config_path)
|
@@ -48,7 +51,7 @@ namespace :rails_spotlight do # rubocop:disable Metrics/BlockLength
|
|
48
51
|
desc 'Generate rails_spotlight JavaScript ERB partial for application layout to allow injecting JS code from the extension'
|
49
52
|
task inject_js_partial: :environment do # rubocop:disable Metrics/BlockLength
|
50
53
|
# Define the partial name and path
|
51
|
-
partial_name = '
|
54
|
+
partial_name = 'rails_spotlight_extension_js.html.erb'
|
52
55
|
partial_path = "app/views/layouts/#{partial_name}"
|
53
56
|
|
54
57
|
# Define the JavaScript code
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_spotlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pawel Niemczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack-contrib
|