eventful.rb 2.1.3 → 2.1.4
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 +8 -0
- data/lib/Eventful/ActiveRecord/ClassMethods.rb +0 -2
- data/lib/Eventful/ActiveRecord.rb +1 -1
- data/lib/Eventful/ClassMethods.rb +0 -2
- data/lib/Eventful/Poro/ClassMethods.rb +0 -2
- data/lib/Eventful/Poro/InstanceMethods.rb +0 -2
- data/lib/Eventful/Poro.rb +2 -2
- data/lib/Eventful/VERSION.rb +1 -1
- data/lib/Eventful.rb +4 -6
- data/test/ActiveRecord.rb +0 -4
- data/test/ActiveRecordWhenNoFinalState.rb +0 -4
- data/test/Poro.rb +0 -2
- 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: 571678bdf82e90d2e3912c9c73604da11092b23eb786b73fd06dad86d36fc63f
|
|
4
|
+
data.tar.gz: d8406574dd3c4a451a3a3b342df03db6841195af1e11ef881aa15436be16872a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a63f266dcf91b3c2d669dd692b9618a761b6fefe1f73ebc658ed62bc1fa8561ddab91e7bb8b50db4c422148039041c62b9d28d71dfbd3b726eb48548407b96d2
|
|
7
|
+
data.tar.gz: 298398bfdbe226fdc0933e5ac43290fcefa69b1653499e71d0933ab27862693ba987a62e7c94f964be79dc2806bc2168996857a829e3e9b22674f3d70d1b7c21
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# eventful/CHANGELOG.md
|
|
2
2
|
|
|
3
|
+
## 2.1.4 (20260912): ~ the requires: /File.join('a', 'b')/'a\/b'/; - the blank line inside each class and module.
|
|
4
|
+
----------------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
### ~
|
|
7
|
+
1. lib and test: 7 requires read `File.join` over two string literals, which returns the same string the literal would: File.join joins with File::SEPARATOR, and that is "/" on every platform Ruby runs on, Windows included, File::ALT_SEPARATOR being untouched by it. So it conferred no portability and cost a `git grep` for the path it names.
|
|
8
|
+
2. lib and test: - 22 blank lines, 11 immediately after a class or module line and 11 immediately above the end which closes one, whether that end carries a trailing comment or not.
|
|
9
|
+
3. Eventful::VERSION: /2.1.3/2.1.4/
|
|
10
|
+
|
|
3
11
|
## 2.1.3 (20260911): + test/VERSION.rb, so the version the library serves is asserted rather than assumed.
|
|
4
12
|
----------------------------------------------------------------------------------------------------
|
|
5
13
|
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
module Eventful
|
|
5
5
|
module ActiveRecord
|
|
6
6
|
module ClassMethods
|
|
7
|
-
|
|
8
7
|
def active
|
|
9
8
|
final_state_names = stateful_state_machine.final_states.collect(&:name).collect(&:to_s)
|
|
10
9
|
final_state_names_with_empty = (final_state_names.empty? ? '' : final_state_names)
|
|
11
10
|
where('current_state NOT IN (?)', final_state_names_with_empty).all
|
|
12
11
|
end
|
|
13
|
-
|
|
14
12
|
end
|
|
15
13
|
end
|
|
16
14
|
end
|
data/lib/Eventful/Poro.rb
CHANGED
data/lib/Eventful/VERSION.rb
CHANGED
data/lib/Eventful.rb
CHANGED
|
@@ -5,19 +5,18 @@
|
|
|
5
5
|
# 0.7.0
|
|
6
6
|
|
|
7
7
|
require 'Stateful'
|
|
8
|
-
require_relative
|
|
9
|
-
require_relative
|
|
8
|
+
require_relative 'Eventful/ClassMethods'
|
|
9
|
+
require_relative 'Eventful/VERSION'
|
|
10
10
|
|
|
11
11
|
module Eventful
|
|
12
|
-
|
|
13
12
|
class << self
|
|
14
13
|
|
|
15
14
|
def load_persistence_class_methods(klass)
|
|
16
15
|
if Object.const_defined?(:ActiveRecord) && defined?(::ActiveRecord::Base) && klass < ::ActiveRecord::Base
|
|
17
|
-
require_relative
|
|
16
|
+
require_relative 'Eventful/ActiveRecord'
|
|
18
17
|
klass.extend(Eventful::ActiveRecord::ClassMethods)
|
|
19
18
|
else
|
|
20
|
-
require_relative
|
|
19
|
+
require_relative 'Eventful/Poro'
|
|
21
20
|
klass.extend(Eventful::Poro::ClassMethods)
|
|
22
21
|
klass.prepend(Eventful::Poro::InstanceMethods)
|
|
23
22
|
end
|
|
@@ -31,5 +30,4 @@ module Eventful
|
|
|
31
30
|
alias_method :included, :extended
|
|
32
31
|
|
|
33
32
|
end # class << self
|
|
34
|
-
|
|
35
33
|
end
|
data/test/ActiveRecord.rb
CHANGED
|
@@ -14,17 +14,14 @@ require 'pg'
|
|
|
14
14
|
require 'Eventful'
|
|
15
15
|
|
|
16
16
|
class CreateTableActiveRecordMachines < ActiveRecord::Migration[6.0]
|
|
17
|
-
|
|
18
17
|
def change
|
|
19
18
|
create_table :active_record_machines do |t|
|
|
20
19
|
t.string :current_state
|
|
21
20
|
end
|
|
22
21
|
end
|
|
23
|
-
|
|
24
22
|
end
|
|
25
23
|
|
|
26
24
|
class ActiveRecordMachine < ActiveRecord::Base
|
|
27
|
-
|
|
28
25
|
include Eventful
|
|
29
26
|
|
|
30
27
|
initial_state :initial_state do
|
|
@@ -37,7 +34,6 @@ class ActiveRecordMachine < ActiveRecord::Base
|
|
|
37
34
|
end
|
|
38
35
|
|
|
39
36
|
final_state :final_state
|
|
40
|
-
|
|
41
37
|
end
|
|
42
38
|
|
|
43
39
|
ActiveRecord::Base.establish_connection(
|
|
@@ -14,17 +14,14 @@ require 'pg'
|
|
|
14
14
|
require 'Eventful'
|
|
15
15
|
|
|
16
16
|
class CreateTableActiveRecordMachines2 < ActiveRecord::Migration[6.0]
|
|
17
|
-
|
|
18
17
|
def change
|
|
19
18
|
create_table :active_record_machine2s do |t|
|
|
20
19
|
t.string :current_state
|
|
21
20
|
end
|
|
22
21
|
end
|
|
23
|
-
|
|
24
22
|
end
|
|
25
23
|
|
|
26
24
|
class ActiveRecordMachine2 < ActiveRecord::Base
|
|
27
|
-
|
|
28
25
|
include Eventful
|
|
29
26
|
|
|
30
27
|
initial_state :initial_state do
|
|
@@ -38,7 +35,6 @@ class ActiveRecordMachine2 < ActiveRecord::Base
|
|
|
38
35
|
state :yet_another_state do
|
|
39
36
|
on :yet_another_event => :another_state
|
|
40
37
|
end
|
|
41
|
-
|
|
42
38
|
end
|
|
43
39
|
|
|
44
40
|
ActiveRecord::Base.establish_connection(
|
data/test/Poro.rb
CHANGED
|
@@ -12,7 +12,6 @@ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
|
|
12
12
|
require 'Eventful'
|
|
13
13
|
|
|
14
14
|
class Machine
|
|
15
|
-
|
|
16
15
|
include Eventful
|
|
17
16
|
|
|
18
17
|
initial_state :initial_state do
|
|
@@ -25,7 +24,6 @@ class Machine
|
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
final_state :final_state
|
|
28
|
-
|
|
29
27
|
end
|
|
30
28
|
|
|
31
29
|
describe Eventful do
|