activeerror 1.0.0 → 1.0.2

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: 7152e2ef6d0ce997ab2c1ac6ad20301641bc3888da16d14d8ba447f0f25bbe42
4
- data.tar.gz: c75638bb627a0bc6250e3eb7fd2c0041dda4eb7b1ac6849de0d2bda07cd7663d
3
+ metadata.gz: '0361451420586e3b0f513a752050dde415be2ff3c3ae29d4390464a5f74bc4c6'
4
+ data.tar.gz: 9a517382f5a127069db4442fe8f80d8483998fcfebaf2f129ea90cbd60e7447e
5
5
  SHA512:
6
- metadata.gz: 2576054be5ff1b83af55777b9135a991e6fe05a845c1197d55aad43b79676fb830a09712be37c0d7591f1eb7f5e36b09af7ad8c71cf3a129f32a9d985dd3fb5d
7
- data.tar.gz: 81ff00bc1f0e4e0fbe9230ec37e0fb72b1bc960375f9c64c9c6348fff2ec6ca2d8f98b237dec00b9e02fadbd4a7eee9b3427d2aea486f5c747ed06b479df0f9c
6
+ metadata.gz: 016eeaffff9029b47edccca17c7b8253f89fe0000e9379a8cda78c1890a0cef4a258e5638afc2483ac84a4cbb34c1d149cd78a593431fb899905bb1371a2b20a
7
+ data.tar.gz: 561141dea1cf586aca5d63803a2119c0de23b5423cb6a329a30d1e2d710cb825bbcb0d355ce746242a6a3826939ff136e354c5cd9a09d69bd3d088ced7701c01
data/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  One of the fundemental tools needed to take your Rails app to production is a
4
4
  way to track errors that are triggered. Unfortunately, theres no free, easy,
5
- open source way to track them for small or medium apps. Honeybadger and Sentry are great,
6
- but they are only free for a single user and are closed source. With Sentry
5
+ open source way to track them for small or medium apps. Honeybadger, Sentry,
6
+ and AppSignal are great, but they are are closed source. With Sentry
7
7
  looking at using your data as training
8
8
  data([link](https://blog.sentry.io/ai-privacy-and-terms-of-service-updates/?original_referrer=https%3A%2F%2Fsentry.io%2F))
9
9
  there should be an easy open source alternative where you control the data.
@@ -16,7 +16,7 @@ with is the one baked into Rails that we use everyday in development. So with
16
16
  ActiveError, when an error gets raised it's captured and stored in the
17
17
  database (we attempt to group the same error together as Instances to reduce
18
18
  noise) and then we recreate the error and display it using the built in debug
19
- view from Rails. Once you've resolved the error you can click "Resolve" with
19
+ view from Rails. Once you've resolved the error you can click "Resolve" which
20
20
  will destroy the record.
21
21
 
22
22
  ![screenshot 1](https://github.com/npezza93/active_error/blob/main/.github/screenshot1.png)
@@ -13,15 +13,11 @@ module ActiveError
13
13
  yaml: { unsafe_load: true }
14
14
 
15
15
  serialize :backtrace, type: Array, coder: YAML
16
- serialize :backtrace_locations, type: Array, coder: YAML,
16
+ serialize :backtrace_locations, type: Array, coder: YAML,
17
17
  yaml: { unsafe_load: true }
18
18
  serialize :blamed_files, type: Array, coder: YAML
19
19
 
20
- scope :top_level, lambda {
21
- left_joins(:parent_cause).where(
22
- parent_causes_active_error_faults: { id: nil }
23
- )
24
- }
20
+ scope :top_level, -> { where.missing(:parent_cause) }
25
21
 
26
22
  def exception
27
23
  ExceptionMock.make(fault: self)
@@ -25,7 +25,7 @@ module ActiveError
25
25
 
26
26
  attr_reader :exception, :request, :capture_instance
27
27
 
28
- delegate :parameters, to: :request
28
+ delegate :parameters, to: :request, allow_nil: true
29
29
 
30
30
  def fault
31
31
  @fault ||= Fault.default_scoped.find_or_create_by(fault_attrs) do |fault|
@@ -38,7 +38,8 @@ module ActiveError
38
38
 
39
39
  def fault_attrs
40
40
  { backtrace: exception.backtrace, klass: exception.class.to_s,
41
- controller: parameters[:controller], action: parameters[:action] }
41
+ controller: parameters.to_h[:controller],
42
+ action: parameters.to_h[:action] }
42
43
  end
43
44
 
44
45
  def template?
@@ -69,10 +70,10 @@ module ActiveError
69
70
  end
70
71
 
71
72
  def create_instance
72
- headers = request.env.
73
+ headers = request&.env.to_h.
73
74
  slice(*ActionDispatch::Request::ENV_METHODS, "HTTP_USER_AGENT")
74
75
 
75
- fault.instances.create(headers:, parameters: request.filtered_parameters,
76
+ fault.instances.create(headers:, parameters: request&.filtered_parameters,
76
77
  url: request.url)
77
78
  end
78
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveError
4
- VERSION = Gem::Version.new("1.0.0")
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeerror
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pezza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -70,7 +70,7 @@ files:
70
70
  - lib/active_error/version.rb
71
71
  - lib/activeerror.rb
72
72
  - lib/generators/active_error/install/install_generator.rb
73
- homepage: https://github.com/npezza93/active_error
73
+ homepage: https://github.com/npezza93/activeerror
74
74
  licenses:
75
75
  - MIT
76
76
  metadata: