aasm 5.0.1 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +243 -108
  3. data/lib/aasm/aasm.rb +29 -27
  4. data/lib/aasm/base.rb +61 -11
  5. data/lib/aasm/configuration.rb +3 -0
  6. data/lib/aasm/core/event.rb +21 -10
  7. data/lib/aasm/core/invokers/class_invoker.rb +1 -1
  8. data/lib/aasm/core/invokers/literal_invoker.rb +3 -1
  9. data/lib/aasm/core/state.rb +6 -5
  10. data/lib/aasm/core/transition.rb +1 -1
  11. data/lib/aasm/dsl_helper.rb +24 -22
  12. data/lib/aasm/errors.rb +3 -1
  13. data/lib/aasm/instance_base.rb +28 -5
  14. data/lib/aasm/localizer.rb +13 -3
  15. data/lib/aasm/persistence/active_record_persistence.rb +20 -1
  16. data/lib/aasm/persistence/base.rb +14 -3
  17. data/lib/aasm/persistence/core_data_query_persistence.rb +2 -1
  18. data/lib/aasm/persistence/dynamoid_persistence.rb +1 -1
  19. data/lib/aasm/persistence/mongoid_persistence.rb +1 -1
  20. data/lib/aasm/persistence/no_brainer_persistence.rb +1 -1
  21. data/lib/aasm/persistence/orm.rb +23 -19
  22. data/lib/aasm/persistence/redis_persistence.rb +1 -1
  23. data/lib/aasm/rspec/transition_from.rb +5 -1
  24. data/lib/aasm/version.rb +1 -1
  25. data/lib/aasm.rb +0 -2
  26. data/lib/generators/aasm/orm_helpers.rb +7 -1
  27. data/lib/generators/active_record/aasm_generator.rb +3 -1
  28. data/lib/generators/active_record/templates/migration.rb +1 -1
  29. metadata +35 -385
  30. data/.document +0 -6
  31. data/.gitignore +0 -20
  32. data/.travis.yml +0 -54
  33. data/API +0 -34
  34. data/Appraisals +0 -66
  35. data/CHANGELOG.md +0 -383
  36. data/CODE_OF_CONDUCT.md +0 -13
  37. data/CONTRIBUTING.md +0 -24
  38. data/Dockerfile +0 -44
  39. data/Gemfile +0 -6
  40. data/Gemfile.lock_old +0 -151
  41. data/HOWTO +0 -12
  42. data/PLANNED_CHANGES.md +0 -11
  43. data/README_FROM_VERSION_3_TO_4.md +0 -240
  44. data/Rakefile +0 -31
  45. data/TESTING.md +0 -25
  46. data/aasm.gemspec +0 -35
  47. data/callbacks.txt +0 -51
  48. data/docker-compose.yml +0 -40
  49. data/gemfiles/rails_3.2.gemfile +0 -13
  50. data/gemfiles/rails_4.0.gemfile +0 -15
  51. data/gemfiles/rails_4.2.gemfile +0 -16
  52. data/gemfiles/rails_4.2_mongoid_5.gemfile +0 -11
  53. data/gemfiles/rails_4.2_nobrainer.gemfile +0 -9
  54. data/gemfiles/rails_5.0.gemfile +0 -13
  55. data/gemfiles/rails_5.0_nobrainer.gemfile +0 -9
  56. data/gemfiles/rails_5.1.gemfile +0 -13
  57. data/spec/database.rb +0 -47
  58. data/spec/database.yml +0 -3
  59. data/spec/en.yml +0 -12
  60. data/spec/en_deprecated_style.yml +0 -10
  61. data/spec/generators/active_record_generator_spec.rb +0 -47
  62. data/spec/generators/mongoid_generator_spec.rb +0 -31
  63. data/spec/generators/no_brainer_generator_spec.rb +0 -29
  64. data/spec/models/active_record/basic_active_record_two_state_machines_example.rb +0 -25
  65. data/spec/models/active_record/complex_active_record_example.rb +0 -37
  66. data/spec/models/active_record/derivate_new_dsl.rb +0 -7
  67. data/spec/models/active_record/false_state.rb +0 -35
  68. data/spec/models/active_record/gate.rb +0 -39
  69. data/spec/models/active_record/invalid_persistor.rb +0 -29
  70. data/spec/models/active_record/localizer_test_model.rb +0 -34
  71. data/spec/models/active_record/no_direct_assignment.rb +0 -21
  72. data/spec/models/active_record/no_scope.rb +0 -21
  73. data/spec/models/active_record/persisted_state.rb +0 -12
  74. data/spec/models/active_record/provided_and_persisted_state.rb +0 -24
  75. data/spec/models/active_record/reader.rb +0 -7
  76. data/spec/models/active_record/readme_job.rb +0 -21
  77. data/spec/models/active_record/silent_persistor.rb +0 -29
  78. data/spec/models/active_record/simple_new_dsl.rb +0 -32
  79. data/spec/models/active_record/thief.rb +0 -29
  80. data/spec/models/active_record/transactor.rb +0 -124
  81. data/spec/models/active_record/transient.rb +0 -6
  82. data/spec/models/active_record/validator.rb +0 -118
  83. data/spec/models/active_record/with_enum.rb +0 -39
  84. data/spec/models/active_record/with_enum_without_column.rb +0 -38
  85. data/spec/models/active_record/with_false_enum.rb +0 -31
  86. data/spec/models/active_record/with_true_enum.rb +0 -39
  87. data/spec/models/active_record/worker.rb +0 -2
  88. data/spec/models/active_record/writer.rb +0 -6
  89. data/spec/models/basic_two_state_machines_example.rb +0 -25
  90. data/spec/models/callbacks/basic.rb +0 -98
  91. data/spec/models/callbacks/basic_multiple.rb +0 -75
  92. data/spec/models/callbacks/guard_within_block.rb +0 -67
  93. data/spec/models/callbacks/guard_within_block_multiple.rb +0 -66
  94. data/spec/models/callbacks/multiple_transitions_transition_guard.rb +0 -66
  95. data/spec/models/callbacks/multiple_transitions_transition_guard_multiple.rb +0 -65
  96. data/spec/models/callbacks/private_method.rb +0 -44
  97. data/spec/models/callbacks/private_method_multiple.rb +0 -44
  98. data/spec/models/callbacks/with_args.rb +0 -62
  99. data/spec/models/callbacks/with_args_multiple.rb +0 -61
  100. data/spec/models/callbacks/with_state_arg.rb +0 -30
  101. data/spec/models/callbacks/with_state_arg_multiple.rb +0 -26
  102. data/spec/models/complex_example.rb +0 -222
  103. data/spec/models/conversation.rb +0 -93
  104. data/spec/models/default_state.rb +0 -12
  105. data/spec/models/double_definer.rb +0 -21
  106. data/spec/models/dynamoid/complex_dynamoid_example.rb +0 -37
  107. data/spec/models/dynamoid/dynamoid_multiple.rb +0 -18
  108. data/spec/models/dynamoid/dynamoid_simple.rb +0 -18
  109. data/spec/models/foo.rb +0 -106
  110. data/spec/models/foo_callback_multiple.rb +0 -45
  111. data/spec/models/guard_arguments_check.rb +0 -17
  112. data/spec/models/guard_with_params.rb +0 -24
  113. data/spec/models/guard_with_params_multiple.rb +0 -18
  114. data/spec/models/guardian.rb +0 -58
  115. data/spec/models/guardian_multiple.rb +0 -48
  116. data/spec/models/guardian_without_from_specified.rb +0 -18
  117. data/spec/models/initial_state_proc.rb +0 -31
  118. data/spec/models/mongoid/complex_mongoid_example.rb +0 -37
  119. data/spec/models/mongoid/invalid_persistor_mongoid.rb +0 -39
  120. data/spec/models/mongoid/mongoid_relationships.rb +0 -26
  121. data/spec/models/mongoid/no_scope_mongoid.rb +0 -21
  122. data/spec/models/mongoid/silent_persistor_mongoid.rb +0 -39
  123. data/spec/models/mongoid/simple_mongoid.rb +0 -23
  124. data/spec/models/mongoid/simple_new_dsl_mongoid.rb +0 -25
  125. data/spec/models/mongoid/validator_mongoid.rb +0 -100
  126. data/spec/models/multi_transitioner.rb +0 -34
  127. data/spec/models/multiple_transitions_that_differ_only_by_guard.rb +0 -31
  128. data/spec/models/namespaced_multiple_example.rb +0 -42
  129. data/spec/models/no_initial_state.rb +0 -25
  130. data/spec/models/nobrainer/complex_no_brainer_example.rb +0 -36
  131. data/spec/models/nobrainer/invalid_persistor_no_brainer.rb +0 -39
  132. data/spec/models/nobrainer/no_scope_no_brainer.rb +0 -21
  133. data/spec/models/nobrainer/nobrainer_relationships.rb +0 -25
  134. data/spec/models/nobrainer/silent_persistor_no_brainer.rb +0 -39
  135. data/spec/models/nobrainer/simple_new_dsl_nobrainer.rb +0 -25
  136. data/spec/models/nobrainer/simple_no_brainer.rb +0 -23
  137. data/spec/models/nobrainer/validator_no_brainer.rb +0 -98
  138. data/spec/models/not_auto_loaded/process.rb +0 -21
  139. data/spec/models/parametrised_event.rb +0 -42
  140. data/spec/models/parametrised_event_multiple.rb +0 -29
  141. data/spec/models/process_with_new_dsl.rb +0 -31
  142. data/spec/models/provided_state.rb +0 -24
  143. data/spec/models/redis/complex_redis_example.rb +0 -40
  144. data/spec/models/redis/redis_multiple.rb +0 -20
  145. data/spec/models/redis/redis_simple.rb +0 -20
  146. data/spec/models/sequel/complex_sequel_example.rb +0 -46
  147. data/spec/models/sequel/invalid_persistor.rb +0 -52
  148. data/spec/models/sequel/sequel_multiple.rb +0 -25
  149. data/spec/models/sequel/sequel_simple.rb +0 -26
  150. data/spec/models/sequel/silent_persistor.rb +0 -50
  151. data/spec/models/sequel/transactor.rb +0 -112
  152. data/spec/models/sequel/validator.rb +0 -93
  153. data/spec/models/sequel/worker.rb +0 -12
  154. data/spec/models/silencer.rb +0 -27
  155. data/spec/models/simple_custom_example.rb +0 -53
  156. data/spec/models/simple_example.rb +0 -17
  157. data/spec/models/simple_example_with_guard_args.rb +0 -17
  158. data/spec/models/simple_multiple_example.rb +0 -42
  159. data/spec/models/state_machine_with_failed_event.rb +0 -20
  160. data/spec/models/states_on_one_line_example.rb +0 -8
  161. data/spec/models/sub_class.rb +0 -41
  162. data/spec/models/sub_class_with_more_states.rb +0 -18
  163. data/spec/models/sub_classing.rb +0 -3
  164. data/spec/models/super_class.rb +0 -46
  165. data/spec/models/this_name_better_not_be_in_use.rb +0 -11
  166. data/spec/models/valid_state_name.rb +0 -23
  167. data/spec/spec_helper.rb +0 -26
  168. data/spec/spec_helpers/active_record.rb +0 -8
  169. data/spec/spec_helpers/dynamoid.rb +0 -35
  170. data/spec/spec_helpers/mongoid.rb +0 -26
  171. data/spec/spec_helpers/nobrainer.rb +0 -15
  172. data/spec/spec_helpers/redis.rb +0 -18
  173. data/spec/spec_helpers/remove_warnings.rb +0 -1
  174. data/spec/spec_helpers/sequel.rb +0 -7
  175. data/spec/unit/api_spec.rb +0 -100
  176. data/spec/unit/basic_two_state_machines_example_spec.rb +0 -10
  177. data/spec/unit/callback_multiple_spec.rb +0 -300
  178. data/spec/unit/callbacks_spec.rb +0 -491
  179. data/spec/unit/complex_example_spec.rb +0 -94
  180. data/spec/unit/complex_multiple_example_spec.rb +0 -115
  181. data/spec/unit/edge_cases_spec.rb +0 -16
  182. data/spec/unit/event_multiple_spec.rb +0 -73
  183. data/spec/unit/event_naming_spec.rb +0 -16
  184. data/spec/unit/event_spec.rb +0 -381
  185. data/spec/unit/exception_spec.rb +0 -11
  186. data/spec/unit/guard_arguments_check_spec.rb +0 -9
  187. data/spec/unit/guard_multiple_spec.rb +0 -60
  188. data/spec/unit/guard_spec.rb +0 -89
  189. data/spec/unit/guard_with_params_multiple_spec.rb +0 -10
  190. data/spec/unit/guard_with_params_spec.rb +0 -14
  191. data/spec/unit/guard_without_from_specified_spec.rb +0 -10
  192. data/spec/unit/initial_state_multiple_spec.rb +0 -15
  193. data/spec/unit/initial_state_spec.rb +0 -12
  194. data/spec/unit/inspection_multiple_spec.rb +0 -201
  195. data/spec/unit/inspection_spec.rb +0 -149
  196. data/spec/unit/invoker_spec.rb +0 -189
  197. data/spec/unit/invokers/base_invoker_spec.rb +0 -72
  198. data/spec/unit/invokers/class_invoker_spec.rb +0 -95
  199. data/spec/unit/invokers/literal_invoker_spec.rb +0 -86
  200. data/spec/unit/invokers/proc_invoker_spec.rb +0 -86
  201. data/spec/unit/localizer_spec.rb +0 -78
  202. data/spec/unit/memory_leak_spec.rb +0 -38
  203. data/spec/unit/multiple_transitions_that_differ_only_by_guard_spec.rb +0 -14
  204. data/spec/unit/namespaced_multiple_example_spec.rb +0 -75
  205. data/spec/unit/new_dsl_spec.rb +0 -12
  206. data/spec/unit/override_warning_spec.rb +0 -94
  207. data/spec/unit/persistence/active_record_persistence_multiple_spec.rb +0 -618
  208. data/spec/unit/persistence/active_record_persistence_spec.rb +0 -751
  209. data/spec/unit/persistence/dynamoid_persistence_multiple_spec.rb +0 -135
  210. data/spec/unit/persistence/dynamoid_persistence_spec.rb +0 -84
  211. data/spec/unit/persistence/mongoid_persistence_multiple_spec.rb +0 -200
  212. data/spec/unit/persistence/mongoid_persistence_spec.rb +0 -165
  213. data/spec/unit/persistence/no_brainer_persistence_multiple_spec.rb +0 -198
  214. data/spec/unit/persistence/no_brainer_persistence_spec.rb +0 -158
  215. data/spec/unit/persistence/redis_persistence_multiple_spec.rb +0 -88
  216. data/spec/unit/persistence/redis_persistence_spec.rb +0 -53
  217. data/spec/unit/persistence/sequel_persistence_multiple_spec.rb +0 -148
  218. data/spec/unit/persistence/sequel_persistence_spec.rb +0 -368
  219. data/spec/unit/readme_spec.rb +0 -41
  220. data/spec/unit/reloading_spec.rb +0 -15
  221. data/spec/unit/rspec_matcher_spec.rb +0 -85
  222. data/spec/unit/simple_custom_example_spec.rb +0 -39
  223. data/spec/unit/simple_example_spec.rb +0 -42
  224. data/spec/unit/simple_multiple_example_spec.rb +0 -91
  225. data/spec/unit/state_spec.rb +0 -89
  226. data/spec/unit/states_on_one_line_example_spec.rb +0 -16
  227. data/spec/unit/subclassing_multiple_spec.rb +0 -74
  228. data/spec/unit/subclassing_spec.rb +0 -46
  229. data/spec/unit/transition_spec.rb +0 -436
  230. data/test/minitest_helper.rb +0 -57
  231. data/test/unit/minitest_matcher_test.rb +0 -80
@@ -81,6 +81,10 @@ module AASM
81
81
  true
82
82
  end
83
83
 
84
+ def aasm_execute_after_commit
85
+ yield
86
+ end
87
+
84
88
  def aasm_write_state_attribute(state, name=:default)
85
89
  aasm_write_attribute(self.class.aasm(name).attribute_name, aasm_raw_attribute_value(state, name))
86
90
  end
@@ -116,32 +120,32 @@ module AASM
116
120
 
117
121
  # Returns true if event was fired successfully and transaction completed.
118
122
  def aasm_fire_event(state_machine_name, name, options, *args, &block)
119
- if aasm_supports_transactions? && options[:persist]
120
- event = self.class.aasm(state_machine_name).state_machine.events[name]
121
- event.fire_callbacks(:before_transaction, self, *args)
122
- event.fire_global_callbacks(:before_all_transactions, self, *args)
123
-
124
- begin
125
- success = if options[:persist] && use_transactions?(state_machine_name)
126
- aasm_transaction(requires_new?(state_machine_name), requires_lock?(state_machine_name)) do
127
- super
128
- end
129
- else
123
+ return super unless aasm_supports_transactions? && options[:persist]
124
+
125
+ event = self.class.aasm(state_machine_name).state_machine.events[name]
126
+ event.fire_callbacks(:before_transaction, self, *args)
127
+ event.fire_global_callbacks(:before_all_transactions, self, *args)
128
+
129
+ begin
130
+ success = if options[:persist] && use_transactions?(state_machine_name)
131
+ aasm_transaction(requires_new?(state_machine_name), requires_lock?(state_machine_name)) do
130
132
  super
131
133
  end
134
+ else
135
+ super
136
+ end
132
137
 
133
- if success
138
+ if success && !(event.options.keys & [:after_commit, :after_all_commits]).empty?
139
+ aasm_execute_after_commit do
134
140
  event.fire_callbacks(:after_commit, self, *args)
135
141
  event.fire_global_callbacks(:after_all_commits, self, *args)
136
142
  end
137
-
138
- success
139
- ensure
140
- event.fire_callbacks(:after_transaction, self, *args)
141
- event.fire_global_callbacks(:after_all_transactions, self, *args)
142
143
  end
143
- else
144
- super
144
+
145
+ success
146
+ ensure
147
+ event.fire_callbacks(:after_transaction, self, *args)
148
+ event.fire_global_callbacks(:after_all_transactions, self, *args)
145
149
  end
146
150
  end
147
151
 
@@ -69,7 +69,7 @@ module AASM
69
69
  def aasm_ensure_initial_state
70
70
  AASM::StateMachineStore.fetch(self.class, true).machine_names.each do |name|
71
71
  aasm_column = self.class.aasm(name).attribute_name
72
- aasm(name).enter_initial_state if send(aasm_column).value.blank?
72
+ aasm(name).enter_initial_state if !send(aasm_column).value || send(aasm_column).value.empty?
73
73
  end
74
74
  end
75
75
 
@@ -2,7 +2,11 @@ RSpec::Matchers.define :transition_from do |from_state|
2
2
  match do |obj|
3
3
  @state_machine_name ||= :default
4
4
  obj.aasm(@state_machine_name).current_state = from_state.to_sym
5
- obj.send(@event, *@args) && obj.aasm(@state_machine_name).current_state == @to_state.to_sym
5
+ begin
6
+ obj.send(@event, *@args) && obj.aasm(@state_machine_name).current_state == @to_state.to_sym
7
+ rescue AASM::InvalidTransition
8
+ false
9
+ end
6
10
  end
7
11
 
8
12
  chain :on do |state_machine_name|
data/lib/aasm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module AASM
2
- VERSION = "5.0.1"
2
+ VERSION = "5.5.0"
3
3
  end
data/lib/aasm.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'ostruct'
2
-
3
1
  require 'aasm/version'
4
2
  require 'aasm/errors'
5
3
  require 'aasm/configuration'
@@ -22,8 +22,14 @@ RUBY
22
22
 
23
23
  private
24
24
 
25
+ def column_exists?
26
+ table_name.singularize.humanize.constantize.column_names.include?(column_name.to_s)
27
+ rescue NameError
28
+ false
29
+ end
30
+
25
31
  def model_exists?
26
- File.exists?(File.join(destination_root, model_path))
32
+ File.exist?(File.join(destination_root, model_path))
27
33
  end
28
34
 
29
35
  def model_path
@@ -11,7 +11,9 @@ module ActiveRecord
11
11
  source_root File.expand_path("../templates", __FILE__)
12
12
 
13
13
  def copy_aasm_migration
14
- if model_exists?
14
+ if column_exists?
15
+ puts "Both model and column exists"
16
+ elsif model_exists?
15
17
  migration_template "migration_existing.rb", "db/migrate/add_#{column_name}_to_#{table_name}.rb"
16
18
  else
17
19
  migration_template "migration.rb", "db/migrate/aasm_create_#{table_name}.rb"
@@ -1,4 +1,4 @@
1
- class AASMCreate<%= table_name.camelize %> < ActiveRecord::Migration[<%= ActiveRecord::VERSION::STRING.to_f %>]
1
+ class AasmCreate<%= table_name.camelize %> < ActiveRecord::Migration[<%= ActiveRecord::VERSION::STRING.to_f %>]
2
2
  def change
3
3
  create_table(:<%= table_name %>) do |t|
4
4
  t.string :<%= column_name %>
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thorsten Boettger
8
8
  - Anil Maurya
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-09-07 00:00:00.000000000 Z
12
+ date: 2023-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby
@@ -95,6 +95,34 @@ dependencies:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: simplecov
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: codecov
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 0.1.21
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: 0.1.21
98
126
  - !ruby/object:Gem::Dependency
99
127
  name: pry
100
128
  requirement: !ruby/object:Gem::Requirement
@@ -116,35 +144,8 @@ executables: []
116
144
  extensions: []
117
145
  extra_rdoc_files: []
118
146
  files:
119
- - ".document"
120
- - ".gitignore"
121
- - ".travis.yml"
122
- - API
123
- - Appraisals
124
- - CHANGELOG.md
125
- - CODE_OF_CONDUCT.md
126
- - CONTRIBUTING.md
127
- - Dockerfile
128
- - Gemfile
129
- - Gemfile.lock_old
130
- - HOWTO
131
147
  - LICENSE
132
- - PLANNED_CHANGES.md
133
148
  - README.md
134
- - README_FROM_VERSION_3_TO_4.md
135
- - Rakefile
136
- - TESTING.md
137
- - aasm.gemspec
138
- - callbacks.txt
139
- - docker-compose.yml
140
- - gemfiles/rails_3.2.gemfile
141
- - gemfiles/rails_4.0.gemfile
142
- - gemfiles/rails_4.2.gemfile
143
- - gemfiles/rails_4.2_mongoid_5.gemfile
144
- - gemfiles/rails_4.2_nobrainer.gemfile
145
- - gemfiles/rails_5.0.gemfile
146
- - gemfiles/rails_5.0_nobrainer.gemfile
147
- - gemfiles/rails_5.1.gemfile
148
149
  - lib/aasm.rb
149
150
  - lib/aasm/aasm.rb
150
151
  - lib/aasm/base.rb
@@ -194,186 +195,11 @@ files:
194
195
  - lib/generators/mongoid/aasm_generator.rb
195
196
  - lib/generators/nobrainer/aasm_generator.rb
196
197
  - lib/motion-aasm.rb
197
- - spec/database.rb
198
- - spec/database.yml
199
- - spec/en.yml
200
- - spec/en_deprecated_style.yml
201
- - spec/generators/active_record_generator_spec.rb
202
- - spec/generators/mongoid_generator_spec.rb
203
- - spec/generators/no_brainer_generator_spec.rb
204
- - spec/models/active_record/basic_active_record_two_state_machines_example.rb
205
- - spec/models/active_record/complex_active_record_example.rb
206
- - spec/models/active_record/derivate_new_dsl.rb
207
- - spec/models/active_record/false_state.rb
208
- - spec/models/active_record/gate.rb
209
- - spec/models/active_record/invalid_persistor.rb
210
- - spec/models/active_record/localizer_test_model.rb
211
- - spec/models/active_record/no_direct_assignment.rb
212
- - spec/models/active_record/no_scope.rb
213
- - spec/models/active_record/persisted_state.rb
214
- - spec/models/active_record/provided_and_persisted_state.rb
215
- - spec/models/active_record/reader.rb
216
- - spec/models/active_record/readme_job.rb
217
- - spec/models/active_record/silent_persistor.rb
218
- - spec/models/active_record/simple_new_dsl.rb
219
- - spec/models/active_record/thief.rb
220
- - spec/models/active_record/transactor.rb
221
- - spec/models/active_record/transient.rb
222
- - spec/models/active_record/validator.rb
223
- - spec/models/active_record/with_enum.rb
224
- - spec/models/active_record/with_enum_without_column.rb
225
- - spec/models/active_record/with_false_enum.rb
226
- - spec/models/active_record/with_true_enum.rb
227
- - spec/models/active_record/worker.rb
228
- - spec/models/active_record/writer.rb
229
- - spec/models/basic_two_state_machines_example.rb
230
- - spec/models/callbacks/basic.rb
231
- - spec/models/callbacks/basic_multiple.rb
232
- - spec/models/callbacks/guard_within_block.rb
233
- - spec/models/callbacks/guard_within_block_multiple.rb
234
- - spec/models/callbacks/multiple_transitions_transition_guard.rb
235
- - spec/models/callbacks/multiple_transitions_transition_guard_multiple.rb
236
- - spec/models/callbacks/private_method.rb
237
- - spec/models/callbacks/private_method_multiple.rb
238
- - spec/models/callbacks/with_args.rb
239
- - spec/models/callbacks/with_args_multiple.rb
240
- - spec/models/callbacks/with_state_arg.rb
241
- - spec/models/callbacks/with_state_arg_multiple.rb
242
- - spec/models/complex_example.rb
243
- - spec/models/conversation.rb
244
- - spec/models/default_state.rb
245
- - spec/models/double_definer.rb
246
- - spec/models/dynamoid/complex_dynamoid_example.rb
247
- - spec/models/dynamoid/dynamoid_multiple.rb
248
- - spec/models/dynamoid/dynamoid_simple.rb
249
- - spec/models/foo.rb
250
- - spec/models/foo_callback_multiple.rb
251
- - spec/models/guard_arguments_check.rb
252
- - spec/models/guard_with_params.rb
253
- - spec/models/guard_with_params_multiple.rb
254
- - spec/models/guardian.rb
255
- - spec/models/guardian_multiple.rb
256
- - spec/models/guardian_without_from_specified.rb
257
- - spec/models/initial_state_proc.rb
258
- - spec/models/mongoid/complex_mongoid_example.rb
259
- - spec/models/mongoid/invalid_persistor_mongoid.rb
260
- - spec/models/mongoid/mongoid_relationships.rb
261
- - spec/models/mongoid/no_scope_mongoid.rb
262
- - spec/models/mongoid/silent_persistor_mongoid.rb
263
- - spec/models/mongoid/simple_mongoid.rb
264
- - spec/models/mongoid/simple_new_dsl_mongoid.rb
265
- - spec/models/mongoid/validator_mongoid.rb
266
- - spec/models/multi_transitioner.rb
267
- - spec/models/multiple_transitions_that_differ_only_by_guard.rb
268
- - spec/models/namespaced_multiple_example.rb
269
- - spec/models/no_initial_state.rb
270
- - spec/models/nobrainer/complex_no_brainer_example.rb
271
- - spec/models/nobrainer/invalid_persistor_no_brainer.rb
272
- - spec/models/nobrainer/no_scope_no_brainer.rb
273
- - spec/models/nobrainer/nobrainer_relationships.rb
274
- - spec/models/nobrainer/silent_persistor_no_brainer.rb
275
- - spec/models/nobrainer/simple_new_dsl_nobrainer.rb
276
- - spec/models/nobrainer/simple_no_brainer.rb
277
- - spec/models/nobrainer/validator_no_brainer.rb
278
- - spec/models/not_auto_loaded/process.rb
279
- - spec/models/parametrised_event.rb
280
- - spec/models/parametrised_event_multiple.rb
281
- - spec/models/process_with_new_dsl.rb
282
- - spec/models/provided_state.rb
283
- - spec/models/redis/complex_redis_example.rb
284
- - spec/models/redis/redis_multiple.rb
285
- - spec/models/redis/redis_simple.rb
286
- - spec/models/sequel/complex_sequel_example.rb
287
- - spec/models/sequel/invalid_persistor.rb
288
- - spec/models/sequel/sequel_multiple.rb
289
- - spec/models/sequel/sequel_simple.rb
290
- - spec/models/sequel/silent_persistor.rb
291
- - spec/models/sequel/transactor.rb
292
- - spec/models/sequel/validator.rb
293
- - spec/models/sequel/worker.rb
294
- - spec/models/silencer.rb
295
- - spec/models/simple_custom_example.rb
296
- - spec/models/simple_example.rb
297
- - spec/models/simple_example_with_guard_args.rb
298
- - spec/models/simple_multiple_example.rb
299
- - spec/models/state_machine_with_failed_event.rb
300
- - spec/models/states_on_one_line_example.rb
301
- - spec/models/sub_class.rb
302
- - spec/models/sub_class_with_more_states.rb
303
- - spec/models/sub_classing.rb
304
- - spec/models/super_class.rb
305
- - spec/models/this_name_better_not_be_in_use.rb
306
- - spec/models/valid_state_name.rb
307
- - spec/spec_helper.rb
308
- - spec/spec_helpers/active_record.rb
309
- - spec/spec_helpers/dynamoid.rb
310
- - spec/spec_helpers/mongoid.rb
311
- - spec/spec_helpers/nobrainer.rb
312
- - spec/spec_helpers/redis.rb
313
- - spec/spec_helpers/remove_warnings.rb
314
- - spec/spec_helpers/sequel.rb
315
- - spec/unit/api_spec.rb
316
- - spec/unit/basic_two_state_machines_example_spec.rb
317
- - spec/unit/callback_multiple_spec.rb
318
- - spec/unit/callbacks_spec.rb
319
- - spec/unit/complex_example_spec.rb
320
- - spec/unit/complex_multiple_example_spec.rb
321
- - spec/unit/edge_cases_spec.rb
322
- - spec/unit/event_multiple_spec.rb
323
- - spec/unit/event_naming_spec.rb
324
- - spec/unit/event_spec.rb
325
- - spec/unit/exception_spec.rb
326
- - spec/unit/guard_arguments_check_spec.rb
327
- - spec/unit/guard_multiple_spec.rb
328
- - spec/unit/guard_spec.rb
329
- - spec/unit/guard_with_params_multiple_spec.rb
330
- - spec/unit/guard_with_params_spec.rb
331
- - spec/unit/guard_without_from_specified_spec.rb
332
- - spec/unit/initial_state_multiple_spec.rb
333
- - spec/unit/initial_state_spec.rb
334
- - spec/unit/inspection_multiple_spec.rb
335
- - spec/unit/inspection_spec.rb
336
- - spec/unit/invoker_spec.rb
337
- - spec/unit/invokers/base_invoker_spec.rb
338
- - spec/unit/invokers/class_invoker_spec.rb
339
- - spec/unit/invokers/literal_invoker_spec.rb
340
- - spec/unit/invokers/proc_invoker_spec.rb
341
- - spec/unit/localizer_spec.rb
342
- - spec/unit/memory_leak_spec.rb
343
- - spec/unit/multiple_transitions_that_differ_only_by_guard_spec.rb
344
- - spec/unit/namespaced_multiple_example_spec.rb
345
- - spec/unit/new_dsl_spec.rb
346
- - spec/unit/override_warning_spec.rb
347
- - spec/unit/persistence/active_record_persistence_multiple_spec.rb
348
- - spec/unit/persistence/active_record_persistence_spec.rb
349
- - spec/unit/persistence/dynamoid_persistence_multiple_spec.rb
350
- - spec/unit/persistence/dynamoid_persistence_spec.rb
351
- - spec/unit/persistence/mongoid_persistence_multiple_spec.rb
352
- - spec/unit/persistence/mongoid_persistence_spec.rb
353
- - spec/unit/persistence/no_brainer_persistence_multiple_spec.rb
354
- - spec/unit/persistence/no_brainer_persistence_spec.rb
355
- - spec/unit/persistence/redis_persistence_multiple_spec.rb
356
- - spec/unit/persistence/redis_persistence_spec.rb
357
- - spec/unit/persistence/sequel_persistence_multiple_spec.rb
358
- - spec/unit/persistence/sequel_persistence_spec.rb
359
- - spec/unit/readme_spec.rb
360
- - spec/unit/reloading_spec.rb
361
- - spec/unit/rspec_matcher_spec.rb
362
- - spec/unit/simple_custom_example_spec.rb
363
- - spec/unit/simple_example_spec.rb
364
- - spec/unit/simple_multiple_example_spec.rb
365
- - spec/unit/state_spec.rb
366
- - spec/unit/states_on_one_line_example_spec.rb
367
- - spec/unit/subclassing_multiple_spec.rb
368
- - spec/unit/subclassing_spec.rb
369
- - spec/unit/transition_spec.rb
370
- - test/minitest_helper.rb
371
- - test/unit/minitest_matcher_test.rb
372
198
  homepage: https://github.com/aasm/aasm
373
199
  licenses:
374
200
  - MIT
375
201
  metadata: {}
376
- post_install_message:
202
+ post_install_message:
377
203
  rdoc_options: []
378
204
  require_paths:
379
205
  - lib
@@ -388,184 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
388
214
  - !ruby/object:Gem::Version
389
215
  version: '0'
390
216
  requirements: []
391
- rubyforge_project:
392
- rubygems_version: 2.6.14
393
- signing_key:
217
+ rubygems_version: 3.0.9
218
+ signing_key:
394
219
  specification_version: 4
395
220
  summary: State machine mixin for Ruby objects
396
- test_files:
397
- - spec/database.rb
398
- - spec/database.yml
399
- - spec/en.yml
400
- - spec/en_deprecated_style.yml
401
- - spec/generators/active_record_generator_spec.rb
402
- - spec/generators/mongoid_generator_spec.rb
403
- - spec/generators/no_brainer_generator_spec.rb
404
- - spec/models/active_record/basic_active_record_two_state_machines_example.rb
405
- - spec/models/active_record/complex_active_record_example.rb
406
- - spec/models/active_record/derivate_new_dsl.rb
407
- - spec/models/active_record/false_state.rb
408
- - spec/models/active_record/gate.rb
409
- - spec/models/active_record/invalid_persistor.rb
410
- - spec/models/active_record/localizer_test_model.rb
411
- - spec/models/active_record/no_direct_assignment.rb
412
- - spec/models/active_record/no_scope.rb
413
- - spec/models/active_record/persisted_state.rb
414
- - spec/models/active_record/provided_and_persisted_state.rb
415
- - spec/models/active_record/reader.rb
416
- - spec/models/active_record/readme_job.rb
417
- - spec/models/active_record/silent_persistor.rb
418
- - spec/models/active_record/simple_new_dsl.rb
419
- - spec/models/active_record/thief.rb
420
- - spec/models/active_record/transactor.rb
421
- - spec/models/active_record/transient.rb
422
- - spec/models/active_record/validator.rb
423
- - spec/models/active_record/with_enum.rb
424
- - spec/models/active_record/with_enum_without_column.rb
425
- - spec/models/active_record/with_false_enum.rb
426
- - spec/models/active_record/with_true_enum.rb
427
- - spec/models/active_record/worker.rb
428
- - spec/models/active_record/writer.rb
429
- - spec/models/basic_two_state_machines_example.rb
430
- - spec/models/callbacks/basic.rb
431
- - spec/models/callbacks/basic_multiple.rb
432
- - spec/models/callbacks/guard_within_block.rb
433
- - spec/models/callbacks/guard_within_block_multiple.rb
434
- - spec/models/callbacks/multiple_transitions_transition_guard.rb
435
- - spec/models/callbacks/multiple_transitions_transition_guard_multiple.rb
436
- - spec/models/callbacks/private_method.rb
437
- - spec/models/callbacks/private_method_multiple.rb
438
- - spec/models/callbacks/with_args.rb
439
- - spec/models/callbacks/with_args_multiple.rb
440
- - spec/models/callbacks/with_state_arg.rb
441
- - spec/models/callbacks/with_state_arg_multiple.rb
442
- - spec/models/complex_example.rb
443
- - spec/models/conversation.rb
444
- - spec/models/default_state.rb
445
- - spec/models/double_definer.rb
446
- - spec/models/dynamoid/complex_dynamoid_example.rb
447
- - spec/models/dynamoid/dynamoid_multiple.rb
448
- - spec/models/dynamoid/dynamoid_simple.rb
449
- - spec/models/foo.rb
450
- - spec/models/foo_callback_multiple.rb
451
- - spec/models/guard_arguments_check.rb
452
- - spec/models/guard_with_params.rb
453
- - spec/models/guard_with_params_multiple.rb
454
- - spec/models/guardian.rb
455
- - spec/models/guardian_multiple.rb
456
- - spec/models/guardian_without_from_specified.rb
457
- - spec/models/initial_state_proc.rb
458
- - spec/models/mongoid/complex_mongoid_example.rb
459
- - spec/models/mongoid/invalid_persistor_mongoid.rb
460
- - spec/models/mongoid/mongoid_relationships.rb
461
- - spec/models/mongoid/no_scope_mongoid.rb
462
- - spec/models/mongoid/silent_persistor_mongoid.rb
463
- - spec/models/mongoid/simple_mongoid.rb
464
- - spec/models/mongoid/simple_new_dsl_mongoid.rb
465
- - spec/models/mongoid/validator_mongoid.rb
466
- - spec/models/multi_transitioner.rb
467
- - spec/models/multiple_transitions_that_differ_only_by_guard.rb
468
- - spec/models/namespaced_multiple_example.rb
469
- - spec/models/no_initial_state.rb
470
- - spec/models/nobrainer/complex_no_brainer_example.rb
471
- - spec/models/nobrainer/invalid_persistor_no_brainer.rb
472
- - spec/models/nobrainer/no_scope_no_brainer.rb
473
- - spec/models/nobrainer/nobrainer_relationships.rb
474
- - spec/models/nobrainer/silent_persistor_no_brainer.rb
475
- - spec/models/nobrainer/simple_new_dsl_nobrainer.rb
476
- - spec/models/nobrainer/simple_no_brainer.rb
477
- - spec/models/nobrainer/validator_no_brainer.rb
478
- - spec/models/not_auto_loaded/process.rb
479
- - spec/models/parametrised_event.rb
480
- - spec/models/parametrised_event_multiple.rb
481
- - spec/models/process_with_new_dsl.rb
482
- - spec/models/provided_state.rb
483
- - spec/models/redis/complex_redis_example.rb
484
- - spec/models/redis/redis_multiple.rb
485
- - spec/models/redis/redis_simple.rb
486
- - spec/models/sequel/complex_sequel_example.rb
487
- - spec/models/sequel/invalid_persistor.rb
488
- - spec/models/sequel/sequel_multiple.rb
489
- - spec/models/sequel/sequel_simple.rb
490
- - spec/models/sequel/silent_persistor.rb
491
- - spec/models/sequel/transactor.rb
492
- - spec/models/sequel/validator.rb
493
- - spec/models/sequel/worker.rb
494
- - spec/models/silencer.rb
495
- - spec/models/simple_custom_example.rb
496
- - spec/models/simple_example.rb
497
- - spec/models/simple_example_with_guard_args.rb
498
- - spec/models/simple_multiple_example.rb
499
- - spec/models/state_machine_with_failed_event.rb
500
- - spec/models/states_on_one_line_example.rb
501
- - spec/models/sub_class.rb
502
- - spec/models/sub_class_with_more_states.rb
503
- - spec/models/sub_classing.rb
504
- - spec/models/super_class.rb
505
- - spec/models/this_name_better_not_be_in_use.rb
506
- - spec/models/valid_state_name.rb
507
- - spec/spec_helper.rb
508
- - spec/spec_helpers/active_record.rb
509
- - spec/spec_helpers/dynamoid.rb
510
- - spec/spec_helpers/mongoid.rb
511
- - spec/spec_helpers/nobrainer.rb
512
- - spec/spec_helpers/redis.rb
513
- - spec/spec_helpers/remove_warnings.rb
514
- - spec/spec_helpers/sequel.rb
515
- - spec/unit/api_spec.rb
516
- - spec/unit/basic_two_state_machines_example_spec.rb
517
- - spec/unit/callback_multiple_spec.rb
518
- - spec/unit/callbacks_spec.rb
519
- - spec/unit/complex_example_spec.rb
520
- - spec/unit/complex_multiple_example_spec.rb
521
- - spec/unit/edge_cases_spec.rb
522
- - spec/unit/event_multiple_spec.rb
523
- - spec/unit/event_naming_spec.rb
524
- - spec/unit/event_spec.rb
525
- - spec/unit/exception_spec.rb
526
- - spec/unit/guard_arguments_check_spec.rb
527
- - spec/unit/guard_multiple_spec.rb
528
- - spec/unit/guard_spec.rb
529
- - spec/unit/guard_with_params_multiple_spec.rb
530
- - spec/unit/guard_with_params_spec.rb
531
- - spec/unit/guard_without_from_specified_spec.rb
532
- - spec/unit/initial_state_multiple_spec.rb
533
- - spec/unit/initial_state_spec.rb
534
- - spec/unit/inspection_multiple_spec.rb
535
- - spec/unit/inspection_spec.rb
536
- - spec/unit/invoker_spec.rb
537
- - spec/unit/invokers/base_invoker_spec.rb
538
- - spec/unit/invokers/class_invoker_spec.rb
539
- - spec/unit/invokers/literal_invoker_spec.rb
540
- - spec/unit/invokers/proc_invoker_spec.rb
541
- - spec/unit/localizer_spec.rb
542
- - spec/unit/memory_leak_spec.rb
543
- - spec/unit/multiple_transitions_that_differ_only_by_guard_spec.rb
544
- - spec/unit/namespaced_multiple_example_spec.rb
545
- - spec/unit/new_dsl_spec.rb
546
- - spec/unit/override_warning_spec.rb
547
- - spec/unit/persistence/active_record_persistence_multiple_spec.rb
548
- - spec/unit/persistence/active_record_persistence_spec.rb
549
- - spec/unit/persistence/dynamoid_persistence_multiple_spec.rb
550
- - spec/unit/persistence/dynamoid_persistence_spec.rb
551
- - spec/unit/persistence/mongoid_persistence_multiple_spec.rb
552
- - spec/unit/persistence/mongoid_persistence_spec.rb
553
- - spec/unit/persistence/no_brainer_persistence_multiple_spec.rb
554
- - spec/unit/persistence/no_brainer_persistence_spec.rb
555
- - spec/unit/persistence/redis_persistence_multiple_spec.rb
556
- - spec/unit/persistence/redis_persistence_spec.rb
557
- - spec/unit/persistence/sequel_persistence_multiple_spec.rb
558
- - spec/unit/persistence/sequel_persistence_spec.rb
559
- - spec/unit/readme_spec.rb
560
- - spec/unit/reloading_spec.rb
561
- - spec/unit/rspec_matcher_spec.rb
562
- - spec/unit/simple_custom_example_spec.rb
563
- - spec/unit/simple_example_spec.rb
564
- - spec/unit/simple_multiple_example_spec.rb
565
- - spec/unit/state_spec.rb
566
- - spec/unit/states_on_one_line_example_spec.rb
567
- - spec/unit/subclassing_multiple_spec.rb
568
- - spec/unit/subclassing_spec.rb
569
- - spec/unit/transition_spec.rb
570
- - test/minitest_helper.rb
571
- - test/unit/minitest_matcher_test.rb
221
+ test_files: []
data/.document DELETED
@@ -1,6 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- -
6
- LICENSE
data/.gitignore DELETED
@@ -1,20 +0,0 @@
1
- *.sw?
2
- *~
3
- .DS_Store
4
- .idea
5
- coverage
6
- pkg
7
- rdoc
8
- Gemfile.lock
9
- gemfiles/*.lock
10
- spec/debug.log
11
- spec/*.db
12
- TODO
13
- .rvmrc
14
- .ruby-version
15
- .ruby-gemset
16
- alto
17
- .rspec
18
- .bundle
19
- tags
20
- tmp
data/.travis.yml DELETED
@@ -1,54 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
-
5
- rvm:
6
- - 2.2.6
7
- - 2.3.3
8
- - jruby-9.1.12.0
9
-
10
- services:
11
- - mongodb
12
- - redis-server
13
-
14
- addons:
15
- rethinkdb: '2.3.6'
16
-
17
- gemfile:
18
- - gemfiles/rails_3.2.gemfile
19
- - gemfiles/rails_4.0.gemfile
20
- - gemfiles/rails_4.2.gemfile
21
- - gemfiles/rails_4.2_mongoid_5.gemfile
22
- - gemfiles/rails_4.2_nobrainer.gemfile
23
- - gemfiles/rails_5.0.gemfile
24
- - gemfiles/rails_5.0_nobrainer.gemfile
25
- - gemfiles/rails_5.1.gemfile
26
-
27
- before_script:
28
- - mkdir /tmp/dynamodb
29
- - wget -O - https://s3-ap-southeast-1.amazonaws.com/dynamodb-local-singapore/dynamodb_local_latest.tar.gz | tar xz --directory /tmp/dynamodb
30
- - java -Djava.library.path=/tmp/dynamodb/DynamoDBLocal_lib -jar /tmp/dynamodb/DynamoDBLocal.jar -inMemory -delayTransientStatuses -port 30180 &
31
- - mongod --version
32
-
33
- script:
34
- - bundle exec rspec spec
35
- - bundle exec rake test
36
-
37
- matrix:
38
- exclude:
39
- - rvm: 2.2.6
40
- gemfile: gemfiles/rails_3.2.gemfile
41
- - rvm: 2.3.3
42
- gemfile: gemfiles/rails_3.2.gemfile
43
- - rvm: jruby-9.1.12.0
44
- gemfile: gemfiles/rails_5.0.gemfile
45
- - rvm: jruby-9.1.12.0
46
- gemfile: gemfiles/rails_5.1.gemfile
47
- - rvm: jruby-9.1.12.0
48
- gemfile: gemfiles/rails_4.2_nobrainer.gemfile
49
- - rvm: jruby-9.1.12.0
50
- gemfile: gemfiles/rails_5.0_nobrainer.gemfile
51
-
52
- notifications:
53
- slack:
54
- secure: gpltVWntdKz0nSE6A5UvuX4qbN35uW51nsW+Ojgqm8Qsv8K240/NlZRYutFHr7GnJTe0rEEP2Oy3ZBnBtZKFn13RlTEAU/FCAxebr4H24rr29Ypwwp5xjiSE4MuoBEnroo4lw6ka3LsJnrY2PKRMiLJGsS0WsEPY4x8NUG/vyY8=