eventful.rb 2.0.0 → 2.1.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/CHANGELOG.md +86 -0
- data/Gemfile +1 -6
- data/eventful.rb.gemspec +28 -8
- data/lib/Eventful/ActiveRecord/ClassMethods.rb +1 -1
- data/lib/Eventful/VERSION.rb +1 -1
- data/lib/Eventful.rb +1 -1
- data/test/ActiveRecord.rb +1 -1
- data/test/ActiveRecordWhenNoFinalState.rb +1 -1
- data/test/Poro.rb +1 -1
- metadata +64 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 846283505b6dd8c3226f0dc3fedfd647fa435c2274b72ca2fbb6c76b5e7dc868
|
|
4
|
+
data.tar.gz: 75b8e6ca2f807d3f0e92fdc2157e55007e5c990387ece3ee1cc2f26a4f3e850a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1279064416a1b694f2e0ff963773576a4947e9bd46d61673612d5b38149a176993afeaec22278d0a9bdac2fe62d8fbbf00842fd239d4690ad9258f0a172f46d
|
|
7
|
+
data.tar.gz: a38401bee440ce9d82eb065d5c4e1000404fbd758eea010b31d0d61659a27a81e9281c55d68dcab0c5c7add620f07aba93ad08be0b4c1d0f41833f9f88b92f17
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# eventful/CHANGELOG.md
|
|
2
|
+
|
|
3
|
+
## 2.1.0 (20260413): Add mRuby support.
|
|
4
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
### +
|
|
7
|
+
1. mruby/stub_requires.rb
|
|
8
|
+
2. mruby/smoke_tests.rb
|
|
9
|
+
3. mruby/test_mruby-eventful
|
|
10
|
+
4. mrbgem.rake
|
|
11
|
+
|
|
12
|
+
### ~
|
|
13
|
+
1. lib/Eventful.rb: + Object.const_defined?(:ActiveRecord) for mRuby compatibility. In mRuby defined?() raises NameError instead of returning nil as with CRuby.
|
|
14
|
+
2. lib/Eventful/ActiveRecord/ClassMethods.rb: /stateful_states/stateful_state_machine/ (compatibility with stateful.rb 2.x).
|
|
15
|
+
3. test/Poro.rb: /stateful_states/stateful_state_machine/ (This was broken in 2.0.0.)
|
|
16
|
+
4. test/ActiveRecord.rb: /stateful_states/stateful_state_machine/ (This was broken in 2.0.0.)
|
|
17
|
+
5. test/ActiveRecordWhenNoFinalState.rb: /stateful_states/stateful_state_machine/ (This was broken in 2.0.0.)
|
|
18
|
+
6. eventful.rb.gemspec: ~ summary, description, homepage; /Ruby/MIT/ license; + dependencies=, development_dependencies= helpers; + CHANGELOG.md to files; + development deps (activerecord, sqlite3).
|
|
19
|
+
7. Gemfile: Use gemspec.
|
|
20
|
+
8. lib/Eventful/VERSION: /2.0.0/2.1.0/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## 2.0.0 (20260412): Replace using ObjectSpace with a registry for detecting active Poro objects.
|
|
24
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
### +
|
|
27
|
+
1. Eventful::Poro::InstanceMethods: Prepended initialize hook for automatic instance registration.
|
|
28
|
+
2. Eventful::Poro::ClassMethods#instances: Class-level instance registry.
|
|
29
|
+
3. Eventful::Poro::ClassMethods#register: Register an instance.
|
|
30
|
+
4. Eventful::Poro::ClassMethods#gc: Remove final-state instances from the registry.
|
|
31
|
+
|
|
32
|
+
### -
|
|
33
|
+
1. lib/ObjectSpace/self.select_objects.rb
|
|
34
|
+
|
|
35
|
+
### ~
|
|
36
|
+
1. Eventful::Poro::ClassMethods#active: Replace ObjectSpace with instance registry.
|
|
37
|
+
2. Eventful::Poro: + require InstanceMethods.
|
|
38
|
+
3. Eventful: + klass.prepend(Eventful::Poro::InstanceMethods) for Poro path.
|
|
39
|
+
4. lib/Eventful/VERSION: /1.0.0/2.0.0/
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.0 (20260412): Declared stable.
|
|
43
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
44
|
+
|
|
45
|
+
### ~
|
|
46
|
+
1. lib/Eventful/VERSION: /0.9.1/1.0.0/
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## 0.9.1 (20260412): General tidying in preparation for 1.0.
|
|
50
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
### +
|
|
53
|
+
1. TODO (See notes.txt.)
|
|
54
|
+
|
|
55
|
+
### -
|
|
56
|
+
1. notes.txt (Now TODO.)
|
|
57
|
+
|
|
58
|
+
### ~
|
|
59
|
+
1. .gitignore: + \*.gem, Gemfile.lock, .claude
|
|
60
|
+
2. eventful.rb.gemspec: - spec.date
|
|
61
|
+
3. eventful.rb.gemspec: ~ spec.required_ruby_version: >= /1.8.6/2.5/
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## 0.9.0 (20260412): Update tests for Minitest 6 and later versions of ActiveRecord.
|
|
65
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
### ~
|
|
68
|
+
1. test/ActiveRecord.rb: Use \_(actual).must_equal(expected) syntax.
|
|
69
|
+
2. test/ActiveRecord.rb: Apply an ActiveRecord version for migrations.
|
|
70
|
+
3. test/ActiveRecordWhenNoFinalState.rb: Use \_(actual).must_equal(expected) syntax.
|
|
71
|
+
4. test/ActiveRecordWhenNoFinalState.rb: Apply an ActiveRecord version for migrations.
|
|
72
|
+
5. test/Poro.rb: Use \_(actual).must_equal(expected) syntax.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## 0.8.0 (20250728)
|
|
76
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
77
|
+
|
|
78
|
+
### +
|
|
79
|
+
1. lib/Eventful/VERSION.rb
|
|
80
|
+
2. CHANGELOG.md
|
|
81
|
+
|
|
82
|
+
### ~
|
|
83
|
+
1. eventful.rb.gemspec: + spec.add_dependency('stateful.rb')
|
|
84
|
+
2. eventful.rb.gemspec: /github.com\/thoran\/Eventful/github.com\/thoran\/eventful.rb/
|
|
85
|
+
3. eventful.rb.gemspec: ~ spec.licence: /MIT/Ruby/
|
|
86
|
+
4. eventful.rb.gemspec: /'0.7.0'/Eventful::VERSION/
|
data/Gemfile
CHANGED
data/eventful.rb.gemspec
CHANGED
|
@@ -1,27 +1,47 @@
|
|
|
1
1
|
require_relative './lib/Eventful/VERSION'
|
|
2
2
|
|
|
3
|
+
class Gem::Specification
|
|
4
|
+
def dependencies=(gems)
|
|
5
|
+
gems.each{|gem| add_dependency(*gem)}
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def development_dependencies=(gems)
|
|
9
|
+
gems.each{|gem| add_development_dependency(*gem)}
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
3
13
|
Gem::Specification.new do |spec|
|
|
4
14
|
spec.name = 'eventful.rb'
|
|
5
|
-
|
|
6
15
|
spec.version = Eventful::VERSION
|
|
7
16
|
|
|
8
|
-
spec.summary = "Automatically change state with
|
|
9
|
-
spec.description = "By defining predicate methods which
|
|
17
|
+
spec.summary = "Automatically change state with stateful.rb state machines."
|
|
18
|
+
spec.description = "By defining predicate methods which are, with the addition of '?', named the same as state machine events, and then configuring an in memory or cron-based event loop, the state machine will change state automatically."
|
|
10
19
|
|
|
11
20
|
spec.author = 'thoran'
|
|
12
21
|
spec.email = 'code@thoran.com'
|
|
13
|
-
spec.homepage = 'http://github.com/thoran/eventful
|
|
14
|
-
spec.license = '
|
|
22
|
+
spec.homepage = 'http://github.com/thoran/eventful'
|
|
23
|
+
spec.license = 'MIT'
|
|
15
24
|
|
|
25
|
+
# The required version of Ruby is this higher than it strictly needs to be solely because the migrations have been made to require AR 6.0, but otherwise this should work with much lower versions of Ruby and ActiveRecord, even down to 2.3 (or lower) and AR 3 (or lower).
|
|
16
26
|
spec.required_ruby_version = '>= 2.5'
|
|
17
27
|
|
|
18
|
-
spec.
|
|
28
|
+
spec.require_paths = ['lib']
|
|
29
|
+
|
|
19
30
|
spec.files = [
|
|
20
31
|
'eventful.rb.gemspec',
|
|
32
|
+
'CHANGELOG.md',
|
|
21
33
|
'Gemfile',
|
|
22
|
-
Dir['lib/**/*.rb'],
|
|
23
34
|
'README.md',
|
|
35
|
+
Dir['lib/**/*.rb'],
|
|
24
36
|
Dir['test/**/*.rb']
|
|
25
37
|
].flatten
|
|
26
|
-
|
|
38
|
+
|
|
39
|
+
spec.dependencies = %w{stateful.rb}
|
|
40
|
+
|
|
41
|
+
spec.development_dependencies = %w{
|
|
42
|
+
minitest
|
|
43
|
+
minitest-spec-context
|
|
44
|
+
activerecord
|
|
45
|
+
sqlite3
|
|
46
|
+
}
|
|
27
47
|
end
|
|
@@ -6,7 +6,7 @@ module Eventful
|
|
|
6
6
|
module ClassMethods
|
|
7
7
|
|
|
8
8
|
def active
|
|
9
|
-
final_state_names =
|
|
9
|
+
final_state_names = stateful_state_machine.final_states.collect(&:name).collect(&:to_s)
|
|
10
10
|
final_state_names_with_empty = (final_state_names.empty? ? '' : final_state_names)
|
|
11
11
|
where('current_state NOT IN (?)', final_state_names_with_empty).all
|
|
12
12
|
end
|
data/lib/Eventful/VERSION.rb
CHANGED
data/lib/Eventful.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Eventful
|
|
|
12
12
|
class << self
|
|
13
13
|
|
|
14
14
|
def load_persistence_class_methods(klass)
|
|
15
|
-
if defined?(ActiveRecord::Base) && klass < ActiveRecord::Base
|
|
15
|
+
if Object.const_defined?(:ActiveRecord) && defined?(::ActiveRecord::Base) && klass < ::ActiveRecord::Base
|
|
16
16
|
require_relative File.join('Eventful', 'ActiveRecord')
|
|
17
17
|
klass.extend(Eventful::ActiveRecord::ClassMethods)
|
|
18
18
|
else
|
data/test/ActiveRecord.rb
CHANGED
|
@@ -61,7 +61,7 @@ describe Eventful do
|
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
it "must have successfully extended the receiver class with Stateful methods" do
|
|
64
|
-
_(machine.class.methods.include?(:
|
|
64
|
+
_(machine.class.methods.include?(:stateful_state_machine)).must_equal true
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
it "must have successfully extended the receiver class with Eventful methods" do
|
|
@@ -62,7 +62,7 @@ describe Eventful do
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
it "must have successfully extended the receiver class with Stateful methods" do
|
|
65
|
-
_(machine2.class.methods.include?(:
|
|
65
|
+
_(machine2.class.methods.include?(:stateful_state_machine)).must_equal true
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
it "must have successfully extended the receiver class with Eventful methods" do
|
data/test/Poro.rb
CHANGED
|
@@ -33,7 +33,7 @@ describe Eventful do
|
|
|
33
33
|
let(:machine){Machine.active.first || Machine.new}
|
|
34
34
|
|
|
35
35
|
it "must have successfully extended the receiver class with Stateful methods" do
|
|
36
|
-
_(machine.class.methods.include?(:
|
|
36
|
+
_(machine.class.methods.include?(:stateful_state_machine)).must_equal true
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
it "must have successfully extended the receiver class with Eventful methods" do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eventful.rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoran
|
|
@@ -23,14 +23,71 @@ dependencies:
|
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '0'
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: minitest
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: minitest-spec-context
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :development
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: activerecord
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
61
|
+
type: :development
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '0'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: sqlite3
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0'
|
|
75
|
+
type: :development
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '0'
|
|
82
|
+
description: By defining predicate methods which are, with the addition of '?', named
|
|
83
|
+
the same as state machine events, and then configuring an in memory or cron-based
|
|
84
|
+
event loop, the state machine will change state automatically.
|
|
29
85
|
email: code@thoran.com
|
|
30
86
|
executables: []
|
|
31
87
|
extensions: []
|
|
32
88
|
extra_rdoc_files: []
|
|
33
89
|
files:
|
|
90
|
+
- CHANGELOG.md
|
|
34
91
|
- Gemfile
|
|
35
92
|
- README.md
|
|
36
93
|
- eventful.rb.gemspec
|
|
@@ -46,9 +103,9 @@ files:
|
|
|
46
103
|
- test/ActiveRecordWhenNoFinalState.rb
|
|
47
104
|
- test/Eventful.rb
|
|
48
105
|
- test/Poro.rb
|
|
49
|
-
homepage: http://github.com/thoran/eventful
|
|
106
|
+
homepage: http://github.com/thoran/eventful
|
|
50
107
|
licenses:
|
|
51
|
-
-
|
|
108
|
+
- MIT
|
|
52
109
|
metadata: {}
|
|
53
110
|
rdoc_options: []
|
|
54
111
|
require_paths:
|
|
@@ -66,5 +123,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
66
123
|
requirements: []
|
|
67
124
|
rubygems_version: 4.0.9
|
|
68
125
|
specification_version: 4
|
|
69
|
-
summary: Automatically change state with
|
|
126
|
+
summary: Automatically change state with stateful.rb state machines.
|
|
70
127
|
test_files: []
|