debugbar 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/routes.rb +1 -2
- data/debugbar.gemspec +4 -2
- data/lib/debugbar/engine.rb +1 -0
- data/lib/debugbar/subscribers/active_record.rb +21 -0
- data/lib/debugbar/version.rb +1 -1
- data/public/debugbar.js +34 -0
- metadata +3 -3
- data/.prettierrc +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 389fcb115afbb56d83be8f40f60985a527c81f8d0df6aa7209720dc2413fd10b
|
4
|
+
data.tar.gz: f002929f37f5821f9b663c450b3ffc487cb3892f8f94ab2b1a720987b0d4514d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0719ab3ca71da9bc48786a19108b3828e15d70230d2d1022d9d135586cb95043ced489c59bd264cb513cac6dabd9190bc4a7bedbac67ebd533a63668473efa55'
|
7
|
+
data.tar.gz: 6940165a13db4afe19416945c90b98ec7b33686b04163cd1ce99f7c7a575c8084d135d673707ede5b8b6c62615cc66e137484d2ab6b5d7fbab7dac6172eedc1d
|
data/config/routes.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
Debugbar::Engine.routes.draw do
|
2
2
|
mount ActionCable.server => '/cable'
|
3
3
|
|
4
|
-
# TODO: Silence logs for
|
5
|
-
get 'assets/style' => "assets#css", format: :css
|
4
|
+
# TODO: Silence logs for this route if `::Rails.application.config.assets.quiet` is true
|
6
5
|
get 'assets/script' => "assets#js"
|
7
6
|
end
|
data/debugbar.gemspec
CHANGED
@@ -23,14 +23,16 @@ Gem::Specification.new do |spec|
|
|
23
23
|
files_to_remove = %w[
|
24
24
|
bin/ test/ spec/ features/ fixtures/
|
25
25
|
client/
|
26
|
-
.git .circleci appveyor Gemfile package.json package-lock.json
|
26
|
+
.git .circleci appveyor Gemfile package.json package-lock.json .prettierrc
|
27
27
|
]
|
28
|
+
|
28
29
|
spec.files = Dir.chdir(__dir__) do
|
29
30
|
`git ls-files -z`.split("\x0").reject do |f|
|
30
31
|
(File.expand_path(f) == __FILE__) ||
|
31
32
|
f.start_with?(*files_to_remove)
|
32
33
|
end
|
33
|
-
end
|
34
|
+
end.push("public/debugbar.js")
|
35
|
+
|
34
36
|
spec.bindir = "exe"
|
35
37
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
36
38
|
spec.require_paths = ["lib"]
|
data/lib/debugbar/engine.rb
CHANGED
@@ -60,6 +60,27 @@ module Debugbar
|
|
60
60
|
def query_source_location
|
61
61
|
backtrace_cleaner.clean(caller(3))[0]
|
62
62
|
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def type_casted_binds(casted_binds)
|
67
|
+
casted_binds.respond_to?(:call) ? casted_binds.call : casted_binds
|
68
|
+
end
|
69
|
+
|
70
|
+
def render_bind(attr, value)
|
71
|
+
case attr
|
72
|
+
when ActiveModel::Attribute
|
73
|
+
if attr.type.binary? && attr.value
|
74
|
+
value = "<#{attr.value_for_database.to_s.bytesize} bytes of binary data>"
|
75
|
+
end
|
76
|
+
when Array
|
77
|
+
attr = attr.first
|
78
|
+
else
|
79
|
+
attr = nil
|
80
|
+
end
|
81
|
+
|
82
|
+
[attr&.name, value]
|
83
|
+
end
|
63
84
|
end
|
64
85
|
end
|
65
86
|
end
|
data/lib/debugbar/version.rb
CHANGED