statesman 9.0.0 → 13.0.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 +4 -4
- data/.devcontainer/devcontainer.json +31 -0
- data/.devcontainer/docker-compose.yml +39 -0
- data/.github/workflows/tests.yml +130 -0
- data/.gitignore +65 -15
- data/.rspec +2 -0
- data/.rubocop.yml +11 -1
- data/.rubocop_todo.yml +23 -38
- data/.ruby-version +1 -1
- data/CHANGELOG.md +229 -43
- data/CONTRIBUTING.md +14 -13
- data/Gemfile +18 -3
- data/README.md +203 -74
- data/docs/COMPATIBILITY.md +3 -3
- data/lib/generators/statesman/active_record_transition_generator.rb +1 -1
- data/lib/generators/statesman/generator_helpers.rb +2 -2
- data/lib/statesman/adapters/active_record.rb +69 -52
- data/lib/statesman/adapters/active_record_queries.rb +15 -7
- data/lib/statesman/adapters/active_record_transition.rb +5 -1
- data/lib/statesman/adapters/memory.rb +1 -1
- data/lib/statesman/adapters/type_safe_active_record_queries.rb +21 -0
- data/lib/statesman/callback.rb +2 -2
- data/lib/statesman/config.rb +3 -10
- data/lib/statesman/exceptions.rb +9 -7
- data/lib/statesman/guard.rb +1 -1
- data/lib/statesman/machine.rb +60 -0
- data/lib/statesman/version.rb +1 -1
- data/lib/statesman.rb +5 -5
- data/lib/tasks/statesman.rake +5 -5
- data/spec/generators/statesman/active_record_transition_generator_spec.rb +7 -1
- data/spec/generators/statesman/migration_generator_spec.rb +5 -1
- data/spec/spec_helper.rb +44 -7
- data/spec/statesman/adapters/active_record_queries_spec.rb +8 -10
- data/spec/statesman/adapters/active_record_spec.rb +144 -55
- data/spec/statesman/adapters/active_record_transition_spec.rb +5 -2
- data/spec/statesman/adapters/memory_spec.rb +0 -1
- data/spec/statesman/adapters/memory_transition_spec.rb +0 -1
- data/spec/statesman/adapters/shared_examples.rb +6 -7
- data/spec/statesman/adapters/type_safe_active_record_queries_spec.rb +206 -0
- data/spec/statesman/callback_spec.rb +0 -2
- data/spec/statesman/config_spec.rb +0 -2
- data/spec/statesman/exceptions_spec.rb +8 -4
- data/spec/statesman/guard_spec.rb +0 -2
- data/spec/statesman/machine_spec.rb +231 -19
- data/spec/statesman/utils_spec.rb +0 -2
- data/spec/support/active_record.rb +156 -29
- data/spec/support/exactly_query_databases.rb +35 -0
- data/statesman.gemspec +2 -17
- metadata +14 -238
- data/.circleci/config.yml +0 -127
|
@@ -20,10 +20,21 @@ class MyStateMachine
|
|
|
20
20
|
transition from: :failed, to: :initial
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
class MyActiveRecordModelTransition < ActiveRecord::Base
|
|
24
|
+
include Statesman::Adapters::ActiveRecordTransition
|
|
25
|
+
|
|
26
|
+
belongs_to :my_active_record_model
|
|
27
|
+
end
|
|
28
|
+
|
|
23
29
|
class MyActiveRecordModel < ActiveRecord::Base
|
|
24
30
|
has_many :my_active_record_model_transitions, autosave: false
|
|
25
31
|
alias_method :transitions, :my_active_record_model_transitions
|
|
26
32
|
|
|
33
|
+
include Statesman::Adapters::ActiveRecordQueries[
|
|
34
|
+
transition_class: MyActiveRecordModelTransition,
|
|
35
|
+
initial_state: :initial,
|
|
36
|
+
]
|
|
37
|
+
|
|
27
38
|
def state_machine
|
|
28
39
|
@state_machine ||= MyStateMachine.new(
|
|
29
40
|
self, transition_class: MyActiveRecordModelTransition
|
|
@@ -33,25 +44,17 @@ class MyActiveRecordModel < ActiveRecord::Base
|
|
|
33
44
|
def metadata
|
|
34
45
|
super || {}
|
|
35
46
|
end
|
|
36
|
-
|
|
37
|
-
def reload(*)
|
|
38
|
-
state_machine.reset
|
|
39
|
-
super
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
class MyActiveRecordModelTransition < ActiveRecord::Base
|
|
44
|
-
include Statesman::Adapters::ActiveRecordTransition
|
|
45
|
-
|
|
46
|
-
belongs_to :my_active_record_model
|
|
47
|
-
serialize :metadata, JSON
|
|
48
47
|
end
|
|
49
48
|
|
|
50
49
|
class MyActiveRecordModelTransitionWithoutInclude < ActiveRecord::Base
|
|
51
50
|
self.table_name = "my_active_record_model_transitions"
|
|
52
51
|
|
|
53
52
|
belongs_to :my_active_record_model
|
|
54
|
-
|
|
53
|
+
if ::ActiveRecord.gem_version >= Gem::Version.new("7.1")
|
|
54
|
+
serialize :metadata, coder: JSON
|
|
55
|
+
else
|
|
56
|
+
serialize :metadata, JSON
|
|
57
|
+
end
|
|
55
58
|
end
|
|
56
59
|
|
|
57
60
|
class CreateMyActiveRecordModelMigration < MIGRATION_CLASS
|
|
@@ -64,7 +67,6 @@ class CreateMyActiveRecordModelMigration < MIGRATION_CLASS
|
|
|
64
67
|
end
|
|
65
68
|
|
|
66
69
|
# TODO: make this a module we can extend from the app? Or a generator?
|
|
67
|
-
# rubocop:disable Metrics/MethodLength
|
|
68
70
|
class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
69
71
|
def change
|
|
70
72
|
create_table :my_active_record_model_transitions do |t|
|
|
@@ -79,7 +81,7 @@ class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
|
79
81
|
t.text :metadata, default: "{}"
|
|
80
82
|
end
|
|
81
83
|
|
|
82
|
-
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
|
|
84
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
83
85
|
t.boolean :most_recent, default: true, null: false
|
|
84
86
|
else
|
|
85
87
|
t.boolean :most_recent, default: true
|
|
@@ -96,7 +98,7 @@ class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
|
96
98
|
%i[my_active_record_model_id sort_key],
|
|
97
99
|
unique: true, name: "sort_key_index"
|
|
98
100
|
|
|
99
|
-
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
|
|
101
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
100
102
|
add_index :my_active_record_model_transitions,
|
|
101
103
|
%i[my_active_record_model_id most_recent],
|
|
102
104
|
unique: true,
|
|
@@ -110,7 +112,6 @@ class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
|
110
112
|
end
|
|
111
113
|
end
|
|
112
114
|
end
|
|
113
|
-
# rubocop:enable Metrics/MethodLength
|
|
114
115
|
|
|
115
116
|
class OtherActiveRecordModel < ActiveRecord::Base
|
|
116
117
|
has_many :other_active_record_model_transitions, autosave: false
|
|
@@ -131,7 +132,48 @@ class OtherActiveRecordModelTransition < ActiveRecord::Base
|
|
|
131
132
|
include Statesman::Adapters::ActiveRecordTransition
|
|
132
133
|
|
|
133
134
|
belongs_to :other_active_record_model
|
|
134
|
-
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
class SecondaryRecord < ActiveRecord::Base
|
|
138
|
+
self.abstract_class = true
|
|
139
|
+
|
|
140
|
+
connects_to database: { writing: :secondary, reading: :secondary }
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
class SecondaryActiveRecordModelTransition < SecondaryRecord
|
|
144
|
+
self.table_name = "my_active_record_model_transitions"
|
|
145
|
+
|
|
146
|
+
include Statesman::Adapters::ActiveRecordTransition
|
|
147
|
+
|
|
148
|
+
belongs_to :my_active_record_model,
|
|
149
|
+
class_name: "SecondaryActiveRecordModel",
|
|
150
|
+
foreign_key: "my_active_record_model_transition_id"
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
class SecondaryActiveRecordModel < SecondaryRecord
|
|
154
|
+
self.table_name = "my_active_record_models"
|
|
155
|
+
|
|
156
|
+
has_many :my_active_record_model_transitions,
|
|
157
|
+
class_name: "SecondaryActiveRecordModelTransition",
|
|
158
|
+
foreign_key: "my_active_record_model_id",
|
|
159
|
+
autosave: false
|
|
160
|
+
|
|
161
|
+
alias_method :transitions, :my_active_record_model_transitions
|
|
162
|
+
|
|
163
|
+
include Statesman::Adapters::ActiveRecordQueries[
|
|
164
|
+
transition_class: SecondaryActiveRecordModelTransition,
|
|
165
|
+
initial_state: :initial,
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
def state_machine
|
|
169
|
+
@state_machine ||= MyStateMachine.new(
|
|
170
|
+
self, transition_class: SecondaryActiveRecordModelTransition
|
|
171
|
+
)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def metadata
|
|
175
|
+
super || {}
|
|
176
|
+
end
|
|
135
177
|
end
|
|
136
178
|
|
|
137
179
|
class CreateOtherActiveRecordModelMigration < MIGRATION_CLASS
|
|
@@ -144,7 +186,6 @@ class CreateOtherActiveRecordModelMigration < MIGRATION_CLASS
|
|
|
144
186
|
end
|
|
145
187
|
end
|
|
146
188
|
|
|
147
|
-
# rubocop:disable Metrics/MethodLength
|
|
148
189
|
class CreateOtherActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
149
190
|
def change
|
|
150
191
|
create_table :other_active_record_model_transitions do |t|
|
|
@@ -159,7 +200,7 @@ class CreateOtherActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
|
159
200
|
t.text :metadata, default: "{}"
|
|
160
201
|
end
|
|
161
202
|
|
|
162
|
-
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
|
|
203
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
163
204
|
t.boolean :most_recent, default: true, null: false
|
|
164
205
|
else
|
|
165
206
|
t.boolean :most_recent, default: true
|
|
@@ -172,23 +213,22 @@ class CreateOtherActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
|
172
213
|
%i[other_active_record_model_id sort_key],
|
|
173
214
|
unique: true, name: "other_sort_key_index"
|
|
174
215
|
|
|
175
|
-
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
|
|
216
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
176
217
|
add_index :other_active_record_model_transitions,
|
|
177
218
|
%i[other_active_record_model_id most_recent],
|
|
178
219
|
unique: true,
|
|
179
220
|
where: "most_recent",
|
|
180
|
-
name: "index_other_active_record_model_transitions_"\
|
|
221
|
+
name: "index_other_active_record_model_transitions_" \
|
|
181
222
|
"parent_latest"
|
|
182
223
|
else
|
|
183
224
|
add_index :other_active_record_model_transitions,
|
|
184
225
|
%i[other_active_record_model_id most_recent],
|
|
185
226
|
unique: true,
|
|
186
|
-
name: "index_other_active_record_model_transitions_"\
|
|
227
|
+
name: "index_other_active_record_model_transitions_" \
|
|
187
228
|
"parent_latest"
|
|
188
229
|
end
|
|
189
230
|
end
|
|
190
231
|
end
|
|
191
|
-
# rubocop:enable Metrics/MethodLength
|
|
192
232
|
|
|
193
233
|
class DropMostRecentColumn < MIGRATION_CLASS
|
|
194
234
|
def change
|
|
@@ -225,7 +265,6 @@ module MyNamespace
|
|
|
225
265
|
|
|
226
266
|
belongs_to :my_active_record_model,
|
|
227
267
|
class_name: "MyNamespace::MyActiveRecordModel"
|
|
228
|
-
serialize :metadata, JSON
|
|
229
268
|
|
|
230
269
|
def self.table_name_prefix
|
|
231
270
|
"my_namespace_"
|
|
@@ -242,7 +281,6 @@ class CreateNamespacedARModelMigration < MIGRATION_CLASS
|
|
|
242
281
|
end
|
|
243
282
|
end
|
|
244
283
|
|
|
245
|
-
# rubocop:disable Metrics/MethodLength
|
|
246
284
|
class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
|
|
247
285
|
def change
|
|
248
286
|
create_table :my_namespace_my_active_record_model_transitions do |t|
|
|
@@ -257,7 +295,7 @@ class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
|
|
|
257
295
|
t.text :metadata, default: "{}"
|
|
258
296
|
end
|
|
259
297
|
|
|
260
|
-
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
|
|
298
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
261
299
|
t.boolean :most_recent, default: true, null: false
|
|
262
300
|
else
|
|
263
301
|
t.boolean :most_recent, default: true
|
|
@@ -269,7 +307,7 @@ class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
|
|
|
269
307
|
add_index :my_namespace_my_active_record_model_transitions, :sort_key,
|
|
270
308
|
unique: true, name: "my_namespaced_key"
|
|
271
309
|
|
|
272
|
-
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
|
|
310
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
273
311
|
add_index :my_namespace_my_active_record_model_transitions,
|
|
274
312
|
%i[my_active_record_model_id most_recent],
|
|
275
313
|
unique: true,
|
|
@@ -282,5 +320,94 @@ class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
|
|
|
282
320
|
name: "index_namespace_model_transitions_parent_latest"
|
|
283
321
|
end
|
|
284
322
|
end
|
|
285
|
-
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
class StiActiveRecordModel < ActiveRecord::Base
|
|
326
|
+
has_many :sti_a_active_record_model_transitions, autosave: false
|
|
327
|
+
has_many :sti_b_active_record_model_transitions, autosave: false
|
|
328
|
+
|
|
329
|
+
def state_machine_a
|
|
330
|
+
@state_machine_a ||= MyStateMachine.new(
|
|
331
|
+
self, transition_class: StiAActiveRecordModelTransition
|
|
332
|
+
)
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
def state_machine_b
|
|
336
|
+
@state_machine_b ||= MyStateMachine.new(
|
|
337
|
+
self, transition_class: StiBActiveRecordModelTransition
|
|
338
|
+
)
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
def metadata
|
|
342
|
+
super || {}
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
def reload(*)
|
|
346
|
+
state_machine_a.reset
|
|
347
|
+
state_machine_b.reset
|
|
348
|
+
super
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
class StiActiveRecordModelTransition < ActiveRecord::Base
|
|
353
|
+
include Statesman::Adapters::ActiveRecordTransition
|
|
354
|
+
|
|
355
|
+
belongs_to :sti_active_record_model
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
class StiAActiveRecordModelTransition < StiActiveRecordModelTransition
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
class StiBActiveRecordModelTransition < StiActiveRecordModelTransition
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
class CreateStiActiveRecordModelMigration < MIGRATION_CLASS
|
|
365
|
+
def change
|
|
366
|
+
create_table :sti_active_record_models do |t|
|
|
367
|
+
t.timestamps null: false
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
class CreateStiActiveRecordModelTransitionMigration < MIGRATION_CLASS
|
|
373
|
+
def change
|
|
374
|
+
create_table :sti_active_record_model_transitions do |t|
|
|
375
|
+
t.string :to_state
|
|
376
|
+
t.integer :sti_active_record_model_id
|
|
377
|
+
t.integer :sort_key
|
|
378
|
+
t.string :type
|
|
379
|
+
|
|
380
|
+
# MySQL doesn't allow default values on text fields
|
|
381
|
+
if ActiveRecord::Base.connection.adapter_name == "Mysql2"
|
|
382
|
+
t.text :metadata
|
|
383
|
+
else
|
|
384
|
+
t.text :metadata, default: "{}"
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
388
|
+
t.boolean :most_recent, default: true, null: false
|
|
389
|
+
else
|
|
390
|
+
t.boolean :most_recent, default: true
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
t.timestamps null: false
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
add_index :sti_active_record_model_transitions,
|
|
397
|
+
%i[type sti_active_record_model_id sort_key],
|
|
398
|
+
unique: true, name: "sti_sort_key_index"
|
|
399
|
+
|
|
400
|
+
if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
|
|
401
|
+
add_index :sti_active_record_model_transitions,
|
|
402
|
+
%i[type sti_active_record_model_id most_recent],
|
|
403
|
+
unique: true,
|
|
404
|
+
where: "most_recent",
|
|
405
|
+
name: "index_sti_active_record_model_transitions_parent_latest"
|
|
406
|
+
else
|
|
407
|
+
add_index :sti_active_record_model_transitions,
|
|
408
|
+
%i[type sti_active_record_model_id most_recent],
|
|
409
|
+
unique: true,
|
|
410
|
+
name: "index_sti_active_record_model_transitions_parent_latest"
|
|
411
|
+
end
|
|
412
|
+
end
|
|
286
413
|
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# `expected_dbs` should be a Hash of the form:
|
|
4
|
+
# {
|
|
5
|
+
# primary: [:writing, :reading],
|
|
6
|
+
# replica: [:reading],
|
|
7
|
+
# }
|
|
8
|
+
RSpec::Matchers.define :exactly_query_databases do |expected_dbs|
|
|
9
|
+
match do |block|
|
|
10
|
+
@expected_dbs = expected_dbs.transform_values(&:to_set).with_indifferent_access
|
|
11
|
+
@actual_dbs = Hash.new { |h, k| h[k] = Set.new }.with_indifferent_access
|
|
12
|
+
|
|
13
|
+
ActiveSupport::Notifications.
|
|
14
|
+
subscribe("sql.active_record") do |_name, _start, _finish, _id, payload|
|
|
15
|
+
pool = payload.fetch(:connection).pool
|
|
16
|
+
|
|
17
|
+
next if pool.is_a?(ActiveRecord::ConnectionAdapters::NullPool)
|
|
18
|
+
|
|
19
|
+
name = pool.db_config.name
|
|
20
|
+
role = pool.role
|
|
21
|
+
|
|
22
|
+
@actual_dbs[name] << role
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
block.call
|
|
26
|
+
|
|
27
|
+
@actual_dbs == @expected_dbs
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
failure_message do |_block|
|
|
31
|
+
"expected to query exactly #{@expected_dbs}, but queried #{@actual_dbs}"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
supports_block_expectations
|
|
35
|
+
end
|
data/statesman.gemspec
CHANGED
|
@@ -18,25 +18,9 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
|
|
19
19
|
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
20
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
21
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
22
21
|
spec.require_paths = ["lib"]
|
|
23
22
|
|
|
24
|
-
spec.required_ruby_version = ">= 2
|
|
25
|
-
|
|
26
|
-
spec.add_development_dependency "ammeter", "~> 1.1"
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 2"
|
|
28
|
-
spec.add_development_dependency "gc_ruboconfig", "~> 2.26.0"
|
|
29
|
-
spec.add_development_dependency "mysql2", ">= 0.4", "< 0.6"
|
|
30
|
-
spec.add_development_dependency "pg", ">= 0.18", "<= 1.3"
|
|
31
|
-
spec.add_development_dependency "pry"
|
|
32
|
-
spec.add_development_dependency "rails", ">= 5.2"
|
|
33
|
-
spec.add_development_dependency "rake", "~> 13.0.0"
|
|
34
|
-
spec.add_development_dependency "rspec", "~> 3.1"
|
|
35
|
-
spec.add_development_dependency "rspec-its", "~> 1.1"
|
|
36
|
-
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.0"
|
|
37
|
-
spec.add_development_dependency "rspec-rails", "~> 3.1"
|
|
38
|
-
spec.add_development_dependency "sqlite3", "~> 1.4.2"
|
|
39
|
-
spec.add_development_dependency "timecop", "~> 0.9.1"
|
|
23
|
+
spec.required_ruby_version = ">= 3.2"
|
|
40
24
|
|
|
41
25
|
spec.metadata = {
|
|
42
26
|
"bug_tracker_uri" => "#{GITHUB_URL}/issues",
|
|
@@ -44,5 +28,6 @@ Gem::Specification.new do |spec|
|
|
|
44
28
|
"documentation_uri" => "#{GITHUB_URL}/blob/master/README.md",
|
|
45
29
|
"homepage_uri" => GITHUB_URL,
|
|
46
30
|
"source_code_uri" => GITHUB_URL,
|
|
31
|
+
"rubygems_mfa_required" => "true",
|
|
47
32
|
}
|
|
48
33
|
end
|
metadata
CHANGED
|
@@ -1,223 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: statesman
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 13.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GoCardless
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: ammeter
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.1'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.1'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: bundler
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '2'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '2'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: gc_ruboconfig
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: 2.26.0
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: 2.26.0
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: mysql2
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0.4'
|
|
62
|
-
- - "<"
|
|
63
|
-
- !ruby/object:Gem::Version
|
|
64
|
-
version: '0.6'
|
|
65
|
-
type: :development
|
|
66
|
-
prerelease: false
|
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
68
|
-
requirements:
|
|
69
|
-
- - ">="
|
|
70
|
-
- !ruby/object:Gem::Version
|
|
71
|
-
version: '0.4'
|
|
72
|
-
- - "<"
|
|
73
|
-
- !ruby/object:Gem::Version
|
|
74
|
-
version: '0.6'
|
|
75
|
-
- !ruby/object:Gem::Dependency
|
|
76
|
-
name: pg
|
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
|
78
|
-
requirements:
|
|
79
|
-
- - ">="
|
|
80
|
-
- !ruby/object:Gem::Version
|
|
81
|
-
version: '0.18'
|
|
82
|
-
- - "<="
|
|
83
|
-
- !ruby/object:Gem::Version
|
|
84
|
-
version: '1.3'
|
|
85
|
-
type: :development
|
|
86
|
-
prerelease: false
|
|
87
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
88
|
-
requirements:
|
|
89
|
-
- - ">="
|
|
90
|
-
- !ruby/object:Gem::Version
|
|
91
|
-
version: '0.18'
|
|
92
|
-
- - "<="
|
|
93
|
-
- !ruby/object:Gem::Version
|
|
94
|
-
version: '1.3'
|
|
95
|
-
- !ruby/object:Gem::Dependency
|
|
96
|
-
name: pry
|
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
|
98
|
-
requirements:
|
|
99
|
-
- - ">="
|
|
100
|
-
- !ruby/object:Gem::Version
|
|
101
|
-
version: '0'
|
|
102
|
-
type: :development
|
|
103
|
-
prerelease: false
|
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
-
requirements:
|
|
106
|
-
- - ">="
|
|
107
|
-
- !ruby/object:Gem::Version
|
|
108
|
-
version: '0'
|
|
109
|
-
- !ruby/object:Gem::Dependency
|
|
110
|
-
name: rails
|
|
111
|
-
requirement: !ruby/object:Gem::Requirement
|
|
112
|
-
requirements:
|
|
113
|
-
- - ">="
|
|
114
|
-
- !ruby/object:Gem::Version
|
|
115
|
-
version: '5.2'
|
|
116
|
-
type: :development
|
|
117
|
-
prerelease: false
|
|
118
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
119
|
-
requirements:
|
|
120
|
-
- - ">="
|
|
121
|
-
- !ruby/object:Gem::Version
|
|
122
|
-
version: '5.2'
|
|
123
|
-
- !ruby/object:Gem::Dependency
|
|
124
|
-
name: rake
|
|
125
|
-
requirement: !ruby/object:Gem::Requirement
|
|
126
|
-
requirements:
|
|
127
|
-
- - "~>"
|
|
128
|
-
- !ruby/object:Gem::Version
|
|
129
|
-
version: 13.0.0
|
|
130
|
-
type: :development
|
|
131
|
-
prerelease: false
|
|
132
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
133
|
-
requirements:
|
|
134
|
-
- - "~>"
|
|
135
|
-
- !ruby/object:Gem::Version
|
|
136
|
-
version: 13.0.0
|
|
137
|
-
- !ruby/object:Gem::Dependency
|
|
138
|
-
name: rspec
|
|
139
|
-
requirement: !ruby/object:Gem::Requirement
|
|
140
|
-
requirements:
|
|
141
|
-
- - "~>"
|
|
142
|
-
- !ruby/object:Gem::Version
|
|
143
|
-
version: '3.1'
|
|
144
|
-
type: :development
|
|
145
|
-
prerelease: false
|
|
146
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
147
|
-
requirements:
|
|
148
|
-
- - "~>"
|
|
149
|
-
- !ruby/object:Gem::Version
|
|
150
|
-
version: '3.1'
|
|
151
|
-
- !ruby/object:Gem::Dependency
|
|
152
|
-
name: rspec-its
|
|
153
|
-
requirement: !ruby/object:Gem::Requirement
|
|
154
|
-
requirements:
|
|
155
|
-
- - "~>"
|
|
156
|
-
- !ruby/object:Gem::Version
|
|
157
|
-
version: '1.1'
|
|
158
|
-
type: :development
|
|
159
|
-
prerelease: false
|
|
160
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
161
|
-
requirements:
|
|
162
|
-
- - "~>"
|
|
163
|
-
- !ruby/object:Gem::Version
|
|
164
|
-
version: '1.1'
|
|
165
|
-
- !ruby/object:Gem::Dependency
|
|
166
|
-
name: rspec_junit_formatter
|
|
167
|
-
requirement: !ruby/object:Gem::Requirement
|
|
168
|
-
requirements:
|
|
169
|
-
- - "~>"
|
|
170
|
-
- !ruby/object:Gem::Version
|
|
171
|
-
version: 0.4.0
|
|
172
|
-
type: :development
|
|
173
|
-
prerelease: false
|
|
174
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
175
|
-
requirements:
|
|
176
|
-
- - "~>"
|
|
177
|
-
- !ruby/object:Gem::Version
|
|
178
|
-
version: 0.4.0
|
|
179
|
-
- !ruby/object:Gem::Dependency
|
|
180
|
-
name: rspec-rails
|
|
181
|
-
requirement: !ruby/object:Gem::Requirement
|
|
182
|
-
requirements:
|
|
183
|
-
- - "~>"
|
|
184
|
-
- !ruby/object:Gem::Version
|
|
185
|
-
version: '3.1'
|
|
186
|
-
type: :development
|
|
187
|
-
prerelease: false
|
|
188
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
189
|
-
requirements:
|
|
190
|
-
- - "~>"
|
|
191
|
-
- !ruby/object:Gem::Version
|
|
192
|
-
version: '3.1'
|
|
193
|
-
- !ruby/object:Gem::Dependency
|
|
194
|
-
name: sqlite3
|
|
195
|
-
requirement: !ruby/object:Gem::Requirement
|
|
196
|
-
requirements:
|
|
197
|
-
- - "~>"
|
|
198
|
-
- !ruby/object:Gem::Version
|
|
199
|
-
version: 1.4.2
|
|
200
|
-
type: :development
|
|
201
|
-
prerelease: false
|
|
202
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
203
|
-
requirements:
|
|
204
|
-
- - "~>"
|
|
205
|
-
- !ruby/object:Gem::Version
|
|
206
|
-
version: 1.4.2
|
|
207
|
-
- !ruby/object:Gem::Dependency
|
|
208
|
-
name: timecop
|
|
209
|
-
requirement: !ruby/object:Gem::Requirement
|
|
210
|
-
requirements:
|
|
211
|
-
- - "~>"
|
|
212
|
-
- !ruby/object:Gem::Version
|
|
213
|
-
version: 0.9.1
|
|
214
|
-
type: :development
|
|
215
|
-
prerelease: false
|
|
216
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
217
|
-
requirements:
|
|
218
|
-
- - "~>"
|
|
219
|
-
- !ruby/object:Gem::Version
|
|
220
|
-
version: 0.9.1
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
221
12
|
description: A statesman-like state machine library
|
|
222
13
|
email:
|
|
223
14
|
- developers@gocardless.com
|
|
@@ -225,9 +16,12 @@ executables: []
|
|
|
225
16
|
extensions: []
|
|
226
17
|
extra_rdoc_files: []
|
|
227
18
|
files:
|
|
228
|
-
- ".
|
|
19
|
+
- ".devcontainer/devcontainer.json"
|
|
20
|
+
- ".devcontainer/docker-compose.yml"
|
|
229
21
|
- ".github/dependabot.yml"
|
|
22
|
+
- ".github/workflows/tests.yml"
|
|
230
23
|
- ".gitignore"
|
|
24
|
+
- ".rspec"
|
|
231
25
|
- ".rubocop.yml"
|
|
232
26
|
- ".rubocop_todo.yml"
|
|
233
27
|
- ".ruby-version"
|
|
@@ -251,6 +45,7 @@ files:
|
|
|
251
45
|
- lib/statesman/adapters/active_record_transition.rb
|
|
252
46
|
- lib/statesman/adapters/memory.rb
|
|
253
47
|
- lib/statesman/adapters/memory_transition.rb
|
|
48
|
+
- lib/statesman/adapters/type_safe_active_record_queries.rb
|
|
254
49
|
- lib/statesman/callback.rb
|
|
255
50
|
- lib/statesman/config.rb
|
|
256
51
|
- lib/statesman/exceptions.rb
|
|
@@ -272,6 +67,7 @@ files:
|
|
|
272
67
|
- spec/statesman/adapters/memory_spec.rb
|
|
273
68
|
- spec/statesman/adapters/memory_transition_spec.rb
|
|
274
69
|
- spec/statesman/adapters/shared_examples.rb
|
|
70
|
+
- spec/statesman/adapters/type_safe_active_record_queries_spec.rb
|
|
275
71
|
- spec/statesman/callback_spec.rb
|
|
276
72
|
- spec/statesman/config_spec.rb
|
|
277
73
|
- spec/statesman/exceptions_spec.rb
|
|
@@ -279,6 +75,7 @@ files:
|
|
|
279
75
|
- spec/statesman/machine_spec.rb
|
|
280
76
|
- spec/statesman/utils_spec.rb
|
|
281
77
|
- spec/support/active_record.rb
|
|
78
|
+
- spec/support/exactly_query_databases.rb
|
|
282
79
|
- spec/support/generators_shared_examples.rb
|
|
283
80
|
- statesman.gemspec
|
|
284
81
|
homepage: https://github.com/gocardless/statesman
|
|
@@ -290,7 +87,7 @@ metadata:
|
|
|
290
87
|
documentation_uri: https://github.com/gocardless/statesman/blob/master/README.md
|
|
291
88
|
homepage_uri: https://github.com/gocardless/statesman
|
|
292
89
|
source_code_uri: https://github.com/gocardless/statesman
|
|
293
|
-
|
|
90
|
+
rubygems_mfa_required: 'true'
|
|
294
91
|
rdoc_options: []
|
|
295
92
|
require_paths:
|
|
296
93
|
- lib
|
|
@@ -298,35 +95,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
298
95
|
requirements:
|
|
299
96
|
- - ">="
|
|
300
97
|
- !ruby/object:Gem::Version
|
|
301
|
-
version: '2
|
|
98
|
+
version: '3.2'
|
|
302
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
303
100
|
requirements:
|
|
304
101
|
- - ">="
|
|
305
102
|
- !ruby/object:Gem::Version
|
|
306
103
|
version: '0'
|
|
307
104
|
requirements: []
|
|
308
|
-
rubygems_version: 3.
|
|
309
|
-
signing_key:
|
|
105
|
+
rubygems_version: 3.6.9
|
|
310
106
|
specification_version: 4
|
|
311
107
|
summary: A statesman-like state machine library
|
|
312
|
-
test_files:
|
|
313
|
-
- spec/fixtures/add_constraints_to_most_recent_for_bacon_transitions_with_partial_index.rb
|
|
314
|
-
- spec/fixtures/add_constraints_to_most_recent_for_bacon_transitions_without_partial_index.rb
|
|
315
|
-
- spec/fixtures/add_most_recent_to_bacon_transitions.rb
|
|
316
|
-
- spec/generators/statesman/active_record_transition_generator_spec.rb
|
|
317
|
-
- spec/generators/statesman/migration_generator_spec.rb
|
|
318
|
-
- spec/spec_helper.rb
|
|
319
|
-
- spec/statesman/adapters/active_record_queries_spec.rb
|
|
320
|
-
- spec/statesman/adapters/active_record_spec.rb
|
|
321
|
-
- spec/statesman/adapters/active_record_transition_spec.rb
|
|
322
|
-
- spec/statesman/adapters/memory_spec.rb
|
|
323
|
-
- spec/statesman/adapters/memory_transition_spec.rb
|
|
324
|
-
- spec/statesman/adapters/shared_examples.rb
|
|
325
|
-
- spec/statesman/callback_spec.rb
|
|
326
|
-
- spec/statesman/config_spec.rb
|
|
327
|
-
- spec/statesman/exceptions_spec.rb
|
|
328
|
-
- spec/statesman/guard_spec.rb
|
|
329
|
-
- spec/statesman/machine_spec.rb
|
|
330
|
-
- spec/statesman/utils_spec.rb
|
|
331
|
-
- spec/support/active_record.rb
|
|
332
|
-
- spec/support/generators_shared_examples.rb
|
|
108
|
+
test_files: []
|