stance 0.8.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +158 -116
- data/app/models/stance/event_record.rb +1 -1
- data/lib/stance/event.rb +13 -6
- data/lib/stance/version.rb +1 -1
- data/stance.gemspec +2 -2
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f679d8376ef01172a2fe04995062885020f1810423df94a0621c3d863262267b
|
4
|
+
data.tar.gz: 2941c4c5af5f147eb0105294e19c3d23a7e9b8887fbc67661ea4e59bb14791f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '080ac5b578744bcd5103b049f103718b9bb8ffc5ef878893da96f4618e1097b4b5c4b3ea1296d4f8f06578701b2b2ddc881773623d20c76ce685755c97bf7954'
|
7
|
+
data.tar.gz: 7cdad4e4fd10b3c53081bbca1def4134efdb9d83ec5f4e40991e7238e2451d0b270a1874c27a0f4a1def5cc31f37bce238c893f7ffb03dcd013ab93c61e46c3b
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,197 +1,238 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stance (0.
|
5
|
-
multi_json
|
6
|
-
rails (>= 7.0.
|
4
|
+
stance (0.8.2)
|
5
|
+
multi_json (~> 1.15)
|
6
|
+
rails (>= 7.0, < 8.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (7.
|
12
|
-
actionpack (= 7.
|
13
|
-
activesupport (= 7.
|
11
|
+
actioncable (7.1.2)
|
12
|
+
actionpack (= 7.1.2)
|
13
|
+
activesupport (= 7.1.2)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
zeitwerk (~> 2.6)
|
17
|
+
actionmailbox (7.1.2)
|
18
|
+
actionpack (= 7.1.2)
|
19
|
+
activejob (= 7.1.2)
|
20
|
+
activerecord (= 7.1.2)
|
21
|
+
activestorage (= 7.1.2)
|
22
|
+
activesupport (= 7.1.2)
|
22
23
|
mail (>= 2.7.1)
|
23
24
|
net-imap
|
24
25
|
net-pop
|
25
26
|
net-smtp
|
26
|
-
actionmailer (7.
|
27
|
-
actionpack (= 7.
|
28
|
-
actionview (= 7.
|
29
|
-
activejob (= 7.
|
30
|
-
activesupport (= 7.
|
27
|
+
actionmailer (7.1.2)
|
28
|
+
actionpack (= 7.1.2)
|
29
|
+
actionview (= 7.1.2)
|
30
|
+
activejob (= 7.1.2)
|
31
|
+
activesupport (= 7.1.2)
|
31
32
|
mail (~> 2.5, >= 2.5.4)
|
32
33
|
net-imap
|
33
34
|
net-pop
|
34
35
|
net-smtp
|
35
|
-
rails-dom-testing (~> 2.
|
36
|
-
actionpack (7.
|
37
|
-
actionview (= 7.
|
38
|
-
activesupport (= 7.
|
39
|
-
|
36
|
+
rails-dom-testing (~> 2.2)
|
37
|
+
actionpack (7.1.2)
|
38
|
+
actionview (= 7.1.2)
|
39
|
+
activesupport (= 7.1.2)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
racc
|
42
|
+
rack (>= 2.2.4)
|
43
|
+
rack-session (>= 1.0.1)
|
40
44
|
rack-test (>= 0.6.3)
|
41
|
-
rails-dom-testing (~> 2.
|
42
|
-
rails-html-sanitizer (~> 1.
|
43
|
-
actiontext (7.
|
44
|
-
actionpack (= 7.
|
45
|
-
activerecord (= 7.
|
46
|
-
activestorage (= 7.
|
47
|
-
activesupport (= 7.
|
45
|
+
rails-dom-testing (~> 2.2)
|
46
|
+
rails-html-sanitizer (~> 1.6)
|
47
|
+
actiontext (7.1.2)
|
48
|
+
actionpack (= 7.1.2)
|
49
|
+
activerecord (= 7.1.2)
|
50
|
+
activestorage (= 7.1.2)
|
51
|
+
activesupport (= 7.1.2)
|
48
52
|
globalid (>= 0.6.0)
|
49
53
|
nokogiri (>= 1.8.5)
|
50
|
-
actionview (7.
|
51
|
-
activesupport (= 7.
|
54
|
+
actionview (7.1.2)
|
55
|
+
activesupport (= 7.1.2)
|
52
56
|
builder (~> 3.1)
|
53
|
-
erubi (~> 1.
|
54
|
-
rails-dom-testing (~> 2.
|
55
|
-
rails-html-sanitizer (~> 1.
|
56
|
-
activejob (7.
|
57
|
-
activesupport (= 7.
|
57
|
+
erubi (~> 1.11)
|
58
|
+
rails-dom-testing (~> 2.2)
|
59
|
+
rails-html-sanitizer (~> 1.6)
|
60
|
+
activejob (7.1.2)
|
61
|
+
activesupport (= 7.1.2)
|
58
62
|
globalid (>= 0.3.6)
|
59
|
-
activemodel (7.
|
60
|
-
activesupport (= 7.
|
61
|
-
activerecord (7.
|
62
|
-
activemodel (= 7.
|
63
|
-
activesupport (= 7.
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
activemodel (7.1.2)
|
64
|
+
activesupport (= 7.1.2)
|
65
|
+
activerecord (7.1.2)
|
66
|
+
activemodel (= 7.1.2)
|
67
|
+
activesupport (= 7.1.2)
|
68
|
+
timeout (>= 0.4.0)
|
69
|
+
activestorage (7.1.2)
|
70
|
+
actionpack (= 7.1.2)
|
71
|
+
activejob (= 7.1.2)
|
72
|
+
activerecord (= 7.1.2)
|
73
|
+
activesupport (= 7.1.2)
|
69
74
|
marcel (~> 1.0)
|
70
|
-
|
71
|
-
|
75
|
+
activesupport (7.1.2)
|
76
|
+
base64
|
77
|
+
bigdecimal
|
72
78
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
79
|
+
connection_pool (>= 2.2.5)
|
80
|
+
drb
|
73
81
|
i18n (>= 1.6, < 2)
|
74
82
|
minitest (>= 5.1)
|
83
|
+
mutex_m
|
75
84
|
tzinfo (~> 2.0)
|
76
85
|
ast (2.4.2)
|
77
86
|
autotest-suffix (1.1.0)
|
87
|
+
base64 (0.2.0)
|
88
|
+
bigdecimal (3.1.5)
|
78
89
|
builder (3.2.4)
|
79
90
|
combustion (1.3.7)
|
80
91
|
activesupport (>= 3.0.0)
|
81
92
|
railties (>= 3.0.0)
|
82
93
|
thor (>= 0.14.6)
|
83
|
-
concurrent-ruby (1.
|
94
|
+
concurrent-ruby (1.2.2)
|
95
|
+
connection_pool (2.4.1)
|
84
96
|
crass (1.0.6)
|
85
|
-
date (3.3.
|
97
|
+
date (3.3.4)
|
98
|
+
debug (1.9.1)
|
99
|
+
irb (~> 1.10)
|
100
|
+
reline (>= 0.3.8)
|
101
|
+
drb (2.2.0)
|
102
|
+
ruby2_keywords
|
86
103
|
erubi (1.12.0)
|
87
|
-
globalid (1.
|
88
|
-
activesupport (>=
|
89
|
-
i18n (1.
|
104
|
+
globalid (1.2.1)
|
105
|
+
activesupport (>= 6.1)
|
106
|
+
i18n (1.14.1)
|
90
107
|
concurrent-ruby (~> 1.0)
|
91
|
-
|
92
|
-
|
108
|
+
io-console (0.7.1)
|
109
|
+
irb (1.11.0)
|
110
|
+
rdoc
|
111
|
+
reline (>= 0.3.8)
|
112
|
+
json (2.7.1)
|
113
|
+
language_server-protocol (3.17.0.3)
|
114
|
+
loofah (2.22.0)
|
93
115
|
crass (~> 1.0.2)
|
94
|
-
nokogiri (>= 1.
|
95
|
-
mail (2.8.
|
116
|
+
nokogiri (>= 1.12.0)
|
117
|
+
mail (2.8.1)
|
96
118
|
mini_mime (>= 0.1.1)
|
97
119
|
net-imap
|
98
120
|
net-pop
|
99
121
|
net-smtp
|
100
122
|
marcel (1.0.2)
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
minitest (5.17.0)
|
123
|
+
mini_mime (1.1.5)
|
124
|
+
mini_portile2 (2.8.5)
|
125
|
+
minitest (5.20.0)
|
105
126
|
minitest-autotest (1.1.1)
|
106
127
|
minitest-server (~> 1.0)
|
107
128
|
path_expander (~> 1.0)
|
108
|
-
minitest-focus (1.
|
129
|
+
minitest-focus (1.4.0)
|
109
130
|
minitest (>= 4, < 6)
|
110
131
|
minitest-server (1.0.7)
|
111
132
|
minitest (~> 5.16)
|
112
|
-
mocha (2.0
|
133
|
+
mocha (2.1.0)
|
113
134
|
ruby2_keywords (>= 0.0.5)
|
114
135
|
multi_json (1.15.0)
|
115
|
-
|
136
|
+
mutex_m (0.2.0)
|
137
|
+
net-imap (0.4.9.1)
|
116
138
|
date
|
117
139
|
net-protocol
|
118
140
|
net-pop (0.1.2)
|
119
141
|
net-protocol
|
120
|
-
net-protocol (0.2.
|
142
|
+
net-protocol (0.2.2)
|
121
143
|
timeout
|
122
|
-
net-smtp (0.
|
144
|
+
net-smtp (0.4.0.1)
|
123
145
|
net-protocol
|
124
|
-
nio4r (2.
|
125
|
-
nokogiri (1.
|
126
|
-
mini_portile2 (~> 2.8.
|
146
|
+
nio4r (2.7.0)
|
147
|
+
nokogiri (1.16.0)
|
148
|
+
mini_portile2 (~> 2.8.2)
|
127
149
|
racc (~> 1.4)
|
128
|
-
parallel (1.
|
129
|
-
parser (3.
|
150
|
+
parallel (1.24.0)
|
151
|
+
parser (3.3.0.2)
|
130
152
|
ast (~> 2.4.1)
|
153
|
+
racc
|
131
154
|
path_expander (1.1.1)
|
132
|
-
|
133
|
-
|
134
|
-
|
155
|
+
psych (5.1.2)
|
156
|
+
stringio
|
157
|
+
racc (1.7.3)
|
158
|
+
rack (3.0.8)
|
159
|
+
rack-session (2.0.0)
|
160
|
+
rack (>= 3.0.0)
|
161
|
+
rack-test (2.1.0)
|
135
162
|
rack (>= 1.3)
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
163
|
+
rackup (2.1.0)
|
164
|
+
rack (>= 3)
|
165
|
+
webrick (~> 1.8)
|
166
|
+
rails (7.1.2)
|
167
|
+
actioncable (= 7.1.2)
|
168
|
+
actionmailbox (= 7.1.2)
|
169
|
+
actionmailer (= 7.1.2)
|
170
|
+
actionpack (= 7.1.2)
|
171
|
+
actiontext (= 7.1.2)
|
172
|
+
actionview (= 7.1.2)
|
173
|
+
activejob (= 7.1.2)
|
174
|
+
activemodel (= 7.1.2)
|
175
|
+
activerecord (= 7.1.2)
|
176
|
+
activestorage (= 7.1.2)
|
177
|
+
activesupport (= 7.1.2)
|
148
178
|
bundler (>= 1.15.0)
|
149
|
-
railties (= 7.
|
150
|
-
rails-dom-testing (2.0
|
151
|
-
activesupport (>=
|
179
|
+
railties (= 7.1.2)
|
180
|
+
rails-dom-testing (2.2.0)
|
181
|
+
activesupport (>= 5.0.0)
|
182
|
+
minitest
|
152
183
|
nokogiri (>= 1.6)
|
153
|
-
rails-html-sanitizer (1.
|
154
|
-
loofah (~> 2.
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
184
|
+
rails-html-sanitizer (1.6.0)
|
185
|
+
loofah (~> 2.21)
|
186
|
+
nokogiri (~> 1.14)
|
187
|
+
railties (7.1.2)
|
188
|
+
actionpack (= 7.1.2)
|
189
|
+
activesupport (= 7.1.2)
|
190
|
+
irb
|
191
|
+
rackup (>= 1.0.0)
|
159
192
|
rake (>= 12.2)
|
160
|
-
thor (~> 1.0)
|
161
|
-
zeitwerk (~> 2.
|
193
|
+
thor (~> 1.0, >= 1.2.2)
|
194
|
+
zeitwerk (~> 2.6)
|
162
195
|
rainbow (3.1.1)
|
163
|
-
rake (13.0
|
164
|
-
|
165
|
-
|
166
|
-
|
196
|
+
rake (13.1.0)
|
197
|
+
rdoc (6.6.2)
|
198
|
+
psych (>= 4.0.0)
|
199
|
+
regexp_parser (2.8.3)
|
200
|
+
reline (0.4.2)
|
201
|
+
io-console (~> 0.5)
|
202
|
+
rexml (3.2.6)
|
203
|
+
rubocop (1.59.0)
|
167
204
|
json (~> 2.3)
|
205
|
+
language_server-protocol (>= 3.17.0)
|
168
206
|
parallel (~> 1.10)
|
169
|
-
parser (>= 3.
|
207
|
+
parser (>= 3.2.2.4)
|
170
208
|
rainbow (>= 2.2.2, < 4.0)
|
171
209
|
regexp_parser (>= 1.8, < 3.0)
|
172
210
|
rexml (>= 3.2.5, < 4.0)
|
173
|
-
rubocop-ast (>= 1.
|
211
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
174
212
|
ruby-progressbar (~> 1.7)
|
175
|
-
unicode-display_width (>=
|
176
|
-
rubocop-ast (1.
|
177
|
-
parser (>= 3.
|
178
|
-
rubocop-minitest (0.
|
179
|
-
rubocop (>=
|
213
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
214
|
+
rubocop-ast (1.30.0)
|
215
|
+
parser (>= 3.2.1.0)
|
216
|
+
rubocop-minitest (0.34.3)
|
217
|
+
rubocop (>= 1.39, < 2.0)
|
218
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
180
219
|
rubocop-rake (0.6.0)
|
181
220
|
rubocop (~> 1.0)
|
182
|
-
ruby-progressbar (1.
|
221
|
+
ruby-progressbar (1.13.0)
|
183
222
|
ruby2_keywords (0.0.5)
|
184
|
-
sqlite3 (1.
|
223
|
+
sqlite3 (1.7.0)
|
185
224
|
mini_portile2 (~> 2.8.0)
|
186
|
-
|
187
|
-
|
188
|
-
|
225
|
+
stringio (3.1.0)
|
226
|
+
thor (1.3.0)
|
227
|
+
timeout (0.4.1)
|
228
|
+
tzinfo (2.0.6)
|
189
229
|
concurrent-ruby (~> 1.0)
|
190
|
-
unicode-display_width (2.
|
191
|
-
|
230
|
+
unicode-display_width (2.5.0)
|
231
|
+
webrick (1.8.1)
|
232
|
+
websocket-driver (0.7.6)
|
192
233
|
websocket-extensions (>= 0.1.0)
|
193
234
|
websocket-extensions (0.1.5)
|
194
|
-
zeitwerk (2.6.
|
235
|
+
zeitwerk (2.6.12)
|
195
236
|
|
196
237
|
PLATFORMS
|
197
238
|
ruby
|
@@ -199,6 +240,7 @@ PLATFORMS
|
|
199
240
|
DEPENDENCIES
|
200
241
|
autotest-suffix
|
201
242
|
combustion
|
243
|
+
debug
|
202
244
|
minitest
|
203
245
|
minitest-autotest
|
204
246
|
minitest-focus
|
data/lib/stance/event.rb
CHANGED
@@ -8,6 +8,8 @@ module Stance
|
|
8
8
|
attr_reader :record, :options, :name
|
9
9
|
|
10
10
|
class << self
|
11
|
+
attr_accessor :callback_methods
|
12
|
+
|
11
13
|
def before_create(*methods, &block)
|
12
14
|
set_callback :create, :before, *methods, &block
|
13
15
|
end
|
@@ -15,6 +17,15 @@ module Stance
|
|
15
17
|
def after_create(*methods, &block)
|
16
18
|
set_callback :create, :after, *methods, &block
|
17
19
|
end
|
20
|
+
|
21
|
+
def method_added(method_name)
|
22
|
+
super
|
23
|
+
|
24
|
+
return if self == Stance::Event
|
25
|
+
|
26
|
+
self.callback_methods ||= []
|
27
|
+
self.callback_methods << method_name
|
28
|
+
end
|
18
29
|
end
|
19
30
|
|
20
31
|
def initialize(name, subject, metadata, options)
|
@@ -44,9 +55,9 @@ module Stance
|
|
44
55
|
run_callbacks :create do
|
45
56
|
# Call each public method of the Event class if a custom class.
|
46
57
|
if self.class.name != 'Stance::Event'
|
47
|
-
Rails.logger.
|
58
|
+
Rails.logger.debug "Event: #{full_name}"
|
48
59
|
|
49
|
-
callback_methods
|
60
|
+
self.class.callback_methods&.each { |method| send method }
|
50
61
|
end
|
51
62
|
|
52
63
|
record.save if @options[:record]
|
@@ -66,10 +77,6 @@ module Stance
|
|
66
77
|
|
67
78
|
private
|
68
79
|
|
69
|
-
def callback_methods
|
70
|
-
public_methods(false) - Stance::Event.instance_methods(false)
|
71
|
-
end
|
72
|
-
|
73
80
|
# Event is a singleton and already exists.
|
74
81
|
def singleton_exists?
|
75
82
|
options[:singleton] && subject.events.active.exists?(name: name)
|
data/lib/stance/version.rb
CHANGED
data/stance.gemspec
CHANGED
metadata
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Moss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.15'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.15'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 7.0
|
33
|
+
version: '7.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '8.0'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version: 7.0
|
43
|
+
version: '7.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '8.0'
|
41
47
|
description:
|
42
48
|
email:
|
43
49
|
- joel@developwithstyle.com
|
@@ -91,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
97
|
- !ruby/object:Gem::Version
|
92
98
|
version: '0'
|
93
99
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
100
|
+
rubygems_version: 3.5.3
|
95
101
|
signing_key:
|
96
102
|
specification_version: 4
|
97
103
|
summary: Event System for Rails
|