rails_error_dashboard 0.5.4 → 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: a667556dd047d556656652733779799a3c2a3a25518522f5df752b3fff8876da
4
- data.tar.gz: 7ab3bff750ee2f22c92a0c4c1c1960c1d0b935a2e8321fb7f5565557c482a9f7
3
+ metadata.gz: 1082f04d59310d3ee29619e7a1380df6d815a67a87de41d77e184b20291c1426
4
+ data.tar.gz: 31429aa4cdaaad3ff9a7890fd40261ffd6c3b5414172db33df28cb8063264e23
5
5
  SHA512:
6
- metadata.gz: 91d35b021963403f6fc8c61789adf6419d4004616fa1c1f2fb2af4da03dae4e8eb23531211fd47152ef62eb646c8c131826fb650537bf22171577cea366a3293
7
- data.tar.gz: aebd611c94d19491dda696755a6b2e12e7d7be50882518f6880b9223a9b8c7f7d870ce6dde97d6ee87255b8e4de0f1aa34b5d4d4e32d0e97de72f7e704f9badb
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? %>
@@ -539,10 +539,17 @@ module RailsErrorDashboard
539
539
 
540
540
  # Check if using default or blank demo credentials with basic auth
541
541
  #
542
- # @return [Boolean] true if basic auth is active with default gandalf/youshallnotpass or blank credentials
542
+ # Returns false if the user explicitly set ENV vars (even to the same default values),
543
+ # because that's a deliberate choice. Only blocks when credentials are untouched defaults
544
+ # or blank.
545
+ #
546
+ # @return [Boolean] true if basic auth is active with untouched default or blank credentials
543
547
  def default_credentials?
544
548
  return false unless authenticate_with.nil?
545
549
 
550
+ # If user explicitly set ENV vars, respect their choice
551
+ return false if ENV.key?("ERROR_DASHBOARD_USER") || ENV.key?("ERROR_DASHBOARD_PASSWORD")
552
+
546
553
  default = dashboard_username == "gandalf" && dashboard_password == "youshallnotpass"
547
554
  blank = dashboard_username.to_s.strip.empty? || dashboard_password.to_s.strip.empty?
548
555
 
@@ -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.4"
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.4
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.4\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