stance 0.8.3 → 0.9.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.
@@ -0,0 +1,297 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ stance (0.8.3)
5
+ multi_json (~> 1.15)
6
+ rails (>= 7.0, < 9.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (8.0.1)
12
+ actionpack (= 8.0.1)
13
+ activesupport (= 8.0.1)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ zeitwerk (~> 2.6)
17
+ actionmailbox (8.0.1)
18
+ actionpack (= 8.0.1)
19
+ activejob (= 8.0.1)
20
+ activerecord (= 8.0.1)
21
+ activestorage (= 8.0.1)
22
+ activesupport (= 8.0.1)
23
+ mail (>= 2.8.0)
24
+ actionmailer (8.0.1)
25
+ actionpack (= 8.0.1)
26
+ actionview (= 8.0.1)
27
+ activejob (= 8.0.1)
28
+ activesupport (= 8.0.1)
29
+ mail (>= 2.8.0)
30
+ rails-dom-testing (~> 2.2)
31
+ actionpack (8.0.1)
32
+ actionview (= 8.0.1)
33
+ activesupport (= 8.0.1)
34
+ nokogiri (>= 1.8.5)
35
+ rack (>= 2.2.4)
36
+ rack-session (>= 1.0.1)
37
+ rack-test (>= 0.6.3)
38
+ rails-dom-testing (~> 2.2)
39
+ rails-html-sanitizer (~> 1.6)
40
+ useragent (~> 0.16)
41
+ actiontext (8.0.1)
42
+ actionpack (= 8.0.1)
43
+ activerecord (= 8.0.1)
44
+ activestorage (= 8.0.1)
45
+ activesupport (= 8.0.1)
46
+ globalid (>= 0.6.0)
47
+ nokogiri (>= 1.8.5)
48
+ actionview (8.0.1)
49
+ activesupport (= 8.0.1)
50
+ builder (~> 3.1)
51
+ erubi (~> 1.11)
52
+ rails-dom-testing (~> 2.2)
53
+ rails-html-sanitizer (~> 1.6)
54
+ activejob (8.0.1)
55
+ activesupport (= 8.0.1)
56
+ globalid (>= 0.3.6)
57
+ activemodel (8.0.1)
58
+ activesupport (= 8.0.1)
59
+ activerecord (8.0.1)
60
+ activemodel (= 8.0.1)
61
+ activesupport (= 8.0.1)
62
+ timeout (>= 0.4.0)
63
+ activestorage (8.0.1)
64
+ actionpack (= 8.0.1)
65
+ activejob (= 8.0.1)
66
+ activerecord (= 8.0.1)
67
+ activesupport (= 8.0.1)
68
+ marcel (~> 1.0)
69
+ activesupport (8.0.1)
70
+ base64
71
+ benchmark (>= 0.3)
72
+ bigdecimal
73
+ concurrent-ruby (~> 1.0, >= 1.3.1)
74
+ connection_pool (>= 2.2.5)
75
+ drb
76
+ i18n (>= 1.6, < 2)
77
+ logger (>= 1.4.2)
78
+ minitest (>= 5.1)
79
+ securerandom (>= 0.3)
80
+ tzinfo (~> 2.0, >= 2.0.5)
81
+ uri (>= 0.13.1)
82
+ appraisal (2.5.0)
83
+ bundler
84
+ rake
85
+ thor (>= 0.14.0)
86
+ ast (2.4.2)
87
+ autotest-suffix (1.1.0)
88
+ base64 (0.2.0)
89
+ benchmark (0.4.0)
90
+ bigdecimal (3.1.9)
91
+ builder (3.3.0)
92
+ combustion (1.5.0)
93
+ activesupport (>= 3.0.0)
94
+ railties (>= 3.0.0)
95
+ thor (>= 0.14.6)
96
+ concurrent-ruby (1.3.5)
97
+ connection_pool (2.5.0)
98
+ crass (1.0.6)
99
+ date (3.4.1)
100
+ debug (1.10.0)
101
+ irb (~> 1.10)
102
+ reline (>= 0.3.8)
103
+ drb (2.2.1)
104
+ erubi (1.13.1)
105
+ globalid (1.2.1)
106
+ activesupport (>= 6.1)
107
+ i18n (1.14.7)
108
+ concurrent-ruby (~> 1.0)
109
+ io-console (0.8.0)
110
+ irb (1.15.1)
111
+ pp (>= 0.6.0)
112
+ rdoc (>= 4.0.0)
113
+ reline (>= 0.4.2)
114
+ json (2.10.1)
115
+ language_server-protocol (3.17.0.4)
116
+ lint_roller (1.1.0)
117
+ logger (1.6.6)
118
+ loofah (2.24.0)
119
+ crass (~> 1.0.2)
120
+ nokogiri (>= 1.12.0)
121
+ mail (2.8.1)
122
+ mini_mime (>= 0.1.1)
123
+ net-imap
124
+ net-pop
125
+ net-smtp
126
+ marcel (1.0.4)
127
+ mini_mime (1.1.5)
128
+ minitest (5.25.4)
129
+ minitest-autotest (1.1.1)
130
+ minitest-server (~> 1.0)
131
+ path_expander (~> 1.0)
132
+ minitest-focus (1.4.0)
133
+ minitest (>= 4, < 6)
134
+ minitest-server (1.0.8)
135
+ drb (~> 2.0)
136
+ minitest (~> 5.16)
137
+ mocha (2.7.1)
138
+ ruby2_keywords (>= 0.0.5)
139
+ multi_json (1.15.0)
140
+ net-imap (0.5.6)
141
+ date
142
+ net-protocol
143
+ net-pop (0.1.2)
144
+ net-protocol
145
+ net-protocol (0.2.2)
146
+ timeout
147
+ net-smtp (0.5.1)
148
+ net-protocol
149
+ nio4r (2.7.4)
150
+ nokogiri (1.18.3-aarch64-linux-gnu)
151
+ racc (~> 1.4)
152
+ nokogiri (1.18.3-aarch64-linux-musl)
153
+ racc (~> 1.4)
154
+ nokogiri (1.18.3-arm-linux-gnu)
155
+ racc (~> 1.4)
156
+ nokogiri (1.18.3-arm-linux-musl)
157
+ racc (~> 1.4)
158
+ nokogiri (1.18.3-arm64-darwin)
159
+ racc (~> 1.4)
160
+ nokogiri (1.18.3-x86_64-darwin)
161
+ racc (~> 1.4)
162
+ nokogiri (1.18.3-x86_64-linux-gnu)
163
+ racc (~> 1.4)
164
+ nokogiri (1.18.3-x86_64-linux-musl)
165
+ racc (~> 1.4)
166
+ parallel (1.26.3)
167
+ parser (3.3.7.1)
168
+ ast (~> 2.4.1)
169
+ racc
170
+ path_expander (1.1.3)
171
+ pp (0.6.2)
172
+ prettyprint
173
+ prettyprint (0.2.0)
174
+ psych (5.2.3)
175
+ date
176
+ stringio
177
+ racc (1.8.1)
178
+ rack (3.1.11)
179
+ rack-session (2.1.0)
180
+ base64 (>= 0.1.0)
181
+ rack (>= 3.0.0)
182
+ rack-test (2.2.0)
183
+ rack (>= 1.3)
184
+ rackup (2.2.1)
185
+ rack (>= 3)
186
+ rails (8.0.1)
187
+ actioncable (= 8.0.1)
188
+ actionmailbox (= 8.0.1)
189
+ actionmailer (= 8.0.1)
190
+ actionpack (= 8.0.1)
191
+ actiontext (= 8.0.1)
192
+ actionview (= 8.0.1)
193
+ activejob (= 8.0.1)
194
+ activemodel (= 8.0.1)
195
+ activerecord (= 8.0.1)
196
+ activestorage (= 8.0.1)
197
+ activesupport (= 8.0.1)
198
+ bundler (>= 1.15.0)
199
+ railties (= 8.0.1)
200
+ rails-dom-testing (2.2.0)
201
+ activesupport (>= 5.0.0)
202
+ minitest
203
+ nokogiri (>= 1.6)
204
+ rails-html-sanitizer (1.6.2)
205
+ loofah (~> 2.21)
206
+ 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)
207
+ railties (8.0.1)
208
+ actionpack (= 8.0.1)
209
+ activesupport (= 8.0.1)
210
+ irb (~> 1.13)
211
+ rackup (>= 1.0.0)
212
+ rake (>= 12.2)
213
+ thor (~> 1.0, >= 1.2.2)
214
+ zeitwerk (~> 2.6)
215
+ rainbow (3.1.1)
216
+ rake (13.2.1)
217
+ rdoc (6.12.0)
218
+ psych (>= 4.0.0)
219
+ regexp_parser (2.10.0)
220
+ reline (0.6.0)
221
+ io-console (~> 0.5)
222
+ rubocop (1.73.2)
223
+ json (~> 2.3)
224
+ language_server-protocol (~> 3.17.0.2)
225
+ lint_roller (~> 1.1.0)
226
+ parallel (~> 1.10)
227
+ parser (>= 3.3.0.2)
228
+ rainbow (>= 2.2.2, < 4.0)
229
+ regexp_parser (>= 2.9.3, < 3.0)
230
+ rubocop-ast (>= 1.38.0, < 2.0)
231
+ ruby-progressbar (~> 1.7)
232
+ unicode-display_width (>= 2.4.0, < 4.0)
233
+ rubocop-ast (1.38.1)
234
+ parser (>= 3.3.1.0)
235
+ rubocop-minitest (0.37.1)
236
+ lint_roller (~> 1.1)
237
+ rubocop (>= 1.72.1, < 2.0)
238
+ rubocop-ast (>= 1.38.0, < 2.0)
239
+ rubocop-rake (0.7.1)
240
+ lint_roller (~> 1.1)
241
+ rubocop (>= 1.72.1)
242
+ ruby-progressbar (1.13.0)
243
+ ruby2_keywords (0.0.5)
244
+ securerandom (0.4.1)
245
+ sqlite3 (2.6.0-aarch64-linux-gnu)
246
+ sqlite3 (2.6.0-aarch64-linux-musl)
247
+ sqlite3 (2.6.0-arm-linux-gnu)
248
+ sqlite3 (2.6.0-arm-linux-musl)
249
+ sqlite3 (2.6.0-arm64-darwin)
250
+ sqlite3 (2.6.0-x86_64-darwin)
251
+ sqlite3 (2.6.0-x86_64-linux-gnu)
252
+ sqlite3 (2.6.0-x86_64-linux-musl)
253
+ stringio (3.1.5)
254
+ thor (1.3.2)
255
+ timeout (0.4.3)
256
+ tzinfo (2.0.6)
257
+ concurrent-ruby (~> 1.0)
258
+ unicode-display_width (3.1.4)
259
+ unicode-emoji (~> 4.0, >= 4.0.4)
260
+ unicode-emoji (4.0.4)
261
+ uri (1.0.3)
262
+ useragent (0.16.11)
263
+ websocket-driver (0.7.7)
264
+ base64
265
+ websocket-extensions (>= 0.1.0)
266
+ websocket-extensions (0.1.5)
267
+ zeitwerk (2.7.2)
268
+
269
+ PLATFORMS
270
+ aarch64-linux-gnu
271
+ aarch64-linux-musl
272
+ arm-linux-gnu
273
+ arm-linux-musl
274
+ arm64-darwin
275
+ x86_64-darwin
276
+ x86_64-linux-gnu
277
+ x86_64-linux-musl
278
+
279
+ DEPENDENCIES
280
+ appraisal
281
+ autotest-suffix
282
+ combustion
283
+ debug
284
+ minitest
285
+ minitest-autotest
286
+ minitest-focus
287
+ mocha
288
+ rails (~> 8.0.1)
289
+ rake (~> 13.0)
290
+ rubocop
291
+ rubocop-minitest
292
+ rubocop-rake
293
+ sqlite3
294
+ stance!
295
+
296
+ BUNDLED WITH
297
+ 2.6.5
@@ -13,7 +13,7 @@ module Stance
13
13
 
14
14
  def copy_migration
15
15
  migration_template 'migration.rb', 'db/migrate/create_stance_event_record.rb',
16
- migration_version: migration_version
16
+ migration_version:
17
17
  end
18
18
 
19
19
  def migration_version
data/lib/stance/event.rb CHANGED
@@ -10,12 +10,12 @@ module Stance
10
10
  class << self
11
11
  attr_accessor :callback_methods
12
12
 
13
- def before_create(*methods, &block)
14
- set_callback :create, :before, *methods, &block
13
+ def before_create(*methods, &)
14
+ set_callback(:create, :before, *methods, &)
15
15
  end
16
16
 
17
- def after_create(*methods, &block)
18
- set_callback :create, :after, *methods, &block
17
+ def after_create(*methods, &)
18
+ set_callback(:create, :after, *methods, &)
19
19
  end
20
20
 
21
21
  def method_added(method_name)
@@ -34,7 +34,7 @@ module Stance
34
34
  @metadata = metadata
35
35
  @options = { singleton: false, record: true, class: false }.merge(options)
36
36
 
37
- attrs = { name: name, metadata: metadata }
37
+ attrs = { name:, metadata: }
38
38
  if subject.is_a?(ActiveRecord::Base)
39
39
  attrs[:subject] = subject
40
40
  elsif subject.is_a?(Class) && subject < ActiveRecord::Base
@@ -79,7 +79,7 @@ module Stance
79
79
 
80
80
  # Event is a singleton and already exists.
81
81
  def singleton_exists?
82
- options[:singleton] && subject.events.active.exists?(name: name)
82
+ options[:singleton] && subject.events.active.exists?(name:)
83
83
  end
84
84
  end
85
85
  end
data/lib/stance/events.rb CHANGED
@@ -26,12 +26,12 @@ module Stance
26
26
  @events[sname] = options
27
27
  end
28
28
 
29
- def before_create(*methods, &block)
30
- set_callback :create, :before, *methods, &block
29
+ def before_create(*methods, &)
30
+ set_callback(:create, :before, *methods, &)
31
31
  end
32
32
 
33
- def after_create(*methods, &block)
34
- set_callback :create, :after, *methods, &block
33
+ def after_create(*methods, &)
34
+ set_callback(:create, :after, *methods, &)
35
35
  end
36
36
  end
37
37
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stance
4
- VERSION = '0.8.3'
4
+ VERSION = '0.9.0'
5
5
  end
data/stance.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Event System for Rails'
12
12
  spec.homepage = 'https://github.com/joelmoss/stance'
13
13
  spec.license = 'MIT'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.2.0')
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
@@ -25,6 +25,5 @@ Gem::Specification.new do |spec|
25
25
  end
26
26
  spec.require_paths = ['lib']
27
27
 
28
- spec.add_dependency 'multi_json', '~> 1.15'
29
- spec.add_dependency 'rails', ['>= 7.0', '< 8.0']
28
+ spec.add_dependency 'rails', ['>= 7.0', '< 9.0']
30
29
  end
metadata CHANGED
@@ -1,29 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
10
+ date: 2025-03-07 00:00:00.000000000 Z
12
11
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: multi_json
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.15'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.15'
27
12
  - !ruby/object:Gem::Dependency
28
13
  name: rails
29
14
  requirement: !ruby/object:Gem::Requirement
@@ -33,7 +18,7 @@ dependencies:
33
18
  version: '7.0'
34
19
  - - "<"
35
20
  - !ruby/object:Gem::Version
36
- version: '8.0'
21
+ version: '9.0'
37
22
  type: :runtime
38
23
  prerelease: false
39
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,8 +28,7 @@ dependencies:
43
28
  version: '7.0'
44
29
  - - "<"
45
30
  - !ruby/object:Gem::Version
46
- version: '8.0'
47
- description:
31
+ version: '9.0'
48
32
  email:
49
33
  - joel@developwithstyle.com
50
34
  executables: []
@@ -52,9 +36,12 @@ extensions: []
52
36
  extra_rdoc_files: []
53
37
  files:
54
38
  - ".autotest"
39
+ - ".github/workflows/main.yml"
55
40
  - ".gitignore"
56
41
  - ".rubocop.yml"
42
+ - ".ruby-version"
57
43
  - ".travis.yml"
44
+ - Appraisals
58
45
  - CODE_OF_CONDUCT.md
59
46
  - Gemfile
60
47
  - Gemfile.lock
@@ -63,6 +50,12 @@ files:
63
50
  - Rakefile
64
51
  - app/models/stance/event_record.rb
65
52
  - config.ru
53
+ - gemfiles/rails_7.1.gemfile
54
+ - gemfiles/rails_7.1.gemfile.lock
55
+ - gemfiles/rails_7.2.gemfile
56
+ - gemfiles/rails_7.2.gemfile.lock
57
+ - gemfiles/rails_8.gemfile
58
+ - gemfiles/rails_8.gemfile.lock
66
59
  - lib/generators/stance/install_generator.rb
67
60
  - lib/generators/stance/templates/migration.rb.tt
68
61
  - lib/stance.rb
@@ -82,7 +75,6 @@ metadata:
82
75
  source_code_uri: https://github.com/joelmoss/stance
83
76
  changelog_uri: https://github.com/joelmoss/stance/releases
84
77
  rubygems_mfa_required: 'true'
85
- post_install_message:
86
78
  rdoc_options: []
87
79
  require_paths:
88
80
  - lib
@@ -90,15 +82,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
82
  requirements:
91
83
  - - ">="
92
84
  - !ruby/object:Gem::Version
93
- version: 2.7.0
85
+ version: 3.2.0
94
86
  required_rubygems_version: !ruby/object:Gem::Requirement
95
87
  requirements:
96
88
  - - ">="
97
89
  - !ruby/object:Gem::Version
98
90
  version: '0'
99
91
  requirements: []
100
- rubygems_version: 3.5.3
101
- signing_key:
92
+ rubygems_version: 3.6.5
102
93
  specification_version: 4
103
94
  summary: Event System for Rails
104
95
  test_files: []