bp3-noticed 0.2.1 → 0.3.0

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: b4ca6fef467f83a78fa5398c7eb41d1c2b3597a9dd22918ced10e2feeb833220
4
- data.tar.gz: 816d88d3dbd4531296f2942198500821a1c1b3c0085a5ea9afd4c838a7a56dbc
3
+ metadata.gz: 4103e2267b891b17534defca5096d8dc2c044b7f97d9886abfe9f9b0fa8d7550
4
+ data.tar.gz: fae35923b67bece6b0ab2500eb343701ab94a2706ecd7df6d4dbbc72beb55497
5
5
  SHA512:
6
- metadata.gz: 940061280909e5b2173bce4df2aece7a59d95a89c4d0f77dbb9eaa8b713511693809b0ce0add7bb7d08421b821bbf16bce2220d937b289be3387c0b60e5f48ae
7
- data.tar.gz: f083d2dd46f9cffe2499048d2b8cb231ab28513b503da5d5fe8b0046fb2e30334d357f6718475b470439cf28086ac1f9536ab14fc29bf32349783dc2748d7d66
6
+ metadata.gz: 3128217f637f80b66fff20284cc5b844704db236332544bb9ae851257791086d3a01288ad4566bee02f647890f0d83ecca2688189d3e5f5729bc7fc561bf85f2
7
+ data.tar.gz: 97e30b4172fa9d498b0fd5e5e653716c9972fc6bc1f0cca81fb76cd3548826a6bae1e61443fb76aa0a8a2485a361a9c634b6899306a9bc20297e085f1151e32f
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
3
3
  - rubocop-rspec
4
+ - rubocop-rails
5
+ - rubocop-rspec_rails
4
6
 
5
7
  AllCops:
6
8
  TargetRubyVersion: 3.2.2
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.3.5
1
+ ruby-3.4.6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.0] - 2026-01-12
4
+
5
+ - Include Displayable
6
+ - Add railtie integration spec
7
+ - Add spec/rails_helper
8
+ - Create dummy rails app for specs
9
+ - Add rails gem dependencies
10
+ - Prepend DeliveryMethods subclasses
11
+ - Include SystemLogs
12
+ - Add apnotic gem dependency
13
+ - Update gems
14
+ - Make classes Ransackable
15
+ - Update ruby version to 3.4.6
16
+
3
17
  ## [0.2.1] - 2024-11-18
4
18
 
5
19
  - Use ruby 3.3.5 and relax gem constraints
data/CLAUDE.md ADDED
@@ -0,0 +1,127 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Overview
6
+
7
+ bp3-noticed is a Ruby gem that adapts the `noticed` notification library for BP3 (Black Phoebe 3), a multi-site multi-tenant Rails application. It integrates BP3's core functionality (Rqid, Sqnr, Tenantable, Ransackable) with the `noticed` gem to ensure notifications work correctly within BP3's multi-tenant architecture.
8
+
9
+ ## Commands
10
+
11
+ ### Testing and Linting
12
+ - `rake` or `rake default` - Run both RSpec tests and RuboCop linting
13
+ - `rake spec` - Run RSpec tests only
14
+ - `rake rubocop` - Run RuboCop linting only
15
+ - `rspec spec/path/to/specific_spec.rb` - Run a single test file
16
+ - `rspec spec/path/to/specific_spec.rb:42` - Run a specific test at line 42
17
+
18
+ ### Development
19
+ - `bin/setup` - Install dependencies after checking out the repo
20
+ - `bin/console` - Interactive prompt for experimentation
21
+ - `rake install` - Install gem onto local machine
22
+ - `rake release` - Release new version (updates version, creates git tag, pushes to rubygems.org)
23
+
24
+ ## Architecture
25
+
26
+ ### Core Integration Pattern
27
+
28
+ This gem uses a **prepend-and-include pattern** to inject BP3 functionality into jobs:
29
+
30
+ 1. **CommonIncludes** - Shared functionality for both ActiveJob and Que jobs
31
+ - Provides global request state management
32
+ - Site resolution and tenant context preservation
33
+ - Implements `run(...)` method that calls `perform(...)`
34
+
35
+ 2. **JobIncludes** - For ActiveJob jobs (include in ApplicationJob)
36
+ - Adds `enqueue` override to inject state into job arguments
37
+ - Provides convenience methods: `run_now`, `run_soon`, `run_later`
38
+
39
+ 3. **QueIncludes** - For Que jobs (include in Que::Job base class)
40
+ - Similar to JobIncludes but adapted for Que's API
41
+ - Includes debug logging when `BP_DEBUG=quejobs`
42
+
43
+ 4. **PrependPerform** - Must be prepended in every custom job class
44
+ - Wraps `perform` method to set/clear global request state
45
+ - Removes state from args/kwargs before calling super
46
+ - Logs job execution and failures via SystemLogs
47
+ - Handles ArgumentError fallback for jobs relying on run_attrs
48
+
49
+ ### Railtie Configuration
50
+
51
+ The `Bp3::Noticed::Railtie` (lib/bp3/noticed/railtie.rb:22-123) runs after Rails initialization to:
52
+ - Preload and monkey-patch `Noticed::Event`, `Noticed::Notification`, `Noticed::ApplicationJob`, `Noticed::EventJob`, and `Noticed::DeliveryMethod` classes
53
+ - Mix in BP3::Core modules (Rqid, Sqnr, Tenantable, Ransackable) to Noticed models
54
+ - Configure tenancy and sequencing for ordering
55
+ - Override `recipient_attributes_for` to inject global scope (site_id, tenant_id, workspace_id)
56
+ - Apply PrependPerform and SystemLogs to all delivery method classes
57
+
58
+ ### Global Request State Management
59
+
60
+ Jobs running in background workers need access to the current site, tenant, and workspace context. This is achieved by:
61
+ 1. Capturing `GlobalRequestState.to_hash` when enqueuing
62
+ 2. Passing state as a job argument (not kwarg)
63
+ 3. Restoring state via `GlobalRequestState.from_hash(state)` in PrependPerform
64
+ 4. Clearing state in ensure block after job completes
65
+
66
+ This pattern ensures multi-tenant isolation is maintained across background job boundaries.
67
+
68
+ ## Integration Requirements
69
+
70
+ When using this gem in a BP3 application:
71
+
72
+ **For ActiveJob:**
73
+ ```ruby
74
+ # In ApplicationJob
75
+ include Bp3::Noticed::CommonIncludes
76
+ include Bp3::Noticed::JobIncludes
77
+
78
+ # In every custom job class
79
+ prepend Bp3::Noticed::PrependPerform
80
+ ```
81
+
82
+ **For Que Jobs (if used):**
83
+ ```ruby
84
+ # In Que base job class
85
+ include Bp3::Noticed::CommonIncludes
86
+ include Bp3::Noticed::QueIncludes
87
+
88
+ # In every custom job class
89
+ prepend Bp3::Noticed::PrependPerform
90
+ ```
91
+
92
+ **Important:** Do NOT change `Noticed.parent_class` - this gem handles the necessary modifications.
93
+
94
+ ## RuboCop Configuration
95
+
96
+ - Target Ruby: 3.2.2+ (gem requires >= 3.2.0)
97
+ - Plugins: rubocop-rake, rubocop-rspec
98
+ - NewCops enabled
99
+ - Style/Documentation disabled
100
+ - Special allowances for lib/bp3/**/railtie.rb (ConstantDefinitionInBlock, Lint/Void)
101
+ - Custom metrics: AbcSize: 26, BlockLength: 66, MethodLength: 15, ModuleLength: 150
102
+
103
+ ## Dependencies
104
+
105
+ Core dependencies:
106
+ - `activesupport ~> 8.1`
107
+ - `noticed >= 2.2` - The upstream notification library being adapted
108
+ - `bp3-core >= 0.1` - Provides Rqid, Sqnr, Tenantable, Ransackable, SystemLogs
109
+ - `bp3-action_dispatch >= 0.1` - Provides site_class
110
+ - `apnotic ~> 1` - Apple Push Notification support
111
+
112
+ Note: FCM (Firebase Cloud Messaging) delivery method is disabled until `googleauth` supports newer gem versions.
113
+
114
+ ## Repository Structure
115
+
116
+ ```
117
+ lib/
118
+ ├── bp3-noticed.rb # Main entry point
119
+ └── bp3/
120
+ └── noticed/
121
+ ├── common_includes.rb # Shared job functionality
122
+ ├── job_includes.rb # ActiveJob-specific
123
+ ├── que_includes.rb # Que-specific
124
+ ├── prepend_perform.rb # Performance wrapper
125
+ ├── railtie.rb # Rails integration & monkey patches
126
+ └── version.rb # Gem version
127
+ ```
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bp3-noticed (0.2.1)
5
- activesupport (>= 7.1.2)
4
+ bp3-noticed (0.3.0)
5
+ activesupport (~> 8.1)
6
+ apnotic (~> 1)
6
7
  bp3-action_dispatch (>= 0.1)
7
8
  bp3-core (>= 0.1)
8
9
  noticed (>= 2.2)
@@ -10,29 +11,31 @@ PATH
10
11
  GEM
11
12
  remote: https://rubygems.org/
12
13
  specs:
13
- actioncable (8.0.0)
14
- actionpack (= 8.0.0)
15
- activesupport (= 8.0.0)
14
+ action_text-trix (2.1.16)
15
+ railties
16
+ actioncable (8.1.2)
17
+ actionpack (= 8.1.2)
18
+ activesupport (= 8.1.2)
16
19
  nio4r (~> 2.0)
17
20
  websocket-driver (>= 0.6.1)
18
21
  zeitwerk (~> 2.6)
19
- actionmailbox (8.0.0)
20
- actionpack (= 8.0.0)
21
- activejob (= 8.0.0)
22
- activerecord (= 8.0.0)
23
- activestorage (= 8.0.0)
24
- activesupport (= 8.0.0)
22
+ actionmailbox (8.1.2)
23
+ actionpack (= 8.1.2)
24
+ activejob (= 8.1.2)
25
+ activerecord (= 8.1.2)
26
+ activestorage (= 8.1.2)
27
+ activesupport (= 8.1.2)
25
28
  mail (>= 2.8.0)
26
- actionmailer (8.0.0)
27
- actionpack (= 8.0.0)
28
- actionview (= 8.0.0)
29
- activejob (= 8.0.0)
30
- activesupport (= 8.0.0)
29
+ actionmailer (8.1.2)
30
+ actionpack (= 8.1.2)
31
+ actionview (= 8.1.2)
32
+ activejob (= 8.1.2)
33
+ activesupport (= 8.1.2)
31
34
  mail (>= 2.8.0)
32
35
  rails-dom-testing (~> 2.2)
33
- actionpack (8.0.0)
34
- actionview (= 8.0.0)
35
- activesupport (= 8.0.0)
36
+ actionpack (8.1.2)
37
+ actionview (= 8.1.2)
38
+ activesupport (= 8.1.2)
36
39
  nokogiri (>= 1.8.5)
37
40
  rack (>= 2.2.4)
38
41
  rack-session (>= 1.0.1)
@@ -40,209 +43,270 @@ GEM
40
43
  rails-dom-testing (~> 2.2)
41
44
  rails-html-sanitizer (~> 1.6)
42
45
  useragent (~> 0.16)
43
- actiontext (8.0.0)
44
- actionpack (= 8.0.0)
45
- activerecord (= 8.0.0)
46
- activestorage (= 8.0.0)
47
- activesupport (= 8.0.0)
46
+ actiontext (8.1.2)
47
+ action_text-trix (~> 2.1.15)
48
+ actionpack (= 8.1.2)
49
+ activerecord (= 8.1.2)
50
+ activestorage (= 8.1.2)
51
+ activesupport (= 8.1.2)
48
52
  globalid (>= 0.6.0)
49
53
  nokogiri (>= 1.8.5)
50
- actionview (8.0.0)
51
- activesupport (= 8.0.0)
54
+ actionview (8.1.2)
55
+ activesupport (= 8.1.2)
52
56
  builder (~> 3.1)
53
57
  erubi (~> 1.11)
54
58
  rails-dom-testing (~> 2.2)
55
59
  rails-html-sanitizer (~> 1.6)
56
- activejob (8.0.0)
57
- activesupport (= 8.0.0)
60
+ activejob (8.1.2)
61
+ activesupport (= 8.1.2)
58
62
  globalid (>= 0.3.6)
59
- activemodel (8.0.0)
60
- activesupport (= 8.0.0)
61
- activerecord (8.0.0)
62
- activemodel (= 8.0.0)
63
- activesupport (= 8.0.0)
63
+ activemodel (8.1.2)
64
+ activesupport (= 8.1.2)
65
+ activerecord (8.1.2)
66
+ activemodel (= 8.1.2)
67
+ activesupport (= 8.1.2)
64
68
  timeout (>= 0.4.0)
65
- activestorage (8.0.0)
66
- actionpack (= 8.0.0)
67
- activejob (= 8.0.0)
68
- activerecord (= 8.0.0)
69
- activesupport (= 8.0.0)
69
+ activestorage (8.1.2)
70
+ actionpack (= 8.1.2)
71
+ activejob (= 8.1.2)
72
+ activerecord (= 8.1.2)
73
+ activesupport (= 8.1.2)
70
74
  marcel (~> 1.0)
71
- activesupport (8.0.0)
75
+ activesupport (8.1.2)
72
76
  base64
73
- benchmark (>= 0.3)
74
77
  bigdecimal
75
78
  concurrent-ruby (~> 1.0, >= 1.3.1)
76
79
  connection_pool (>= 2.2.5)
77
80
  drb
78
81
  i18n (>= 1.6, < 2)
82
+ json
79
83
  logger (>= 1.4.2)
80
84
  minitest (>= 5.1)
81
85
  securerandom (>= 0.3)
82
86
  tzinfo (~> 2.0, >= 2.0.5)
83
87
  uri (>= 0.13.1)
84
- ast (2.4.2)
85
- base64 (0.2.0)
86
- benchmark (0.4.0)
87
- bigdecimal (3.1.8)
88
- bp3-action_dispatch (0.1.3)
88
+ apnotic (1.8.0)
89
+ base64
90
+ connection_pool (>= 2, < 4)
91
+ net-http2 (>= 0.18.3, < 2)
92
+ ast (2.4.3)
93
+ base64 (0.3.0)
94
+ bigdecimal (4.0.1)
95
+ bp3-action_dispatch (0.1.5)
89
96
  actionpack (>= 7.1.2)
90
97
  activesupport (>= 7.1.2)
91
98
  i18n (>= 1.8.11)
92
- bp3-core (0.1.5)
93
- actionview (>= 7.1.2)
94
- activesupport (>= 7.1.2)
99
+ bp3-core (0.2.0)
100
+ actionview (~> 8.1)
101
+ activesupport (~> 8.1)
102
+ bp3-request_state (~> 0.1)
103
+ bp3-request_state (0.1.3)
104
+ actionpack (~> 8.1)
105
+ activesupport (~> 8.1)
106
+ request_store (>= 1.5.1)
95
107
  builder (3.3.0)
96
- byebug (11.1.3)
97
- concurrent-ruby (1.3.4)
98
- connection_pool (2.4.1)
108
+ byebug (12.0.0)
109
+ concurrent-ruby (1.3.6)
110
+ connection_pool (3.0.2)
99
111
  crass (1.0.6)
100
- date (3.4.0)
101
- diff-lcs (1.5.1)
102
- drb (2.2.1)
103
- erubi (1.13.0)
104
- globalid (1.2.1)
112
+ date (3.5.1)
113
+ diff-lcs (1.6.2)
114
+ drb (2.2.3)
115
+ erb (6.0.1)
116
+ erubi (1.13.1)
117
+ globalid (1.3.0)
105
118
  activesupport (>= 6.1)
106
- i18n (1.14.6)
119
+ http-2 (1.1.1)
120
+ i18n (1.14.8)
107
121
  concurrent-ruby (~> 1.0)
108
- io-console (0.7.2)
109
- irb (1.14.1)
122
+ io-console (0.8.2)
123
+ irb (1.16.0)
124
+ pp (>= 0.6.0)
110
125
  rdoc (>= 4.0.0)
111
126
  reline (>= 0.4.2)
112
- json (2.8.2)
113
- language_server-protocol (3.17.0.3)
114
- logger (1.6.1)
115
- loofah (2.23.1)
127
+ json (2.18.0)
128
+ language_server-protocol (3.17.0.5)
129
+ lint_roller (1.1.0)
130
+ logger (1.7.0)
131
+ loofah (2.25.0)
116
132
  crass (~> 1.0.2)
117
133
  nokogiri (>= 1.12.0)
118
- mail (2.8.1)
134
+ mail (2.9.0)
135
+ logger
119
136
  mini_mime (>= 0.1.1)
120
137
  net-imap
121
138
  net-pop
122
139
  net-smtp
123
- marcel (1.0.4)
140
+ marcel (1.1.0)
124
141
  mini_mime (1.1.5)
125
- minitest (5.25.1)
126
- net-imap (0.5.1)
142
+ minitest (6.0.1)
143
+ prism (~> 1.5)
144
+ net-http2 (0.19.0)
145
+ http-2 (>= 1.0)
146
+ net-imap (0.6.2)
127
147
  date
128
148
  net-protocol
129
149
  net-pop (0.1.2)
130
150
  net-protocol
131
151
  net-protocol (0.2.2)
132
152
  timeout
133
- net-smtp (0.5.0)
153
+ net-smtp (0.5.1)
134
154
  net-protocol
135
- nio4r (2.7.4)
136
- nokogiri (1.16.7-x86_64-darwin)
155
+ nio4r (2.7.5)
156
+ nokogiri (1.19.0-x86_64-darwin)
137
157
  racc (~> 1.4)
138
- noticed (2.4.3)
158
+ noticed (3.0.0)
139
159
  rails (>= 6.1.0)
140
- parallel (1.26.3)
141
- parser (3.3.6.0)
160
+ parallel (1.27.0)
161
+ parser (3.3.10.0)
142
162
  ast (~> 2.4.1)
143
163
  racc
144
- psych (5.2.0)
164
+ pp (0.6.3)
165
+ prettyprint
166
+ prettyprint (0.2.0)
167
+ prism (1.7.0)
168
+ psych (5.3.1)
169
+ date
145
170
  stringio
146
171
  racc (1.8.1)
147
- rack (3.1.8)
148
- rack-session (2.0.0)
172
+ rack (3.2.4)
173
+ rack-session (2.1.1)
174
+ base64 (>= 0.1.0)
149
175
  rack (>= 3.0.0)
150
- rack-test (2.1.0)
176
+ rack-test (2.2.0)
151
177
  rack (>= 1.3)
152
- rackup (2.2.1)
178
+ rackup (2.3.1)
153
179
  rack (>= 3)
154
- rails (8.0.0)
155
- actioncable (= 8.0.0)
156
- actionmailbox (= 8.0.0)
157
- actionmailer (= 8.0.0)
158
- actionpack (= 8.0.0)
159
- actiontext (= 8.0.0)
160
- actionview (= 8.0.0)
161
- activejob (= 8.0.0)
162
- activemodel (= 8.0.0)
163
- activerecord (= 8.0.0)
164
- activestorage (= 8.0.0)
165
- activesupport (= 8.0.0)
180
+ rails (8.1.2)
181
+ actioncable (= 8.1.2)
182
+ actionmailbox (= 8.1.2)
183
+ actionmailer (= 8.1.2)
184
+ actionpack (= 8.1.2)
185
+ actiontext (= 8.1.2)
186
+ actionview (= 8.1.2)
187
+ activejob (= 8.1.2)
188
+ activemodel (= 8.1.2)
189
+ activerecord (= 8.1.2)
190
+ activestorage (= 8.1.2)
191
+ activesupport (= 8.1.2)
166
192
  bundler (>= 1.15.0)
167
- railties (= 8.0.0)
168
- rails-dom-testing (2.2.0)
193
+ railties (= 8.1.2)
194
+ rails-dom-testing (2.3.0)
169
195
  activesupport (>= 5.0.0)
170
196
  minitest
171
197
  nokogiri (>= 1.6)
172
- rails-html-sanitizer (1.6.0)
198
+ rails-html-sanitizer (1.6.2)
173
199
  loofah (~> 2.21)
174
- nokogiri (~> 1.14)
175
- railties (8.0.0)
176
- actionpack (= 8.0.0)
177
- activesupport (= 8.0.0)
200
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
201
+ railties (8.1.2)
202
+ actionpack (= 8.1.2)
203
+ activesupport (= 8.1.2)
178
204
  irb (~> 1.13)
179
205
  rackup (>= 1.0.0)
180
206
  rake (>= 12.2)
181
207
  thor (~> 1.0, >= 1.2.2)
208
+ tsort (>= 0.2)
182
209
  zeitwerk (~> 2.6)
183
210
  rainbow (3.1.1)
184
- rake (13.2.1)
185
- rdoc (6.7.0)
211
+ rake (13.3.1)
212
+ rdoc (7.0.3)
213
+ erb
186
214
  psych (>= 4.0.0)
187
- regexp_parser (2.9.2)
188
- reline (0.5.11)
215
+ tsort
216
+ regexp_parser (2.11.3)
217
+ reline (0.6.3)
189
218
  io-console (~> 0.5)
190
- rspec (3.13.0)
219
+ request_store (1.7.0)
220
+ rack (>= 1.4)
221
+ rspec (3.13.2)
191
222
  rspec-core (~> 3.13.0)
192
223
  rspec-expectations (~> 3.13.0)
193
224
  rspec-mocks (~> 3.13.0)
194
- rspec-core (3.13.2)
225
+ rspec-core (3.13.6)
195
226
  rspec-support (~> 3.13.0)
196
- rspec-expectations (3.13.3)
227
+ rspec-expectations (3.13.5)
197
228
  diff-lcs (>= 1.2.0, < 2.0)
198
229
  rspec-support (~> 3.13.0)
199
- rspec-mocks (3.13.2)
230
+ rspec-mocks (3.13.7)
200
231
  diff-lcs (>= 1.2.0, < 2.0)
201
232
  rspec-support (~> 3.13.0)
202
- rspec-support (3.13.1)
203
- rubocop (1.68.0)
233
+ rspec-rails (8.0.2)
234
+ actionpack (>= 7.2)
235
+ activesupport (>= 7.2)
236
+ railties (>= 7.2)
237
+ rspec-core (~> 3.13)
238
+ rspec-expectations (~> 3.13)
239
+ rspec-mocks (~> 3.13)
240
+ rspec-support (~> 3.13)
241
+ rspec-support (3.13.6)
242
+ rubocop (1.82.1)
204
243
  json (~> 2.3)
205
- language_server-protocol (>= 3.17.0)
244
+ language_server-protocol (~> 3.17.0.2)
245
+ lint_roller (~> 1.1.0)
206
246
  parallel (~> 1.10)
207
247
  parser (>= 3.3.0.2)
208
248
  rainbow (>= 2.2.2, < 4.0)
209
- regexp_parser (>= 2.4, < 3.0)
210
- rubocop-ast (>= 1.32.2, < 2.0)
249
+ regexp_parser (>= 2.9.3, < 3.0)
250
+ rubocop-ast (>= 1.48.0, < 2.0)
211
251
  ruby-progressbar (~> 1.7)
212
- unicode-display_width (>= 2.4.0, < 3.0)
213
- rubocop-ast (1.36.1)
214
- parser (>= 3.3.1.0)
215
- rubocop-rake (0.6.0)
216
- rubocop (~> 1.0)
217
- rubocop-rspec (3.2.0)
218
- rubocop (~> 1.61)
252
+ unicode-display_width (>= 2.4.0, < 4.0)
253
+ rubocop-ast (1.49.0)
254
+ parser (>= 3.3.7.2)
255
+ prism (~> 1.7)
256
+ rubocop-rails (2.34.3)
257
+ activesupport (>= 4.2.0)
258
+ lint_roller (~> 1.1)
259
+ rack (>= 1.1)
260
+ rubocop (>= 1.75.0, < 2.0)
261
+ rubocop-ast (>= 1.44.0, < 2.0)
262
+ rubocop-rake (0.7.1)
263
+ lint_roller (~> 1.1)
264
+ rubocop (>= 1.72.1)
265
+ rubocop-rspec (3.9.0)
266
+ lint_roller (~> 1.1)
267
+ rubocop (~> 1.81)
268
+ rubocop-rspec_rails (2.32.0)
269
+ lint_roller (~> 1.1)
270
+ rubocop (~> 1.72, >= 1.72.1)
271
+ rubocop-rspec (~> 3.5)
219
272
  ruby-progressbar (1.13.0)
220
- securerandom (0.3.2)
221
- stringio (3.1.2)
222
- thor (1.3.2)
223
- timeout (0.4.2)
273
+ securerandom (0.4.1)
274
+ sqlite3 (2.9.0-x86_64-darwin)
275
+ stringio (3.2.0)
276
+ thor (1.5.0)
277
+ timeout (0.6.0)
278
+ tsort (0.2.0)
224
279
  tzinfo (2.0.6)
225
280
  concurrent-ruby (~> 1.0)
226
- unicode-display_width (2.6.0)
227
- uri (1.0.2)
228
- useragent (0.16.10)
229
- websocket-driver (0.7.6)
281
+ unicode-display_width (3.2.0)
282
+ unicode-emoji (~> 4.1)
283
+ unicode-emoji (4.2.0)
284
+ uri (1.1.1)
285
+ useragent (0.16.11)
286
+ websocket-driver (0.8.0)
287
+ base64
230
288
  websocket-extensions (>= 0.1.0)
231
289
  websocket-extensions (0.1.5)
232
- zeitwerk (2.7.1)
290
+ zeitwerk (2.7.4)
233
291
 
234
292
  PLATFORMS
235
293
  x86_64-darwin-22
236
294
  x86_64-darwin-23
295
+ x86_64-darwin-24
237
296
 
238
297
  DEPENDENCIES
239
298
  bp3-noticed!
240
299
  byebug
300
+ rails (>= 8.1)
241
301
  rake (>= 13.0)
242
302
  rspec (>= 3.0)
303
+ rspec-rails (>= 7.0)
243
304
  rubocop (>= 1.21)
305
+ rubocop-rails (>= 2.34)
244
306
  rubocop-rake (>= 0.6)
245
307
  rubocop-rspec (>= 2.25)
308
+ rubocop-rspec_rails (>= 2.32)
309
+ sqlite3 (>= 2.0)
246
310
 
247
311
  BUNDLED WITH
248
- 2.5.23
312
+ 2.7.2
data/bp3-noticed.gemspec CHANGED
@@ -31,17 +31,24 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_dependency 'activesupport', '>= 7.1.2'
34
+ spec.add_dependency 'activesupport', '~> 8.1'
35
35
  spec.add_dependency 'bp3-action_dispatch', '>= 0.1'
36
36
  spec.add_dependency 'bp3-core', '>= 0.1'
37
37
  spec.add_dependency 'noticed', '>= 2.2'
38
+ # spec.add_dependency 'googleauth', '~> 0.4' # add this and enable Fcm delivery method once it supports newer gems
39
+ spec.add_dependency 'apnotic', '~> 1'
38
40
 
39
41
  spec.add_development_dependency 'byebug'
42
+ spec.add_development_dependency 'rails', '>= 8.1'
40
43
  spec.add_development_dependency 'rake', '>= 13.0'
41
44
  spec.add_development_dependency 'rspec', '>= 3.0'
45
+ spec.add_development_dependency 'rspec-rails', '>= 7.0'
42
46
  spec.add_development_dependency 'rubocop', '>= 1.21'
47
+ spec.add_development_dependency 'rubocop-rails', '>= 2.34'
43
48
  spec.add_development_dependency 'rubocop-rake', '>= 0.6'
44
49
  spec.add_development_dependency 'rubocop-rspec', '>= 2.25'
50
+ spec.add_development_dependency 'rubocop-rspec_rails', '>= 2.32'
51
+ spec.add_development_dependency 'sqlite3', '>= 2.0'
45
52
 
46
53
  # For more information and examples about making a new gem, check out our
47
54
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -10,12 +10,12 @@ module Bp3
10
10
  end
11
11
 
12
12
  class_methods do
13
- def global_request_state_class
13
+ def global_request_state_class # rubocop:disable Rails/Delegate
14
14
  Bp3::Core::Rqid.global_request_state_class
15
15
  end
16
16
  end
17
17
 
18
- def global_request_state_class
18
+ def global_request_state_class # rubocop:disable Rails/Delegate
19
19
  Bp3::Core::Rqid.global_request_state_class
20
20
  end
21
21
 
@@ -1,11 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # require 'rails/railtie'
4
-
5
3
  module Bp3
6
4
  module Noticed
7
- if defined?(Rails.env)
5
+ NOTICED_DELIVERY_METHODS = %w[
6
+ ActionCable
7
+ ActionPushNative
8
+ Discord
9
+ Email
10
+ Ios
11
+ MicrosoftTeams
12
+ Slack
13
+ Test
14
+ TwilioMessaging
15
+ VonageSms
16
+ Webhook
17
+ ].freeze
18
+ # TODO: add Fcm and add googleauth depency once googleauth supports newer gems
19
+
20
+ # Define the Railtie only if Rails is already loaded
21
+ # Use defined?(Rails) instead of defined?(Rails.env) or defined?(Rails::Railtie)
22
+ # because those may not be accessible when this file is first loaded
23
+ if defined?(Rails)
8
24
  class Railtie < Rails::Railtie
25
+ # rubocop:disable Metrics/BlockLength
9
26
  initializer 'bp3.noticed.railtie.register' do |app|
10
27
  app.config.after_initialize do
11
28
  ::Noticed::Event # preload
@@ -18,6 +35,7 @@ module Bp3
18
35
  include Bp3::Core::Rqid
19
36
  include Bp3::Core::Sqnr
20
37
  include Bp3::Core::Tenantable
38
+ include Bp3::Core::Ransackable
21
39
 
22
40
  configure_tenancy
23
41
  use_sqnr_for_ordering
@@ -59,6 +77,8 @@ module Bp3
59
77
  include Bp3::Core::Rqid
60
78
  include Bp3::Core::Sqnr
61
79
  include Bp3::Core::Tenantable
80
+ include Bp3::Core::Ransackable
81
+ include Bp3::Core::Displayable
62
82
 
63
83
  configure_tenancy
64
84
  use_sqnr_for_ordering
@@ -67,6 +87,7 @@ module Bp3
67
87
 
68
88
  class ApplicationJob
69
89
  # include Que::ActiveJob::JobExtensions
90
+ include Bp3::Core::SystemLogs
70
91
  include Bp3::Noticed::CommonIncludes
71
92
  include Bp3::Noticed::JobIncludes
72
93
 
@@ -76,14 +97,30 @@ module Bp3
76
97
 
77
98
  class EventJob
78
99
  prepend Bp3::Noticed::PrependPerform
100
+ include Bp3::Core::SystemLogs
79
101
  end
80
102
 
81
103
  class DeliveryMethod
82
104
  prepend Bp3::Noticed::PrependPerform
105
+ include Bp3::Core::SystemLogs
106
+ end
107
+
108
+ NOTICED_DELIVERY_METHODS.each do |delivery_method|
109
+ class_name = "::Noticed::DeliveryMethods::#{delivery_method}"
110
+ klass = begin
111
+ class_name.constantize
112
+ rescue StandardError
113
+ nil
114
+ end
115
+ next unless klass
116
+
117
+ klass.prepend Bp3::Noticed::PrependPerform
118
+ klass.include Bp3::Core::SystemLogs
83
119
  end
84
120
  end
85
121
  end
86
122
  end
123
+ # rubocop:enable Metrics/BlockLength
87
124
  end
88
125
  end
89
126
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bp3
4
4
  module Noticed
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,29 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bp3-noticed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wim den Braven
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-11-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 7.1.2
18
+ version: '8.1'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 7.1.2
25
+ version: '8.1'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: bp3-action_dispatch
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +65,20 @@ dependencies:
66
65
  - - ">="
67
66
  - !ruby/object:Gem::Version
68
67
  version: '2.2'
68
+ - !ruby/object:Gem::Dependency
69
+ name: apnotic
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '1'
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1'
69
82
  - !ruby/object:Gem::Dependency
70
83
  name: byebug
71
84
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +93,20 @@ dependencies:
80
93
  - - ">="
81
94
  - !ruby/object:Gem::Version
82
95
  version: '0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rails
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '8.1'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '8.1'
83
110
  - !ruby/object:Gem::Dependency
84
111
  name: rake
85
112
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +135,20 @@ dependencies:
108
135
  - - ">="
109
136
  - !ruby/object:Gem::Version
110
137
  version: '3.0'
138
+ - !ruby/object:Gem::Dependency
139
+ name: rspec-rails
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '7.0'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '7.0'
111
152
  - !ruby/object:Gem::Dependency
112
153
  name: rubocop
113
154
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +163,20 @@ dependencies:
122
163
  - - ">="
123
164
  - !ruby/object:Gem::Version
124
165
  version: '1.21'
166
+ - !ruby/object:Gem::Dependency
167
+ name: rubocop-rails
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '2.34'
173
+ type: :development
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '2.34'
125
180
  - !ruby/object:Gem::Dependency
126
181
  name: rubocop-rake
127
182
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +205,34 @@ dependencies:
150
205
  - - ">="
151
206
  - !ruby/object:Gem::Version
152
207
  version: '2.25'
153
- description:
208
+ - !ruby/object:Gem::Dependency
209
+ name: rubocop-rspec_rails
210
+ requirement: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '2.32'
215
+ type: :development
216
+ prerelease: false
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: '2.32'
222
+ - !ruby/object:Gem::Dependency
223
+ name: sqlite3
224
+ requirement: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '2.0'
229
+ type: :development
230
+ prerelease: false
231
+ version_requirements: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '2.0'
154
236
  email:
155
237
  - wimdenbraven@persuavis.com
156
238
  executables: []
@@ -162,6 +244,7 @@ files:
162
244
  - ".ruby-version"
163
245
  - ".yardopts"
164
246
  - CHANGELOG.md
247
+ - CLAUDE.md
165
248
  - Gemfile
166
249
  - Gemfile.lock
167
250
  - LICENSE.txt
@@ -186,7 +269,6 @@ metadata:
186
269
  source_code_uri: https://github.com/persuavis/bp3-noticed
187
270
  changelog_uri: https://github.com/persuavis/bp3-noticed/blob/main/CHANGELOG.md
188
271
  rubygems_mfa_required: 'true'
189
- post_install_message:
190
272
  rdoc_options: []
191
273
  require_paths:
192
274
  - lib
@@ -201,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
283
  - !ruby/object:Gem::Version
202
284
  version: '0'
203
285
  requirements: []
204
- rubygems_version: 3.5.23
205
- signing_key:
286
+ rubygems_version: 3.6.9
206
287
  specification_version: 4
207
288
  summary: bp3-noticed adapts noticed for BP3 (persuavis/black_phoebe_3).
208
289
  test_files: []