rails_error_dashboard 0.5.5 → 0.5.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0061cfa9a544478cab75e78d0b785f3f2fbc319d46cdfe0080d6c2d135499bad
4
- data.tar.gz: e4fedd33e1db8813bc25eda9f842a02866c1b195706e519e3ab6e93a6e4fc9cd
3
+ metadata.gz: 1082f04d59310d3ee29619e7a1380df6d815a67a87de41d77e184b20291c1426
4
+ data.tar.gz: 31429aa4cdaaad3ff9a7890fd40261ffd6c3b5414172db33df28cb8063264e23
5
5
  SHA512:
6
- metadata.gz: 48a726a07f35cf8b7d1f390aa0da7d2e0741a949d4a963da133606b89795d954d7e85f02f08ced7512b6569ab0f40cf0507988b64d840f4f8366f861f4650601
7
- data.tar.gz: 825b1d89ff00f82c270568381740f0798c6d2158cf726883ed12eda5f1e87f8cba2c1dfa91037bcd2f8054b5434129d3957cb6d2f9a0ed1207a9b87f461c7db4
6
+ metadata.gz: 4cf8ec345cbf28bcb13fd22b14d13120f689563ca51db774d78008138fd5b854e3ccb85e98edf992955fd1590e47d3f456a62891e4669d44e6e0f4c56a808967
7
+ data.tar.gz: 2cb2e5fe8d7231363687e0d161fe0ae4333f922894dc481a416a1f7561c560538363cbfa3ebbf18bbf0de4dd34e8769e6d74e32dfdbd3d71a9120840b7e29502
@@ -32,7 +32,7 @@
32
32
  <button type="button" class="btn btn-outline-secondary" onclick="downloadErrorJSON(event)" title="Download error details as JSON">
33
33
  <i class="bi bi-download"></i> Export JSON
34
34
  </button>
35
- <button type="button" class="btn btn-outline-secondary" onclick="copyToClipboard(this.dataset.markdown, this)" data-markdown="<%= j @error_markdown %>" title="Copy error details as Markdown for LLM debugging">
35
+ <button type="button" class="btn btn-outline-secondary" onclick="copyToClipboard(this.dataset.markdown.replace(/\\n/g, '\n'), this)" data-markdown="<%= j @error_markdown %>" title="Copy error details as Markdown for LLM debugging">
36
36
  <i class="bi bi-clipboard"></i> Copy for LLM
37
37
  </button>
38
38
  <% if @error.respond_to?(:muted?) && @error.muted? %>
@@ -112,7 +112,10 @@ module RailsErrorDashboard
112
112
  return nil if vars.empty? && self_class.nil?
113
113
 
114
114
  lines = []
115
- lines << "**Class:** #{self_class}" if self_class
115
+ if self_class
116
+ class_name = self_class.is_a?(Hash) ? self_class["value"] : self_class
117
+ lines << "**Class:** #{class_name}"
118
+ end
116
119
 
117
120
  if vars.any?
118
121
  rows = vars.first(MAX_VARIABLES).map { |name, info|
@@ -215,8 +218,14 @@ module RailsErrorDashboard
215
218
  return nil if @related_errors.nil? || @related_errors.empty?
216
219
 
217
220
  items = @related_errors.map { |r|
218
- pct = (r.similarity * 100).round(1)
219
- "- `#{r.error.error_type}` #{r.error.message} (#{pct}% similar, #{r.error.occurrence_count} occurrences)"
221
+ # related_errors can be plain ErrorLog objects or wrapped objects with .error/.similarity
222
+ error = r.respond_to?(:error) ? r.error : r
223
+ if r.respond_to?(:similarity)
224
+ pct = (r.similarity * 100).round(1)
225
+ "- `#{error.error_type}` — #{error.message} (#{pct}% similar, #{error.occurrence_count} occurrences)"
226
+ else
227
+ "- `#{error.error_type}` — #{error.message} (#{error.occurrence_count} occurrences)"
228
+ end
220
229
  }
221
230
 
222
231
  "## Related Errors\n\n#{items.join("\n")}"
@@ -1,3 +1,3 @@
1
1
  module RailsErrorDashboard
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_error_dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anjan Jagirdar
@@ -467,7 +467,7 @@ metadata:
467
467
  bug_tracker_uri: https://github.com/AnjanJ/rails_error_dashboard/issues
468
468
  funding_uri: https://buymeacoffee.com/anjanj
469
469
  post_install_message: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n
470
- \ Rails Error Dashboard v0.5.5\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n\U0001F195
470
+ \ Rails Error Dashboard v0.5.6\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n\U0001F195
471
471
  First time? Quick start:\n rails generate rails_error_dashboard:install\n rails
472
472
  db:migrate\n # Add to config/routes.rb:\n mount RailsErrorDashboard::Engine
473
473
  => '/error_dashboard'\n\n\U0001F504 Upgrading from v0.1.x?\n rails db:migrate\n