stateful.rb 2.3.0 → 2.3.2
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/CHANGELOG.md +27 -0
- data/README.md +62 -4
- data/lib/Stateful/VERSION.rb +1 -1
- data/test/ActiveRecord/WithColumnName.rb +1 -4
- data/test/ActiveRecord/WithExplicitDeterministicEventOrdering.rb +1 -4
- data/test/ActiveRecord/WithExplicitGlobalNonDeterministicEventOrdering.rb +1 -4
- data/test/ActiveRecord/WithExplicitGlobalNonDeterministicEventOrderingAndInitialStateBlock.rb +1 -4
- data/test/ActiveRecord/WithExplicitNonDeterministicEventOrdering.rb +1 -4
- data/test/ActiveRecord/WithInitialStateBlock.rb +1 -4
- data/test/ActiveRecord/WithMultipleFinalStates.rb +1 -4
- data/test/ActiveRecord/WithMultipleStateMachines.rb +1 -4
- data/test/ActiveRecord/WithMultipleStateMachinesAndStatefulBlock.rb +1 -4
- data/test/ActiveRecord/WithPersistenceNonSpecificExtend.rb +1 -4
- data/test/ActiveRecord/WithPersistenceNonSpecificExtendAndStatefulBlock.rb +1 -4
- data/test/ActiveRecord/WithPersistenceSpecificExtend.rb +1 -4
- data/test/ActiveRecord/WithPersistenceSpecificExtendAndStatefulBlock.rb +1 -4
- data/test/Poro/WithExplicitDeterministicEventOrdering.rb +1 -5
- data/test/Poro/WithExplicitGlobalNonDeterministicEventOrdering.rb +1 -5
- data/test/Poro/WithExplicitGlobalNonDeterministicEventOrderingAndInitialStateBlock.rb +1 -5
- data/test/Poro/WithExplicitNonDeterministicEventOrdering.rb +1 -5
- data/test/Poro/WithInitialStateBlock.rb +1 -5
- data/test/Poro/WithMultipleFinalStates.rb +1 -5
- data/test/Poro/WithMultipleStateMachines.rb +1 -5
- data/test/Poro/WithMultipleStateMachinesAndStatefulBlock.rb +1 -5
- data/test/Poro/WithPersistenceNonSpecificExtend.rb +1 -5
- data/test/Poro/WithPersistenceNonSpecificExtendAndStatefulBlock.rb +1 -5
- data/test/Poro/WithPersistenceSpecificExtend.rb +1 -5
- data/test/Poro/WithPersistenceSpecificExtendAndStatefulBlock.rb +1 -5
- data/test/Poro/WithVariableName.rb +1 -5
- data/test/Sequel/WithColumnName.rb +1 -4
- data/test/Sequel/WithExplicitDeterministicEventOrdering.rb +1 -4
- data/test/Sequel/WithExplicitGlobalNonDeterministicEventOrdering.rb +1 -4
- data/test/Sequel/WithExplicitGlobalNonDeterministicEventOrderingAndInitialStateBlock.rb +1 -4
- data/test/Sequel/WithExplicitNonDeterministicEventOrdering.rb +1 -4
- data/test/Sequel/WithInitialStateBlock.rb +1 -4
- data/test/Sequel/WithMultipleFinalStates.rb +1 -4
- data/test/Sequel/WithMultipleStateMachines.rb +1 -4
- data/test/Sequel/WithMultipleStateMachinesAndStatefulBlock.rb +1 -4
- data/test/Sequel/WithPersistenceNonSpecificExtend.rb +1 -4
- data/test/Sequel/WithPersistenceNonSpecificExtendAndStatefulBlock.rb +1 -4
- data/test/Sequel/WithPersistenceSpecificExtend.rb +1 -4
- data/test/Sequel/WithPersistenceSpecificExtendAndStatefulBlock.rb +1 -4
- data/test/Stateful.rb +0 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 045517b47c6e558d4e414bc639973934c27abc955a5d6281088c3413c38e9a9b
|
|
4
|
+
data.tar.gz: db57952692bd309d8389c6d02de659c5dc3a0ab6ac361ecd491aeba5db3860e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ffcb05702b938f0f62d2d661adea0cdc64017eadcb3d6e328c369d88c8655f193ab58b2508706ed8ae3a7b71c0c09805a19bc8212493057b96a46d75e89fed5
|
|
7
|
+
data.tar.gz: bc0e1b4772f7e30f32df35542df5264c4ebe90c6d94ad52009362647f0c98a5450d9c9c303f5c87cfb0140ee03b7c81998ce492d19f85ed38e07ff3a3172772e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# stateful/CHANGELOG.md
|
|
2
2
|
|
|
3
|
+
## 2.3.2 (20260418): Add Sequel examples to README.
|
|
4
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
### ~
|
|
7
|
+
1. README.md: + Sequel examples (sections 5 and 6), updated description to include Sequel,
|
|
8
|
+
renumbered remaining sections.
|
|
9
|
+
2. lib/Stateful/VERSION.rb: /2.3.1/2.3.2/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## 2.3.1 (20260418): Use require\_relative in tests.
|
|
13
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
### ~
|
|
16
|
+
1. test/ActiveRecord/\*.rb:
|
|
17
|
+
- /require 'Stateful'/require\_relative '../../lib/Stateful'/
|
|
18
|
+
- /require 'Stateful/ActiveRecord'/require\_relative '../../lib/Stateful/ActiveRecord'/
|
|
19
|
+
(Ensures tests always run against the adjacent lib, not an installed gem.)
|
|
20
|
+
2. test/Poro/\*.rb:
|
|
21
|
+
- /require 'Stateful'/require\_relative '../../lib/Stateful'/
|
|
22
|
+
- /require 'Stateful/Poro'/require\_relative '../../lib/Stateful/Poro'/
|
|
23
|
+
3. test/Sequel/\*.rb:
|
|
24
|
+
- /require 'Stateful'/require\_relative '../../lib/Stateful'/
|
|
25
|
+
- /require 'Stateful/Sequel'/require\_relative '../../lib/Stateful/Sequel'/
|
|
26
|
+
4. test/Stateful.rb: - $LOAD\_PATH manipulation (no longer needed with require\_relative).
|
|
27
|
+
5. lib/Stateful/VERSION.rb: /2.3.0/2.3.1/
|
|
28
|
+
|
|
29
|
+
|
|
3
30
|
## 2.3.0 (20260418): Extract shared class methods.
|
|
4
31
|
-----------------------------------------------------------------------------------------------------------------------
|
|
5
32
|
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
|
-
A Ruby state machine which allows you to easily add state to Poro and
|
|
5
|
+
A Ruby state machine which allows you to easily add state to Poro, ActiveRecord, and Sequel objects. Works with both CRuby and mRuby.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -149,9 +149,67 @@ active_record_machine.final_state?
|
|
|
149
149
|
# => true
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
### 5.
|
|
152
|
+
### 5. Sequel with persistence-specific extend and a stateful block declaration
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
```ruby
|
|
155
|
+
class SequelMachine < Sequel::Model
|
|
156
|
+
extend Stateful::Sequel
|
|
157
|
+
|
|
158
|
+
stateful do
|
|
159
|
+
initial_state :initial_state
|
|
160
|
+
|
|
161
|
+
state :initial_state do
|
|
162
|
+
on :an_event => :next_state
|
|
163
|
+
on :another_event => :final_state
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
state :next_state do
|
|
167
|
+
on :yet_another_event => :final_state
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
final_state :final_state
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
sequel_machine = SequelMachine.create
|
|
175
|
+
sequel_machine.initial_state?
|
|
176
|
+
# => true
|
|
177
|
+
sequel_machine.an_event
|
|
178
|
+
sequel_machine.next_state?
|
|
179
|
+
# => true
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 6. Sequel with persistence non-specific extend, without a stateful block declaration, an initial_state block, and multiple final states
|
|
183
|
+
|
|
184
|
+
```ruby
|
|
185
|
+
class SequelMachine < Sequel::Model
|
|
186
|
+
extend Stateful
|
|
187
|
+
|
|
188
|
+
initial_state :initial_state do
|
|
189
|
+
on :an_event => :next_state
|
|
190
|
+
on :another_event => :final_state0
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
state :next_state do
|
|
194
|
+
on :yet_another_event => :final_state0
|
|
195
|
+
on :and_yet_another_event => :final_state1
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
final_state :final_state0, :final_state1
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
sequel_machine = SequelMachine.create
|
|
202
|
+
sequel_machine.an_event
|
|
203
|
+
sequel_machine.final_state?
|
|
204
|
+
# => false
|
|
205
|
+
sequel_machine.yet_another_event
|
|
206
|
+
sequel_machine.final_state?
|
|
207
|
+
# => true
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### 7. Custom attribute name and non-deterministic event ordering
|
|
211
|
+
|
|
212
|
+
It's also possible to define a state machine which has a custom attribute name, which fires off the events in a random or non-deterministic order, and which has no final state.
|
|
155
213
|
|
|
156
214
|
```ruby
|
|
157
215
|
class ActiveRecordMachine < ActiveRecord::Base
|
|
@@ -285,7 +343,7 @@ class Order
|
|
|
285
343
|
end
|
|
286
344
|
```
|
|
287
345
|
|
|
288
|
-
For ActiveRecord, each machine uses a column named `<machine_name>_state`:
|
|
346
|
+
For ActiveRecord and Sequel, each machine uses a column named `<machine_name>_state`:
|
|
289
347
|
|
|
290
348
|
```ruby
|
|
291
349
|
class CreateOrders < ActiveRecord::Migration[6.0]
|
data/lib/Stateful/VERSION.rb
CHANGED
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
data/test/ActiveRecord/WithExplicitGlobalNonDeterministicEventOrderingAndInitialStateBlock.rb
CHANGED
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful/ActiveRecord'
|
|
11
|
+
require_relative '../../lib/Stateful/ActiveRecord'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful/ActiveRecord'
|
|
11
|
+
require_relative '../../lib/Stateful/ActiveRecord'
|
|
15
12
|
|
|
16
13
|
class CreateTableMachines < ActiveRecord::Migration[6.0]
|
|
17
14
|
def change
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine5
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine9
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine10
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine6
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine4
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine7
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine11
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine12
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine0
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine1
|
|
15
11
|
extend Stateful
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful/Poro'
|
|
8
|
+
require_relative '../../lib/Stateful/Poro'
|
|
13
9
|
|
|
14
10
|
class PoroMachine2
|
|
15
11
|
extend Stateful::Poro
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful/Poro'
|
|
8
|
+
require_relative '../../lib/Stateful/Poro'
|
|
13
9
|
|
|
14
10
|
class PoroMachine3
|
|
15
11
|
extend Stateful::Poro
|
|
@@ -5,11 +5,7 @@ gem 'minitest-spec-context'
|
|
|
5
5
|
|
|
6
6
|
require 'minitest/autorun'
|
|
7
7
|
require 'minitest-spec-context'
|
|
8
|
-
|
|
9
|
-
lib_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', 'lib'))
|
|
10
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
11
|
-
|
|
12
|
-
require 'Stateful'
|
|
8
|
+
require_relative '../../lib/Stateful'
|
|
13
9
|
|
|
14
10
|
class PoroMachine8
|
|
15
11
|
@stateful_variable_name = 'status'
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine8s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine5s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine9s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine10s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine6s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine4s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine7s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine11s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine12s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine0s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful'
|
|
11
|
+
require_relative '../../lib/Stateful'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine1s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful/Sequel'
|
|
11
|
+
require_relative '../../lib/Stateful/Sequel'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine2s do
|
|
17
14
|
primary_key :id
|
|
@@ -8,10 +8,7 @@ require 'minitest-spec-context'
|
|
|
8
8
|
|
|
9
9
|
require_relative './test_helper'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
13
|
-
|
|
14
|
-
require 'Stateful/Sequel'
|
|
11
|
+
require_relative '../../lib/Stateful/Sequel'
|
|
15
12
|
|
|
16
13
|
DB.create_table :sequel_machine3s do
|
|
17
14
|
primary_key :id
|
data/test/Stateful.rb
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
test_dir = File.dirname(File.expand_path(__FILE__))
|
|
4
4
|
|
|
5
|
-
lib_dir = File.expand_path(File.join(test_dir, '..', 'lib'))
|
|
6
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
7
|
-
|
|
8
5
|
active_record_specs = Dir[File.join(test_dir, 'ActiveRecord', '**', '*.rb')]
|
|
9
6
|
active_record_specs.each{|spec| require spec}
|
|
10
7
|
|