eventful.rb 2.0.0 → 2.1.1
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 +98 -0
- data/Gemfile +1 -6
- data/LICENSE.txt +21 -0
- data/README.md +4 -4
- data/eventful.rb.gemspec +28 -9
- 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 +66 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0fa100696398c9168f8346c7776821b3313ee6d57835ef52718c0d9cc5824355
|
|
4
|
+
data.tar.gz: 7a6a4e394565bf611741d60d2064f9c24840b4113fcba8b2849d7374c35de571
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8af5526b123c8d3892fddf6935eadc40683a0dd6bbff43a7444e6e3a8b999dfbea4fdfdc4f1b7922659d35ec74b14cfef079f9edda9fa26397cb0c4baa1cea55
|
|
7
|
+
data.tar.gz: ec0b8f7bfe0252fdab31d2345867296e8d7b4d16134d39a4ba460e217e919696ff481dfa4d5214f19a3e9f3017b4ada1eae9df989e46d4836159bd589f96c311
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# eventful/CHANGELOG.md
|
|
2
|
+
|
|
3
|
+
## 2.1.1 (20260817): Populate .gitignore, + LICENSE.txt, include LICENSE.txt in the gemspec, and correct the README.
|
|
4
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
### +
|
|
7
|
+
1. LICENSE.txt: The MIT text, as switches and moby carry it, the gemspec having declared MIT with no file to point at. Copyright 2014-2026, the repository's own span.
|
|
8
|
+
|
|
9
|
+
### ~
|
|
10
|
+
1. .gitignore: 44 lines, covering gem builds, bundler, RDoc and YARD output, .DS_Store, editor files, the Ruby version managers, test artefacts and .claude. The file existed and was empty, which git-boot created it as until 0.16.0 and nothing had since filled in.
|
|
11
|
+
2. README.md: /eventful.rb/eventful/ in the title and the fork URL, the repository having been renamed.
|
|
12
|
+
3. README.md: /Stateful/stateful.rb/, naming the dependency as it is published.
|
|
13
|
+
4. README.md: The licence is stated as MIT, which is what the gemspec declares. It had read "the Ruby License" while linking to the MIT text.
|
|
14
|
+
|
|
15
|
+
## 2.1.0 (20260413): Add mRuby support.
|
|
16
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
### +
|
|
19
|
+
1. mruby/stub_requires.rb
|
|
20
|
+
2. mruby/smoke_tests.rb
|
|
21
|
+
3. mruby/test_mruby-eventful
|
|
22
|
+
4. mrbgem.rake
|
|
23
|
+
|
|
24
|
+
### ~
|
|
25
|
+
1. lib/Eventful.rb: + Object.const_defined?(:ActiveRecord) for mRuby compatibility. In mRuby defined?() raises NameError instead of returning nil as with CRuby.
|
|
26
|
+
2. lib/Eventful/ActiveRecord/ClassMethods.rb: /stateful_states/stateful_state_machine/ (compatibility with stateful.rb 2.x).
|
|
27
|
+
3. test/Poro.rb: /stateful_states/stateful_state_machine/ (This was broken in 2.0.0.)
|
|
28
|
+
4. test/ActiveRecord.rb: /stateful_states/stateful_state_machine/ (This was broken in 2.0.0.)
|
|
29
|
+
5. test/ActiveRecordWhenNoFinalState.rb: /stateful_states/stateful_state_machine/ (This was broken in 2.0.0.)
|
|
30
|
+
6. eventful.rb.gemspec: ~ summary, description, homepage; /Ruby/MIT/ license; + dependencies=, development_dependencies= helpers; + CHANGELOG.md to files; + development deps (activerecord, sqlite3).
|
|
31
|
+
7. Gemfile: Use gemspec.
|
|
32
|
+
8. lib/Eventful/VERSION: /2.0.0/2.1.0/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## 2.0.0 (20260412): Replace using ObjectSpace with a registry for detecting active Poro objects.
|
|
36
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
### +
|
|
39
|
+
1. Eventful::Poro::InstanceMethods: Prepended initialize hook for automatic instance registration.
|
|
40
|
+
2. Eventful::Poro::ClassMethods#instances: Class-level instance registry.
|
|
41
|
+
3. Eventful::Poro::ClassMethods#register: Register an instance.
|
|
42
|
+
4. Eventful::Poro::ClassMethods#gc: Remove final-state instances from the registry.
|
|
43
|
+
|
|
44
|
+
### -
|
|
45
|
+
1. lib/ObjectSpace/self.select_objects.rb
|
|
46
|
+
|
|
47
|
+
### ~
|
|
48
|
+
1. Eventful::Poro::ClassMethods#active: Replace ObjectSpace with instance registry.
|
|
49
|
+
2. Eventful::Poro: + require InstanceMethods.
|
|
50
|
+
3. Eventful: + klass.prepend(Eventful::Poro::InstanceMethods) for Poro path.
|
|
51
|
+
4. lib/Eventful/VERSION: /1.0.0/2.0.0/
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.0 (20260412): Declared stable.
|
|
55
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
### ~
|
|
58
|
+
1. lib/Eventful/VERSION: /0.9.1/1.0.0/
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## 0.9.1 (20260412): General tidying in preparation for 1.0.
|
|
62
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
### +
|
|
65
|
+
1. TODO (See notes.txt.)
|
|
66
|
+
|
|
67
|
+
### -
|
|
68
|
+
1. notes.txt (Now TODO.)
|
|
69
|
+
|
|
70
|
+
### ~
|
|
71
|
+
1. .gitignore: + \*.gem, Gemfile.lock, .claude
|
|
72
|
+
2. eventful.rb.gemspec: - spec.date
|
|
73
|
+
3. eventful.rb.gemspec: ~ spec.required_ruby_version: >= /1.8.6/2.5/
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## 0.9.0 (20260412): Update tests for Minitest 6 and later versions of ActiveRecord.
|
|
77
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
78
|
+
|
|
79
|
+
### ~
|
|
80
|
+
1. test/ActiveRecord.rb: Use \_(actual).must_equal(expected) syntax.
|
|
81
|
+
2. test/ActiveRecord.rb: Apply an ActiveRecord version for migrations.
|
|
82
|
+
3. test/ActiveRecordWhenNoFinalState.rb: Use \_(actual).must_equal(expected) syntax.
|
|
83
|
+
4. test/ActiveRecordWhenNoFinalState.rb: Apply an ActiveRecord version for migrations.
|
|
84
|
+
5. test/Poro.rb: Use \_(actual).must_equal(expected) syntax.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## 0.8.0 (20250728)
|
|
88
|
+
-----------------------------------------------------------------------------------------------------------------------
|
|
89
|
+
|
|
90
|
+
### +
|
|
91
|
+
1. lib/Eventful/VERSION.rb
|
|
92
|
+
2. CHANGELOG.md
|
|
93
|
+
|
|
94
|
+
### ~
|
|
95
|
+
1. eventful.rb.gemspec: + spec.add_dependency('stateful.rb')
|
|
96
|
+
2. eventful.rb.gemspec: /github.com\/thoran\/Eventful/github.com\/thoran\/eventful.rb/
|
|
97
|
+
3. eventful.rb.gemspec: ~ spec.licence: /MIT/Ruby/
|
|
98
|
+
4. eventful.rb.gemspec: /'0.7.0'/Eventful::VERSION/
|
data/Gemfile
CHANGED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2026 thoran
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# eventful
|
|
1
|
+
# eventful
|
|
2
2
|
|
|
3
|
-
Automatically change state with
|
|
3
|
+
Automatically change state with stateful.rb state machines.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -68,7 +68,7 @@ machine.current_state.name
|
|
|
68
68
|
|
|
69
69
|
## Contributing
|
|
70
70
|
|
|
71
|
-
1. Fork it (https://github.com/thoran/eventful
|
|
71
|
+
1. Fork it (https://github.com/thoran/eventful/fork)
|
|
72
72
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
73
73
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
74
74
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
@@ -76,4 +76,4 @@ machine.current_state.name
|
|
|
76
76
|
|
|
77
77
|
## License
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
MIT
|
data/eventful.rb.gemspec
CHANGED
|
@@ -1,27 +1,46 @@
|
|
|
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
|
|
|
16
25
|
spec.required_ruby_version = '>= 2.5'
|
|
26
|
+
spec.require_paths = ['lib']
|
|
17
27
|
|
|
18
|
-
spec.add_dependency('stateful.rb')
|
|
19
28
|
spec.files = [
|
|
29
|
+
Dir['test/**/*.rb'],
|
|
30
|
+
Dir['lib/**/*.rb'],
|
|
31
|
+
'CHANGELOG.md',
|
|
20
32
|
'eventful.rb.gemspec',
|
|
21
33
|
'Gemfile',
|
|
22
|
-
|
|
34
|
+
'LICENSE.txt',
|
|
23
35
|
'README.md',
|
|
24
|
-
Dir['test/**/*.rb']
|
|
25
36
|
].flatten
|
|
26
|
-
|
|
37
|
+
|
|
38
|
+
spec.dependencies = %w{stateful.rb}
|
|
39
|
+
|
|
40
|
+
spec.development_dependencies = %w{
|
|
41
|
+
minitest
|
|
42
|
+
minitest-spec-context
|
|
43
|
+
activerecord
|
|
44
|
+
sqlite3
|
|
45
|
+
}
|
|
27
46
|
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.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoran
|
|
@@ -23,15 +23,73 @@ 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
|
|
92
|
+
- LICENSE.txt
|
|
35
93
|
- README.md
|
|
36
94
|
- eventful.rb.gemspec
|
|
37
95
|
- lib/Eventful.rb
|
|
@@ -46,9 +104,9 @@ files:
|
|
|
46
104
|
- test/ActiveRecordWhenNoFinalState.rb
|
|
47
105
|
- test/Eventful.rb
|
|
48
106
|
- test/Poro.rb
|
|
49
|
-
homepage: http://github.com/thoran/eventful
|
|
107
|
+
homepage: http://github.com/thoran/eventful
|
|
50
108
|
licenses:
|
|
51
|
-
-
|
|
109
|
+
- MIT
|
|
52
110
|
metadata: {}
|
|
53
111
|
rdoc_options: []
|
|
54
112
|
require_paths:
|
|
@@ -64,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
64
122
|
- !ruby/object:Gem::Version
|
|
65
123
|
version: '0'
|
|
66
124
|
requirements: []
|
|
67
|
-
rubygems_version: 4.0.
|
|
125
|
+
rubygems_version: 4.0.18
|
|
68
126
|
specification_version: 4
|
|
69
|
-
summary: Automatically change state with
|
|
127
|
+
summary: Automatically change state with stateful.rb state machines.
|
|
70
128
|
test_files: []
|