stateful.rb 2.3.3 → 2.3.5

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: 36b830fd690c778367717cc317ffe39d53801ee9dc93e0fea1d42ba60ad099f1
4
- data.tar.gz: 4e9ea424b04703d2202afdcb9b73df9fb7b17514176e64202f54d3ae98092535
3
+ metadata.gz: c59db122c866f83bcf4ee3edeb84e119fdf9983361adc7bcb58b9ae8f2b4a025
4
+ data.tar.gz: 38b5376b18359e05f7540eb50321bb18d6b8988988738818f1b049f9d62c6e80
5
5
  SHA512:
6
- metadata.gz: a24a02097f130a4993bab84684fbfd060c4a95c7a33cf1090bd8d02cf1468b11daba5fa99190670a4a42273b8881574dac0c52519198a40affbe903115c174f4
7
- data.tar.gz: 5b21b16363b87c18ba78034102072e84cd7f5696cfbd1810bf766732cc798641434800275768d4c241940347c3ce7db39e169997cfcf6df1f411123359951bb0
6
+ metadata.gz: 56db73d72bfc7ea6d6ce667b7b7be9f5455fc437471d8db84f16cfd28a63d990c80c3002bdd47f2788e7921a7e1711c411ebe549131c384603fe34b1ec517c4b
7
+ data.tar.gz: 37125b132d495b7a38da67b33f4a49b57da1a11ac8716d5927935156a00949f6e8fef2df15d09cc8f5928a67076c80fc3d44d162beb62fd8201dd4d3f3a8fe97
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # stateful/CHANGELOG.md
2
2
 
3
+ ## 2.3.5 (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: - 11 blank lines, each immediately after a class or module line and nothing else.
9
+ 3. Stateful::VERSION: /2.3.4/2.3.5/
10
+
11
+ ## 2.3.4 (20260910): ~ lib/Stateful.rb: + require_relative File.join('Stateful', 'VERSION'); + test/VERSION.rb
12
+ ----------------------------------------------------------------------------------------------------
13
+
14
+ ### +
15
+ 1. test/VERSION.rb: that Stateful::VERSION is a string, that it is three numbers separated by dots, and that it matches the newest entry in the changelog. Modelled on moby's, which is where the convention comes from. The test loads the library rather than VERSION.rb, which is the whole of its value: run against v2.3.3 it fails with "uninitialized constant Stateful::VERSION".
16
+
17
+ ### ~
18
+ 1. lib/Stateful.rb: + `require_relative File.join('Stateful', 'VERSION')`. The file has been present and unreached, so `require 'stateful.rb'` left Stateful::VERSION undefined and the gemspec was the only thing loading it.
19
+ 2. test/Stateful.rb: + `require_relative 'VERSION'`, the runner globbing only the three persistence directories.
20
+ 3. Stateful::VERSION: /2.3.3/2.3.4/
21
+
3
22
  ## 2.3.3 (20260822): + LICENSE, and correct the README.
4
23
  -----------------------------------------------------------------------------------------------------------------------
5
24
  ### +
@@ -3,11 +3,10 @@
3
3
 
4
4
  require_relative 'ClassMethods'
5
5
  require_relative 'InstanceMethods'
6
- require_relative File.join('ActiveRecord', 'ClassMethods')
6
+ require_relative 'ActiveRecord/ClassMethods'
7
7
 
8
8
  module Stateful
9
9
  module ActiveRecord
10
-
11
10
  class << self
12
11
 
13
12
  def set_column_name(klass)
@@ -25,6 +24,5 @@ module Stateful
25
24
  alias_method :included, :extended
26
25
 
27
26
  end # class << self
28
-
29
27
  end
30
28
  end
data/lib/Stateful/Poro.rb CHANGED
@@ -3,11 +3,10 @@
3
3
 
4
4
  require_relative 'ClassMethods'
5
5
  require_relative 'InstanceMethods'
6
- require_relative File.join('Poro', 'ClassMethods')
6
+ require_relative 'Poro/ClassMethods'
7
7
 
8
8
  module Stateful
9
9
  module Poro
10
-
11
10
  class << self
12
11
 
13
12
  def set_variable_name(klass)
@@ -25,6 +24,5 @@ module Stateful
25
24
  alias_method :included, :extended
26
25
 
27
26
  end # class << self
28
-
29
27
  end
30
28
  end
@@ -3,11 +3,10 @@
3
3
 
4
4
  require_relative 'ClassMethods'
5
5
  require_relative 'InstanceMethods'
6
- require_relative File.join('Sequel', 'ClassMethods')
6
+ require_relative 'Sequel/ClassMethods'
7
7
 
8
8
  module Stateful
9
9
  module Sequel
10
-
11
10
  class << self
12
11
 
13
12
  def set_column_name(klass)
@@ -25,6 +24,5 @@ module Stateful
25
24
  alias_method :included, :extended
26
25
 
27
26
  end # class << self
28
-
29
27
  end
30
28
  end
@@ -5,7 +5,6 @@ require_relative 'Transition'
5
5
 
6
6
  module Stateful
7
7
  class State
8
-
9
8
  attr_accessor :name
10
9
  attr_accessor :transitions
11
10
 
@@ -5,7 +5,6 @@ require_relative 'State'
5
5
 
6
6
  module Stateful
7
7
  class StateMachine
8
-
9
8
  attr_accessor :options
10
9
  attr_reader(
11
10
  :all,
@@ -3,13 +3,11 @@
3
3
 
4
4
  module Stateful
5
5
  class Transition
6
-
7
6
  attr_reader :event_name
8
7
  attr_reader :next_state_name
9
8
 
10
9
  def initialize(event_name, next_state_name)
11
10
  @event_name, @next_state_name = event_name, next_state_name
12
11
  end
13
-
14
12
  end
15
13
  end
@@ -1,3 +1,3 @@
1
1
  module Stateful
2
- VERSION = '2.3.3'
2
+ VERSION = '2.3.5'
3
3
  end
data/lib/Stateful.rb CHANGED
@@ -1,24 +1,24 @@
1
1
  # Stateful.rb
2
2
  # Stateful
3
3
 
4
- module Stateful
4
+ require_relative 'Stateful/VERSION'
5
5
 
6
+ module Stateful
6
7
  class << self
7
8
 
8
9
  def extended(klass)
9
10
  if Object.const_defined?(:ActiveRecord) && defined?(::ActiveRecord::Base) && klass < ::ActiveRecord::Base
10
- require_relative File.join('Stateful', 'ActiveRecord')
11
+ require_relative 'Stateful/ActiveRecord'
11
12
  klass.extend(Stateful::ActiveRecord)
12
13
  elsif Object.const_defined?(:Sequel) && defined?(::Sequel::Model) && klass < ::Sequel::Model
13
- require_relative File.join('Stateful', 'Sequel')
14
+ require_relative 'Stateful/Sequel'
14
15
  klass.extend(Stateful::Sequel)
15
16
  else
16
- require_relative File.join('Stateful', 'Poro')
17
+ require_relative 'Stateful/Poro'
17
18
  klass.extend(Stateful::Poro)
18
19
  end
19
20
  end
20
21
  alias_method :included, :extended
21
22
 
22
23
  end # class << self
23
-
24
24
  end
data/test/Stateful.rb CHANGED
@@ -10,3 +10,5 @@ poro_specs.each{|spec| require spec}
10
10
 
11
11
  sequel_specs = Dir[File.join(test_dir, 'Sequel', '**', '*.rb')]
12
12
  sequel_specs.each{|spec| require spec}
13
+
14
+ require_relative 'VERSION'
data/test/VERSION.rb ADDED
@@ -0,0 +1,25 @@
1
+ # test/VERSION.rb
2
+
3
+ gem 'minitest'
4
+ gem 'minitest-spec-context'
5
+
6
+ require 'minitest/autorun'
7
+ require 'minitest-spec-context'
8
+ require_relative '../lib/Stateful'
9
+
10
+ describe Stateful do
11
+ describe "VERSION" do
12
+ it "is a string" do
13
+ _(Stateful::VERSION).must_be_instance_of String
14
+ end
15
+
16
+ it "is three numbers separated by dots" do
17
+ _(Stateful::VERSION).must_match(/\A\d+\.\d+\.\d+\z/)
18
+ end
19
+
20
+ it "matches the newest entry in the CHANGELOG" do
21
+ changelog = File.read(File.expand_path('../CHANGELOG.md', __dir__))
22
+ _(changelog[/^## (\d+\.\d+\.\d+) \(/, 1]).must_equal Stateful::VERSION
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stateful.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
@@ -148,6 +148,7 @@ files:
148
148
  - test/Sequel/WithPersistenceSpecificExtendAndStatefulBlock.rb
149
149
  - test/Sequel/test_helper.rb
150
150
  - test/Stateful.rb
151
+ - test/VERSION.rb
151
152
  homepage: http://github.com/thoran/stateful
152
153
  licenses:
153
154
  - MIT