rails_error_notifier 0.1.7 β†’ 0.1.9

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: a2e9a92685889c30e605475888fedfdaaf88a7aaeb355f4772bc1ad0b9e9d15d
4
- data.tar.gz: ae35b2960624b632112b952f7cd83ddfde832a37e4a45c7cda916f4410aa638c
3
+ metadata.gz: 32960eae043f00db67000231f1e5cb111186743d27b4b9b0caed38d305de8eae
4
+ data.tar.gz: 9da8720b8d0ecbc570f7c2c0ad9aa1b7b91cffec7598d2d96f16878f3eaf2841
5
5
  SHA512:
6
- metadata.gz: 0f766dc27bd84e8ea88710604c5bdaf81c9712dc96b8c6c16cf65f153b81f540655b90835c5951753e4718a8b0e35ac387d4d090a6a04ee0a42388bdc4b28483
7
- data.tar.gz: 16b02967e3e47f8a84eb53e11964f92f7a673152850d566d3342d085d629218ffa909efa1137e976fcfa146817022f45080206abd387d00d5c29364c3cacaf2e
6
+ metadata.gz: b5e38f66078e94a1eb201bebab1357b94437db862a2b2da14aaa1cc71b087260d9a285edaf2077f23cf34a7ad0504eb27ae6fb28a19acea594b7eb52ff75e121
7
+ data.tar.gz: feeb7733a506af81b3a18ce724b432fd3cd4530701a52c710589d066c12e77fd55c3763a550682e6cea3d50d359146003891c5fe63376e34f1e375b59e0b3833
data/README.md CHANGED
@@ -1,13 +1,12 @@
1
1
  # 🚨 RailsErrorNotifier
2
2
 
3
- RailsErrorNotifier is a Ruby gem that automatically captures and notifies about errors in your Rails applications.
4
- It integrates with **Slack** and **Discord** out of the box, so you never miss a critical error in production.
5
-
3
+ RailsErrorNotifier is a Ruby gem that automatically captures errors in your Rails applications and sends notifications to your preferred channels.
4
+ It supports **Slack**, **Discord**, **Email**, and **WhatsApp**, ensuring you’re immediately informed about critical issues in production.
6
5
  ---
7
6
 
8
7
  ## ✨ Features
9
8
  - πŸ”₯ Capture unhandled exceptions in Rails automatically via Rack middleware.
10
- - πŸ“© Send error notifications to **Slack** and **Discord**.
9
+ - πŸ“© Send error notifications to Slack, Discord, Email, and WhatsApp.
11
10
  - βš™οΈ Easy configuration through Rails initializers.
12
11
  - πŸ“ Add custom context (e.g., current user, request path).
13
12
  - πŸ›‘οΈ Safe when disabled (no crashes if webhooks are missing).
@@ -50,11 +49,21 @@ This creates `config/initializers/rails_error_notifier.rb`:
50
49
  # frozen_string_literal: true
51
50
 
52
51
  RailsErrorNotifier.configure do |config|
53
- # Configure your Slack and Discord webhooks via ENV variables
52
+ # Slack + Discord
54
53
  config.slack_webhook = ENV["SLACK_WEBHOOK_URL"]
55
54
  config.discord_webhook = ENV["DISCORD_WEBHOOK_URL"]
56
55
 
57
- # Optional: disable in development/test
56
+ # Email
57
+ config.error_email_to = ENV["ERROR_EMAIL_TO"] # e.g. "dev-team@example.com"
58
+ config.error_email_from = ENV["ERROR_EMAIL_FROM"] # e.g. "notifier@example.com"
59
+
60
+ # WhatsApp (Twilio)
61
+ config.twilio_sid = ENV["TWILIO_SID"]
62
+ config.twilio_token = ENV["TWILIO_TOKEN"]
63
+ config.twilio_from = ENV["TWILIO_FROM"]
64
+ config.twilio_to = ENV["TWILIO_TO"]
65
+
66
+ # Enable only in non-dev/test environments
58
67
  config.enabled = !Rails.env.development? && !Rails.env.test?
59
68
  end
60
69
  ```
@@ -18,10 +18,11 @@ module RailsErrorNotifier
18
18
 
19
19
  def deliver
20
20
  return unless RailsErrorNotifier.configuration&.enabled
21
+ app_trace = (exception.backtrace || []).select { |line| line.include?("/app/") }
21
22
 
22
23
  payload = {
23
24
  error: exception.message,
24
- backtrace: exception.backtrace || ["No backtrace"],
25
+ backtrace: app_trace.presence || exception.backtrace || ["No backtrace"],
25
26
  context: context || {}
26
27
  }
27
28
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsErrorNotifier
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_error_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - mrmalvi
@@ -13,16 +13,22 @@ dependencies:
13
13
  name: twilio-ruby
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
18
  version: '6.6'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '8.0'
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
- - - "~>"
26
+ - - ">="
24
27
  - !ruby/object:Gem::Version
25
28
  version: '6.6'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '8.0'
26
32
  description: A gem to send Rails exceptions to Slack and Discord
27
33
  email:
28
34
  - malviyak00@gmail.com
@@ -63,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
69
  requirements:
64
70
  - - ">="
65
71
  - !ruby/object:Gem::Version
66
- version: 2.5.0
72
+ version: 2.0.0
67
73
  required_rubygems_version: !ruby/object:Gem::Requirement
68
74
  requirements:
69
75
  - - ">="
@@ -72,5 +78,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
78
  requirements: []
73
79
  rubygems_version: 3.6.9
74
80
  specification_version: 4
75
- summary: Notify Rails errors to Slack and Discord
81
+ summary: Notify Rails errors to Slack and Discord, Email, WhatsApp
76
82
  test_files: []