debugbar 0.3.1 → 0.3.2
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/CHANGELOG.md +6 -0
- data/lib/debugbar/request.rb +2 -2
- data/lib/debugbar/subscribers/active_record.rb +3 -2
- data/lib/debugbar/version.rb +1 -1
- data/lib/debugbar.rb +5 -4
- data/public/debugbar.js +16 -16
- 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: 5fb345ca3b935b2a6baee536310271a5cda8e15132e7a79413fb661e44c0dbef
|
4
|
+
data.tar.gz: 292867bd66a2a1e7348fca7451ef85e2bd756d187cefff23065c349fd90186f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f0b963c955ca99ff48e9a281a43d3de900b552ed4b16de947529e106c00b5f65ff4cca955b62a521be56a9e1668ce9e6081ce364e57a8137a4dd466dfe087d2
|
7
|
+
data.tar.gz: 609c0a2137bf2f0517e362cbe8771ac4c7f4fef211b200c51621b7af2555a67b71e76967b1c45bf59c3c6c8639b6f255d13cfff341cbb048e83d885d7a8cecca
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.3.2 - 2024-05-04
|
4
|
+
|
5
|
+
* Improved Debug panel (to be in par with Queries panel) - See [#36](https://github.com/julienbourdeau/debugbar/pull/36)
|
6
|
+
* Better SQL dialect detection - See [c40e2405](https://github.com/julienbourdeau/debugbar/commit/c40e240524308c7ecf09fecbb548e97c2ef4e8b7)
|
7
|
+
* Add timings to SQL queries 🎨 - See [ebf8edcd](https://github.com/julienbourdeau/debugbar/commit/ebf8edcd8598a4a7b490a774a7374d51a3efc6b8)
|
8
|
+
|
3
9
|
## v0.3.1 - 2024-05-01
|
4
10
|
|
5
11
|
* Add `active_record.adapter` config to help frontend format SQL queries - See [#35](https://github.com/julienbourdeau/debugbar/pull/35)
|
data/lib/debugbar/request.rb
CHANGED
@@ -40,8 +40,8 @@ module Debugbar
|
|
40
40
|
@jobs << job
|
41
41
|
end
|
42
42
|
|
43
|
-
def add_msg(msg, extra)
|
44
|
-
@messages << {msg: msg, extra: extra}
|
43
|
+
def add_msg(msg, extra, source)
|
44
|
+
@messages << {id: SecureRandom.hex(8), msg: msg, extra: extra, source: source}
|
45
45
|
end
|
46
46
|
|
47
47
|
def add_cache(c)
|
@@ -36,12 +36,13 @@ module Debugbar
|
|
36
36
|
duration: event.duration.round(1),
|
37
37
|
lock_wait: payload[:lock_wait]&.round(1),
|
38
38
|
binds: binds,
|
39
|
-
source: query_source_location
|
39
|
+
source: query_source_location
|
40
40
|
})
|
41
41
|
end
|
42
42
|
|
43
43
|
def query_source_location
|
44
|
-
backtrace_cleaner.clean(caller(3))[0]
|
44
|
+
str = backtrace_cleaner.clean(caller(3))[0]
|
45
|
+
str&.split(":in")&.map { |s| s.delete_prefix("#{Rails.root}/").strip.tr("`'", '' ) } # Duplicated in Debugbar.msg
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
data/lib/debugbar/version.rb
CHANGED
data/lib/debugbar.rb
CHANGED
@@ -47,12 +47,12 @@ module Debugbar
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
def msg(msg,
|
50
|
+
def msg(msg, extra, source)
|
51
51
|
if Current.request.nil?
|
52
52
|
puts "The current request is not set yet. Printing to STDOUT instead."
|
53
|
-
puts msg, extra
|
53
|
+
puts msg, extra, source
|
54
54
|
else
|
55
|
-
Current.request.add_msg(msg, extra)
|
55
|
+
Current.request.add_msg(msg, extra, source)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -82,7 +82,8 @@ module Debugbar
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def msg(msg, *extra)
|
85
|
-
|
85
|
+
source = caller.first&.split(":in")&.map { |s| s.delete_prefix("#{Rails.root}/").strip.tr("`'", '' ) }
|
86
|
+
Tracker.msg(msg, extra, source)
|
86
87
|
end
|
87
88
|
end
|
88
89
|
end
|