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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d271f90e99c2261b1b21ce4da28171d91bda5066e889e585f0109c1742e718c6
4
- data.tar.gz: bd84c6412dca2a2a2972a42b4b9f9745f860c0d15cc87f7b0d02f0fcd2813392
3
+ metadata.gz: 571678bdf82e90d2e3912c9c73604da11092b23eb786b73fd06dad86d36fc63f
4
+ data.tar.gz: d8406574dd3c4a451a3a3b342df03db6841195af1e11ef881aa15436be16872a
5
5
  SHA512:
6
- metadata.gz: 684ebee0503e8111f0b41f68136281f40eea3b8521dc1d945c74cd7f616e2d0c290835420c0ad7434b7cb7d4b14a0eb281d85d355a9f132d93ef891d70c7c49f
7
- data.tar.gz: 596b9776d46717e035dadbf2738c9c4b424a3efb9b8a09c10a03ce5951968c256e2dc4622f448d38ed35efb619061a98027bc6331cb2dac0bc1d062f5623dd1d
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
@@ -1,4 +1,4 @@
1
1
  # Eventful/ActiveRecord.rb
2
2
  # Eventful::ActiveRecord
3
3
 
4
- require_relative File.join('ActiveRecord', 'ClassMethods')
4
+ require_relative 'ActiveRecord/ClassMethods'
@@ -3,7 +3,6 @@
3
3
 
4
4
  module Eventful
5
5
  module ClassMethods
6
-
7
6
  # memory resident
8
7
  def memory_run(frequency_in_seconds = 1, runtime_in_seconds = nil)
9
8
  if runtime_in_seconds
@@ -34,6 +33,5 @@ module Eventful
34
33
  scheduled_run
35
34
  end
36
35
  end
37
-
38
36
  end
39
37
  end
@@ -4,7 +4,6 @@
4
4
  module Eventful
5
5
  module Poro
6
6
  module ClassMethods
7
-
8
7
  def <<(instance)
9
8
  instances << instance
10
9
  end
@@ -23,7 +22,6 @@ module Eventful
23
22
  def gc
24
23
  instances.tap{|instances| instances.reject!{|i| !i.active?}}
25
24
  end
26
-
27
25
  end
28
26
  end
29
27
  end
@@ -4,12 +4,10 @@
4
4
  module Eventful
5
5
  module Poro
6
6
  module InstanceMethods
7
-
8
7
  def initialize(*)
9
8
  super
10
9
  self.class.register(self)
11
10
  end
12
-
13
11
  end
14
12
  end
15
13
  end
data/lib/Eventful/Poro.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Eventful/Poro.rb
2
2
  # Eventful::Poro
3
3
 
4
- require_relative File.join('Poro', 'ClassMethods')
5
- require_relative File.join('Poro', 'InstanceMethods')
4
+ require_relative 'Poro/ClassMethods'
5
+ require_relative 'Poro/InstanceMethods'
@@ -2,5 +2,5 @@
2
2
  # Eventful::VERSION
3
3
 
4
4
  module Eventful
5
- VERSION = '2.1.3'
5
+ VERSION = '2.1.4'
6
6
  end
data/lib/Eventful.rb CHANGED
@@ -5,19 +5,18 @@
5
5
  # 0.7.0
6
6
 
7
7
  require 'Stateful'
8
- require_relative File.join('Eventful', 'ClassMethods')
9
- require_relative File.join('Eventful', 'VERSION')
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 File.join('Eventful', 'ActiveRecord')
16
+ require_relative 'Eventful/ActiveRecord'
18
17
  klass.extend(Eventful::ActiveRecord::ClassMethods)
19
18
  else
20
- require_relative File.join('Eventful', 'Poro')
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
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.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran