action_reporter 1.4.0 → 1.4.1

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: 14d5c87c8d8a4b89f4f0e18f67588d41b01d56e3fecc4ee3bcf40f634c08e9d9
4
- data.tar.gz: 0d49b5255bad01955454477adc0166d077e403976823e75659ed996a9843123a
3
+ metadata.gz: fd1a58fef3515e786a32bfea51175eb11f081f09773fe6476de0868ca01fa76c
4
+ data.tar.gz: 4b3953a48e8e34fecbf48ce7068836b228aec8d52f83ef8926667b74e679f4eb
5
5
  SHA512:
6
- metadata.gz: 49dac3148afba57f4f7ebaf7e17ef2ca57cf4ea9d1f14a5ad5e748bbad3d143c2e2be28f99990295a66d307d4cb9c7dbb36a71a9a163701b825402bd3eebfd2e
7
- data.tar.gz: 5e66cdd226d395f552c56b9616fba0357a7695225f431dfbf5f3b4d302cfac58f68017720839b3911b190415fff55e319b761c82c718399d67926cd8b2b936e2
6
+ metadata.gz: f9e273e313f21642a7dcc6517c4b38f977a30e41c50928c0b936ded0ac88fc76bbd031e0f9a8f5c3c7bdf9b87991c0e51d5e9af3e3c85b9c7baae8f01e09584e
7
+ data.tar.gz: 6e3c58d80555fd4487cac9d057eafc2960d1e35028f1a4f772ee05586b625d1e4e8ceabe028776833578334e2a8a2213a13fef55f0e82fe7219818d7a0056181
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.4.1
2
+
3
+ * Add paper_trail support
4
+
1
5
  # 1.4.0
2
6
 
3
7
  * Set minimum ruby version requirement to 2.5.0
data/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # action_reporter
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/action_reporter.svg)](https://badge.fury.io/rb/action_reporter) [![Test Status](https://github.com/amkisko/action_reporter.rb/actions/workflows/test.yml/badge.svg)](https://github.com/amkisko/action_reporter.rb/actions/workflows/test.yml)
3
+ [![Gem Version](https://badge.fury.io/rb/action_reporter.svg)](https://badge.fury.io/rb/action_reporter) [![Test Status](https://github.com/amkisko/action_reporter.rb/actions/workflows/test.yml/badge.svg)](https://github.com/amkisko/action_reporter.rb/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/amkisko/action_reporter.rb/graph/badge.svg?token=JCV2A7NWTE)](https://codecov.io/gh/amkisko/action_reporter.rb)
4
4
 
5
5
  Ruby wrapper for multiple reporting services.
6
6
 
7
7
  Supported services:
8
8
  - Rails logger
9
9
  - Audited
10
+ - PaperTrail
10
11
  - Sentry
11
12
  - Honeybadger
12
13
  - scoutapm
@@ -39,6 +40,7 @@ Put this in your `config/initializers/action_reporter.rb` file:
39
40
  ActionReporter.enabled_reporters = [
40
41
  ActionReporter::RailsReporter.new,
41
42
  # ActionReporter::AuditedReporter.new,
43
+ # ActionReporter::PaperTrailReporter.new,
42
44
  # ActionReporter::SentryReporter.new,
43
45
  # ActionReporter::HoneybadgerReporter.new,
44
46
  # ActionReporter::ScoutApmReporter.new
@@ -57,6 +59,14 @@ ActionReporter.notify('Something went wrong', context: { record: record })
57
59
 
58
60
  Bug reports and pull requests are welcome on GitHub at https://github.com/amkisko/action_reporter.rb
59
61
 
62
+ Contribution policy:
63
+ - It might take up to 2 calendar weeks to review and merge critical fixes
64
+ - It might take up to 6 calendar months to review and merge pull request
65
+ - It might take up to 1 calendar year to review an issue
66
+ - New integrations and third-party features are not nessessarily added to the gem
67
+ - Pull request should have test coverage for affected parts
68
+ - Pull request should have changelog entry
69
+
60
70
  ## Publishing
61
71
 
62
72
  ```sh
@@ -30,10 +30,12 @@ Gem::Specification.new do |gem|
30
30
  gem.require_path = "lib"
31
31
 
32
32
  gem.add_runtime_dependency 'rails', '> 5'
33
- gem.add_runtime_dependency 'audited', '~> 5'
34
- gem.add_runtime_dependency 'honeybadger', '~> 5'
35
- gem.add_runtime_dependency 'sentry-ruby', '~> 5'
36
- gem.add_runtime_dependency 'scout_apm', '~> 5'
33
+
34
+ gem.add_development_dependency 'audited', '~> 5'
35
+ gem.add_development_dependency 'honeybadger', '~> 5'
36
+ gem.add_development_dependency 'sentry-ruby', '~> 5'
37
+ gem.add_development_dependency 'scout_apm', '~> 5'
38
+ gem.add_development_dependency 'paper_trail', '~> 15'
37
39
 
38
40
  gem.add_development_dependency 'rspec', '~> 3'
39
41
  gem.add_development_dependency 'webmock', '~> 3'
@@ -0,0 +1,23 @@
1
+ module ActionReporter
2
+ class PaperTrailReporter < Base
3
+ class_accessor "PaperTrail", gem_spec: "paper_trail (~> 15)"
4
+
5
+ def notify(*)
6
+ end
7
+
8
+ def context(args)
9
+ end
10
+
11
+ def reset_context
12
+ PaperTrail.request.whodunnit = nil
13
+ end
14
+
15
+ def audited_user
16
+ PaperTrail.request.whodunnit
17
+ end
18
+
19
+ def audited_user=(user)
20
+ PaperTrail.request.whodunnit = user
21
+ end
22
+ end
23
+ end
@@ -5,18 +5,20 @@ require 'action_reporter/honeybadger_reporter'
5
5
  require 'action_reporter/sentry_reporter'
6
6
  require 'action_reporter/scout_apm_reporter'
7
7
  require 'action_reporter/audited_reporter'
8
+ require 'action_reporter/paper_trail_reporter'
8
9
 
9
10
  module ActionReporter
10
11
  module_function
11
12
 
12
- VERSION = '1.4.0'.freeze
13
+ VERSION = '1.4.1'.freeze
13
14
 
14
15
  AVAILABLE_REPORTERS = [
15
16
  ActionReporter::RailsReporter,
16
17
  ActionReporter::HoneybadgerReporter,
17
18
  ActionReporter::SentryReporter,
18
19
  ActionReporter::ScoutApmReporter,
19
- ActionReporter::AuditedReporter
20
+ ActionReporter::AuditedReporter,
21
+ ActionReporter::PaperTrailReporter
20
22
  ].freeze
21
23
 
22
24
  @enabled_reporters = []
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Makarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-30 00:00:00.000000000 Z
11
+ date: 2024-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -31,7 +31,7 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '5'
34
- type: :runtime
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -45,7 +45,7 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '5'
48
- type: :runtime
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '5'
62
- type: :runtime
62
+ type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
@@ -73,13 +73,27 @@ dependencies:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '5'
76
- type: :runtime
76
+ type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: paper_trail
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '15'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '15'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -166,6 +180,7 @@ files:
166
180
  - lib/action_reporter/base.rb
167
181
  - lib/action_reporter/error.rb
168
182
  - lib/action_reporter/honeybadger_reporter.rb
183
+ - lib/action_reporter/paper_trail_reporter.rb
169
184
  - lib/action_reporter/rails_reporter.rb
170
185
  - lib/action_reporter/scout_apm_reporter.rb
171
186
  - lib/action_reporter/sentry_reporter.rb