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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5380fa3760a1309aacd1404c077e3e6c78ed94d21bde373eb0f96f90da96abe6
4
- data.tar.gz: 7e9f86653a25e202c9ebf4c64b8d74f5816aaadbee1f2e2d75b46423fa17a8dd
3
+ metadata.gz: 389fcb115afbb56d83be8f40f60985a527c81f8d0df6aa7209720dc2413fd10b
4
+ data.tar.gz: f002929f37f5821f9b663c450b3ffc487cb3892f8f94ab2b1a720987b0d4514d
5
5
  SHA512:
6
- metadata.gz: '08f084f414d3520d4f7f287b3ffcde2a1a322b7bc04492bcf80ca0087b7fe1a853db6dac041bafceaa352944d8c09ed8d12ecf47bfa30cbc03643f29e2573179'
7
- data.tar.gz: 2836203deb352f9d344d8784423b801d6ca6ff26e7e48adaec4ea58b142434999ef145f32207de68ba80cf499dba137e8f41d507d97bb9f025d84084a205ac65
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 these routes if `::Rails.application.config.assets.quiet` is true
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"]
@@ -1,5 +1,6 @@
1
1
  require_relative 'config'
2
2
  require_relative 'middlewares/track_current_request'
3
+ require_relative '../../app/helpers/debugbar/tag_helpers'
3
4
 
4
5
  module Debugbar
5
6
  class Engine < ::Rails::Engine
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Debugbar
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end