bp3-noticed 0.2.0 → 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: 17ac709db4d71552e25763221ab6f4ef95211242a1a138458da6a52b1ba84a96
4
- data.tar.gz: 596bf31f9cf62f4f5c8133e3f5f8aa6808b0ccb95f9f50be16a16dc6d347ca61
3
+ metadata.gz: 4103e2267b891b17534defca5096d8dc2c044b7f97d9886abfe9f9b0fa8d7550
4
+ data.tar.gz: fae35923b67bece6b0ab2500eb343701ab94a2706ecd7df6d4dbbc72beb55497
5
5
  SHA512:
6
- metadata.gz: b867d294631f28e7a4f39f0f2c842a166d38c7003504680866a077d4520d861f341a6b38a84785cdfdf8b8923afa348a2de42452e0e194f7d98fba1a1f4afdf2
7
- data.tar.gz: fb876744be692af0fca93141185804a04434a575a1fcd2188bbdce17ed470d8ce725cc2a64651c87db4b3de6209f5daaf60b0e3c04a4453ebcfb2f475b3bfbdd
6
+ metadata.gz: 3128217f637f80b66fff20284cc5b844704db236332544bb9ae851257791086d3a01288ad4566bee02f647890f0d83ecca2688189d3e5f5729bc7fc561bf85f2
7
+ data.tar.gz: 97e30b4172fa9d498b0fd5e5e653716c9972fc6bc1f0cca81fb76cd3548826a6bae1e61443fb76aa0a8a2485a361a9c634b6899306a9bc20297e085f1151e32f
data/.rubocop.yml CHANGED
@@ -1,8 +1,8 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
3
3
  - rubocop-rspec
4
- - rubocop-capybara
5
- - rubocop-factory_bot
4
+ - rubocop-rails
5
+ - rubocop-rspec_rails
6
6
 
7
7
  AllCops:
8
8
  TargetRubyVersion: 3.2.2
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.2.2
1
+ ruby-3.4.6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
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
+
17
+ ## [0.2.1] - 2024-11-18
18
+
19
+ - Use ruby 3.3.5 and relax gem constraints
20
+
3
21
  ## [0.2.0] - 2024-07-31
4
22
 
5
23
  - Namespace include and prepend modules
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,261 +1,312 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bp3-noticed (0.2.0)
5
- activesupport (>= 7.1.2, < 8)
6
- bp3-action_dispatch (>= 0.1, < 1)
7
- bp3-core (>= 0.1, < 1)
8
- noticed (~> 2.2)
4
+ bp3-noticed (0.3.0)
5
+ activesupport (~> 8.1)
6
+ apnotic (~> 1)
7
+ bp3-action_dispatch (>= 0.1)
8
+ bp3-core (>= 0.1)
9
+ noticed (>= 2.2)
9
10
 
10
11
  GEM
11
12
  remote: https://rubygems.org/
12
13
  specs:
13
- actioncable (7.1.3.4)
14
- actionpack (= 7.1.3.4)
15
- activesupport (= 7.1.3.4)
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 (7.1.3.4)
20
- actionpack (= 7.1.3.4)
21
- activejob (= 7.1.3.4)
22
- activerecord (= 7.1.3.4)
23
- activestorage (= 7.1.3.4)
24
- activesupport (= 7.1.3.4)
25
- mail (>= 2.7.1)
26
- net-imap
27
- net-pop
28
- net-smtp
29
- actionmailer (7.1.3.4)
30
- actionpack (= 7.1.3.4)
31
- actionview (= 7.1.3.4)
32
- activejob (= 7.1.3.4)
33
- activesupport (= 7.1.3.4)
34
- mail (~> 2.5, >= 2.5.4)
35
- net-imap
36
- net-pop
37
- net-smtp
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)
28
+ mail (>= 2.8.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)
34
+ mail (>= 2.8.0)
38
35
  rails-dom-testing (~> 2.2)
39
- actionpack (7.1.3.4)
40
- actionview (= 7.1.3.4)
41
- activesupport (= 7.1.3.4)
36
+ actionpack (8.1.2)
37
+ actionview (= 8.1.2)
38
+ activesupport (= 8.1.2)
42
39
  nokogiri (>= 1.8.5)
43
- racc
44
40
  rack (>= 2.2.4)
45
41
  rack-session (>= 1.0.1)
46
42
  rack-test (>= 0.6.3)
47
43
  rails-dom-testing (~> 2.2)
48
44
  rails-html-sanitizer (~> 1.6)
49
- actiontext (7.1.3.4)
50
- actionpack (= 7.1.3.4)
51
- activerecord (= 7.1.3.4)
52
- activestorage (= 7.1.3.4)
53
- activesupport (= 7.1.3.4)
45
+ useragent (~> 0.16)
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)
54
52
  globalid (>= 0.6.0)
55
53
  nokogiri (>= 1.8.5)
56
- actionview (7.1.3.4)
57
- activesupport (= 7.1.3.4)
54
+ actionview (8.1.2)
55
+ activesupport (= 8.1.2)
58
56
  builder (~> 3.1)
59
57
  erubi (~> 1.11)
60
58
  rails-dom-testing (~> 2.2)
61
59
  rails-html-sanitizer (~> 1.6)
62
- activejob (7.1.3.4)
63
- activesupport (= 7.1.3.4)
60
+ activejob (8.1.2)
61
+ activesupport (= 8.1.2)
64
62
  globalid (>= 0.3.6)
65
- activemodel (7.1.3.4)
66
- activesupport (= 7.1.3.4)
67
- activerecord (7.1.3.4)
68
- activemodel (= 7.1.3.4)
69
- activesupport (= 7.1.3.4)
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)
70
68
  timeout (>= 0.4.0)
71
- activestorage (7.1.3.4)
72
- actionpack (= 7.1.3.4)
73
- activejob (= 7.1.3.4)
74
- activerecord (= 7.1.3.4)
75
- activesupport (= 7.1.3.4)
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)
76
74
  marcel (~> 1.0)
77
- activesupport (7.1.3.4)
75
+ activesupport (8.1.2)
78
76
  base64
79
77
  bigdecimal
80
- concurrent-ruby (~> 1.0, >= 1.0.2)
78
+ concurrent-ruby (~> 1.0, >= 1.3.1)
81
79
  connection_pool (>= 2.2.5)
82
80
  drb
83
81
  i18n (>= 1.6, < 2)
82
+ json
83
+ logger (>= 1.4.2)
84
84
  minitest (>= 5.1)
85
- mutex_m
86
- tzinfo (~> 2.0)
87
- ast (2.4.2)
88
- base64 (0.2.0)
89
- bigdecimal (3.1.8)
90
- bp3-action_dispatch (0.1.2)
91
- actionpack (>= 7.1.2, < 8)
92
- activesupport (>= 7.1.2, < 8)
93
- i18n (>= 1.8.11, < 2)
94
- bp3-core (0.1.4)
95
- actionview (>= 7.1.2, < 8)
96
- activesupport (>= 7.1.2, < 8)
85
+ securerandom (>= 0.3)
86
+ tzinfo (~> 2.0, >= 2.0.5)
87
+ uri (>= 0.13.1)
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)
96
+ actionpack (>= 7.1.2)
97
+ activesupport (>= 7.1.2)
98
+ i18n (>= 1.8.11)
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)
97
107
  builder (3.3.0)
98
- byebug (11.1.3)
99
- concurrent-ruby (1.3.3)
100
- connection_pool (2.4.1)
108
+ byebug (12.0.0)
109
+ concurrent-ruby (1.3.6)
110
+ connection_pool (3.0.2)
101
111
  crass (1.0.6)
102
- date (3.3.4)
103
- diff-lcs (1.5.1)
104
- drb (2.2.1)
105
- erubi (1.13.0)
106
- 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)
107
118
  activesupport (>= 6.1)
108
- i18n (1.14.5)
119
+ http-2 (1.1.1)
120
+ i18n (1.14.8)
109
121
  concurrent-ruby (~> 1.0)
110
- io-console (0.7.2)
111
- irb (1.14.0)
122
+ io-console (0.8.2)
123
+ irb (1.16.0)
124
+ pp (>= 0.6.0)
112
125
  rdoc (>= 4.0.0)
113
126
  reline (>= 0.4.2)
114
- json (2.7.2)
115
- language_server-protocol (3.17.0.3)
116
- loofah (2.22.0)
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)
117
132
  crass (~> 1.0.2)
118
133
  nokogiri (>= 1.12.0)
119
- mail (2.8.1)
134
+ mail (2.9.0)
135
+ logger
120
136
  mini_mime (>= 0.1.1)
121
137
  net-imap
122
138
  net-pop
123
139
  net-smtp
124
- marcel (1.0.4)
140
+ marcel (1.1.0)
125
141
  mini_mime (1.1.5)
126
- minitest (5.24.1)
127
- mutex_m (0.2.0)
128
- net-imap (0.4.14)
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)
129
147
  date
130
148
  net-protocol
131
149
  net-pop (0.1.2)
132
150
  net-protocol
133
151
  net-protocol (0.2.2)
134
152
  timeout
135
- net-smtp (0.5.0)
153
+ net-smtp (0.5.1)
136
154
  net-protocol
137
- nio4r (2.7.3)
138
- nokogiri (1.16.7-x86_64-darwin)
155
+ nio4r (2.7.5)
156
+ nokogiri (1.19.0-x86_64-darwin)
139
157
  racc (~> 1.4)
140
- noticed (2.4.1)
158
+ noticed (3.0.0)
141
159
  rails (>= 6.1.0)
142
- parallel (1.25.1)
143
- parser (3.3.4.0)
160
+ parallel (1.27.0)
161
+ parser (3.3.10.0)
144
162
  ast (~> 2.4.1)
145
163
  racc
146
- psych (5.1.2)
164
+ pp (0.6.3)
165
+ prettyprint
166
+ prettyprint (0.2.0)
167
+ prism (1.7.0)
168
+ psych (5.3.1)
169
+ date
147
170
  stringio
148
171
  racc (1.8.1)
149
- rack (3.1.7)
150
- rack-session (2.0.0)
172
+ rack (3.2.4)
173
+ rack-session (2.1.1)
174
+ base64 (>= 0.1.0)
151
175
  rack (>= 3.0.0)
152
- rack-test (2.1.0)
176
+ rack-test (2.2.0)
153
177
  rack (>= 1.3)
154
- rackup (2.1.0)
178
+ rackup (2.3.1)
155
179
  rack (>= 3)
156
- webrick (~> 1.8)
157
- rails (7.1.3.4)
158
- actioncable (= 7.1.3.4)
159
- actionmailbox (= 7.1.3.4)
160
- actionmailer (= 7.1.3.4)
161
- actionpack (= 7.1.3.4)
162
- actiontext (= 7.1.3.4)
163
- actionview (= 7.1.3.4)
164
- activejob (= 7.1.3.4)
165
- activemodel (= 7.1.3.4)
166
- activerecord (= 7.1.3.4)
167
- activestorage (= 7.1.3.4)
168
- activesupport (= 7.1.3.4)
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)
169
192
  bundler (>= 1.15.0)
170
- railties (= 7.1.3.4)
171
- rails-dom-testing (2.2.0)
193
+ railties (= 8.1.2)
194
+ rails-dom-testing (2.3.0)
172
195
  activesupport (>= 5.0.0)
173
196
  minitest
174
197
  nokogiri (>= 1.6)
175
- rails-html-sanitizer (1.6.0)
198
+ rails-html-sanitizer (1.6.2)
176
199
  loofah (~> 2.21)
177
- nokogiri (~> 1.14)
178
- railties (7.1.3.4)
179
- actionpack (= 7.1.3.4)
180
- activesupport (= 7.1.3.4)
181
- irb
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)
204
+ irb (~> 1.13)
182
205
  rackup (>= 1.0.0)
183
206
  rake (>= 12.2)
184
207
  thor (~> 1.0, >= 1.2.2)
208
+ tsort (>= 0.2)
185
209
  zeitwerk (~> 2.6)
186
210
  rainbow (3.1.1)
187
- rake (13.2.1)
188
- rdoc (6.7.0)
211
+ rake (13.3.1)
212
+ rdoc (7.0.3)
213
+ erb
189
214
  psych (>= 4.0.0)
190
- regexp_parser (2.9.2)
191
- reline (0.5.9)
215
+ tsort
216
+ regexp_parser (2.11.3)
217
+ reline (0.6.3)
192
218
  io-console (~> 0.5)
193
- rexml (3.3.2)
194
- strscan
195
- rspec (3.13.0)
219
+ request_store (1.7.0)
220
+ rack (>= 1.4)
221
+ rspec (3.13.2)
196
222
  rspec-core (~> 3.13.0)
197
223
  rspec-expectations (~> 3.13.0)
198
224
  rspec-mocks (~> 3.13.0)
199
- rspec-core (3.13.0)
225
+ rspec-core (3.13.6)
200
226
  rspec-support (~> 3.13.0)
201
- rspec-expectations (3.13.1)
227
+ rspec-expectations (3.13.5)
202
228
  diff-lcs (>= 1.2.0, < 2.0)
203
229
  rspec-support (~> 3.13.0)
204
- rspec-mocks (3.13.1)
230
+ rspec-mocks (3.13.7)
205
231
  diff-lcs (>= 1.2.0, < 2.0)
206
232
  rspec-support (~> 3.13.0)
207
- rspec-support (3.13.1)
208
- rubocop (1.65.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)
209
243
  json (~> 2.3)
210
- language_server-protocol (>= 3.17.0)
244
+ language_server-protocol (~> 3.17.0.2)
245
+ lint_roller (~> 1.1.0)
211
246
  parallel (~> 1.10)
212
247
  parser (>= 3.3.0.2)
213
248
  rainbow (>= 2.2.2, < 4.0)
214
- regexp_parser (>= 2.4, < 3.0)
215
- rexml (>= 3.2.5, < 4.0)
216
- rubocop-ast (>= 1.31.1, < 2.0)
249
+ regexp_parser (>= 2.9.3, < 3.0)
250
+ rubocop-ast (>= 1.48.0, < 2.0)
217
251
  ruby-progressbar (~> 1.7)
218
- unicode-display_width (>= 2.4.0, < 3.0)
219
- rubocop-ast (1.31.3)
220
- parser (>= 3.3.1.0)
221
- rubocop-capybara (2.21.0)
222
- rubocop (~> 1.41)
223
- rubocop-factory_bot (2.26.1)
224
- rubocop (~> 1.61)
225
- rubocop-rake (0.6.0)
226
- rubocop (~> 1.0)
227
- rubocop-rspec (2.31.0)
228
- rubocop (~> 1.40)
229
- rubocop-capybara (~> 2.17)
230
- rubocop-factory_bot (~> 2.22)
231
- rubocop-rspec_rails (~> 2.28)
232
- rubocop-rspec_rails (2.29.1)
233
- 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)
234
272
  ruby-progressbar (1.13.0)
235
- stringio (3.1.1)
236
- strscan (3.1.0)
237
- thor (1.3.1)
238
- timeout (0.4.1)
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)
239
279
  tzinfo (2.0.6)
240
280
  concurrent-ruby (~> 1.0)
241
- unicode-display_width (2.5.0)
242
- webrick (1.8.1)
243
- 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
244
288
  websocket-extensions (>= 0.1.0)
245
289
  websocket-extensions (0.1.5)
246
- zeitwerk (2.6.17)
290
+ zeitwerk (2.7.4)
247
291
 
248
292
  PLATFORMS
249
293
  x86_64-darwin-22
294
+ x86_64-darwin-23
295
+ x86_64-darwin-24
250
296
 
251
297
  DEPENDENCIES
252
298
  bp3-noticed!
253
299
  byebug
254
- rake (~> 13.0)
255
- rspec (~> 3.0)
256
- rubocop (~> 1.21)
257
- rubocop-rake (~> 0.6)
258
- rubocop-rspec (~> 2.25)
300
+ rails (>= 8.1)
301
+ rake (>= 13.0)
302
+ rspec (>= 3.0)
303
+ rspec-rails (>= 7.0)
304
+ rubocop (>= 1.21)
305
+ rubocop-rails (>= 2.34)
306
+ rubocop-rake (>= 0.6)
307
+ rubocop-rspec (>= 2.25)
308
+ rubocop-rspec_rails (>= 2.32)
309
+ sqlite3 (>= 2.0)
259
310
 
260
311
  BUNDLED WITH
261
- 2.5.11
312
+ 2.7.2
data/Rakefile CHANGED
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'bundler/setup'
3
4
  require 'bundler/gem_tasks'
4
5
  require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
6
  require 'rubocop/rake_task'
9
7
 
8
+ Dir.glob('lib/tasks/**/*.rake').each { |file| load file }
9
+
10
+ RSpec::Core::RakeTask.new(:spec)
10
11
  RuboCop::RakeTask.new
11
12
 
12
13
  task default: %i[spec rubocop]
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', '< 8']
35
- spec.add_dependency 'bp3-action_dispatch', ['>= 0.1', '< 1']
36
- spec.add_dependency 'bp3-core', ['>= 0.1', '< 1']
37
- spec.add_dependency 'noticed', '~> 2.2'
34
+ spec.add_dependency 'activesupport', '~> 8.1'
35
+ spec.add_dependency 'bp3-action_dispatch', '>= 0.1'
36
+ spec.add_dependency 'bp3-core', '>= 0.1'
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'
40
- spec.add_development_dependency 'rake', '~> 13.0'
41
- spec.add_development_dependency 'rspec', '~> 3.0'
42
- spec.add_development_dependency 'rubocop', '~> 1.21'
43
- spec.add_development_dependency 'rubocop-rake', '~> 0.6'
44
- spec.add_development_dependency 'rubocop-rspec', '~> 2.25'
42
+ spec.add_development_dependency 'rails', '>= 8.1'
43
+ spec.add_development_dependency 'rake', '>= 13.0'
44
+ spec.add_development_dependency 'rspec', '>= 3.0'
45
+ spec.add_development_dependency 'rspec-rails', '>= 7.0'
46
+ spec.add_development_dependency 'rubocop', '>= 1.21'
47
+ spec.add_development_dependency 'rubocop-rails', '>= 2.34'
48
+ spec.add_development_dependency 'rubocop-rake', '>= 0.6'
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.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,35 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bp3-noticed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
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-07-31 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
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 7.1.2
20
- - - "<"
16
+ - - "~>"
21
17
  - !ruby/object:Gem::Version
22
- version: '8'
18
+ version: '8.1'
23
19
  type: :runtime
24
20
  prerelease: false
25
21
  version_requirements: !ruby/object:Gem::Requirement
26
22
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 7.1.2
30
- - - "<"
23
+ - - "~>"
31
24
  - !ruby/object:Gem::Version
32
- version: '8'
25
+ version: '8.1'
33
26
  - !ruby/object:Gem::Dependency
34
27
  name: bp3-action_dispatch
35
28
  requirement: !ruby/object:Gem::Requirement
@@ -37,9 +30,6 @@ dependencies:
37
30
  - - ">="
38
31
  - !ruby/object:Gem::Version
39
32
  version: '0.1'
40
- - - "<"
41
- - !ruby/object:Gem::Version
42
- version: '1'
43
33
  type: :runtime
44
34
  prerelease: false
45
35
  version_requirements: !ruby/object:Gem::Requirement
@@ -47,9 +37,6 @@ dependencies:
47
37
  - - ">="
48
38
  - !ruby/object:Gem::Version
49
39
  version: '0.1'
50
- - - "<"
51
- - !ruby/object:Gem::Version
52
- version: '1'
53
40
  - !ruby/object:Gem::Dependency
54
41
  name: bp3-core
55
42
  requirement: !ruby/object:Gem::Requirement
@@ -57,9 +44,6 @@ dependencies:
57
44
  - - ">="
58
45
  - !ruby/object:Gem::Version
59
46
  version: '0.1'
60
- - - "<"
61
- - !ruby/object:Gem::Version
62
- version: '1'
63
47
  type: :runtime
64
48
  prerelease: false
65
49
  version_requirements: !ruby/object:Gem::Requirement
@@ -67,23 +51,34 @@ dependencies:
67
51
  - - ">="
68
52
  - !ruby/object:Gem::Version
69
53
  version: '0.1'
70
- - - "<"
71
- - !ruby/object:Gem::Version
72
- version: '1'
73
54
  - !ruby/object:Gem::Dependency
74
55
  name: noticed
75
56
  requirement: !ruby/object:Gem::Requirement
76
57
  requirements:
77
- - - "~>"
58
+ - - ">="
78
59
  - !ruby/object:Gem::Version
79
60
  version: '2.2'
80
61
  type: :runtime
81
62
  prerelease: false
82
63
  version_requirements: !ruby/object:Gem::Requirement
83
64
  requirements:
84
- - - "~>"
65
+ - - ">="
85
66
  - !ruby/object:Gem::Version
86
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'
87
82
  - !ruby/object:Gem::Dependency
88
83
  name: byebug
89
84
  requirement: !ruby/object:Gem::Requirement
@@ -98,77 +93,146 @@ dependencies:
98
93
  - - ">="
99
94
  - !ruby/object:Gem::Version
100
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'
101
110
  - !ruby/object:Gem::Dependency
102
111
  name: rake
103
112
  requirement: !ruby/object:Gem::Requirement
104
113
  requirements:
105
- - - "~>"
114
+ - - ">="
106
115
  - !ruby/object:Gem::Version
107
116
  version: '13.0'
108
117
  type: :development
109
118
  prerelease: false
110
119
  version_requirements: !ruby/object:Gem::Requirement
111
120
  requirements:
112
- - - "~>"
121
+ - - ">="
113
122
  - !ruby/object:Gem::Version
114
123
  version: '13.0'
115
124
  - !ruby/object:Gem::Dependency
116
125
  name: rspec
117
126
  requirement: !ruby/object:Gem::Requirement
118
127
  requirements:
119
- - - "~>"
128
+ - - ">="
120
129
  - !ruby/object:Gem::Version
121
130
  version: '3.0'
122
131
  type: :development
123
132
  prerelease: false
124
133
  version_requirements: !ruby/object:Gem::Requirement
125
134
  requirements:
126
- - - "~>"
135
+ - - ">="
127
136
  - !ruby/object:Gem::Version
128
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'
129
152
  - !ruby/object:Gem::Dependency
130
153
  name: rubocop
131
154
  requirement: !ruby/object:Gem::Requirement
132
155
  requirements:
133
- - - "~>"
156
+ - - ">="
134
157
  - !ruby/object:Gem::Version
135
158
  version: '1.21'
136
159
  type: :development
137
160
  prerelease: false
138
161
  version_requirements: !ruby/object:Gem::Requirement
139
162
  requirements:
140
- - - "~>"
163
+ - - ">="
141
164
  - !ruby/object:Gem::Version
142
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'
143
180
  - !ruby/object:Gem::Dependency
144
181
  name: rubocop-rake
145
182
  requirement: !ruby/object:Gem::Requirement
146
183
  requirements:
147
- - - "~>"
184
+ - - ">="
148
185
  - !ruby/object:Gem::Version
149
186
  version: '0.6'
150
187
  type: :development
151
188
  prerelease: false
152
189
  version_requirements: !ruby/object:Gem::Requirement
153
190
  requirements:
154
- - - "~>"
191
+ - - ">="
155
192
  - !ruby/object:Gem::Version
156
193
  version: '0.6'
157
194
  - !ruby/object:Gem::Dependency
158
195
  name: rubocop-rspec
159
196
  requirement: !ruby/object:Gem::Requirement
160
197
  requirements:
161
- - - "~>"
198
+ - - ">="
162
199
  - !ruby/object:Gem::Version
163
200
  version: '2.25'
164
201
  type: :development
165
202
  prerelease: false
166
203
  version_requirements: !ruby/object:Gem::Requirement
167
204
  requirements:
168
- - - "~>"
205
+ - - ">="
169
206
  - !ruby/object:Gem::Version
170
207
  version: '2.25'
171
- 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'
172
236
  email:
173
237
  - wimdenbraven@persuavis.com
174
238
  executables: []
@@ -180,6 +244,7 @@ files:
180
244
  - ".ruby-version"
181
245
  - ".yardopts"
182
246
  - CHANGELOG.md
247
+ - CLAUDE.md
183
248
  - Gemfile
184
249
  - Gemfile.lock
185
250
  - LICENSE.txt
@@ -204,7 +269,6 @@ metadata:
204
269
  source_code_uri: https://github.com/persuavis/bp3-noticed
205
270
  changelog_uri: https://github.com/persuavis/bp3-noticed/blob/main/CHANGELOG.md
206
271
  rubygems_mfa_required: 'true'
207
- post_install_message:
208
272
  rdoc_options: []
209
273
  require_paths:
210
274
  - lib
@@ -219,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
283
  - !ruby/object:Gem::Version
220
284
  version: '0'
221
285
  requirements: []
222
- rubygems_version: 3.5.11
223
- signing_key:
286
+ rubygems_version: 3.6.9
224
287
  specification_version: 4
225
288
  summary: bp3-noticed adapts noticed for BP3 (persuavis/black_phoebe_3).
226
289
  test_files: []