state_machine_enum 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78487e87868cb11ef1113ca6f2867c665fc4d146e9fc16aaa5af35c94f2497a6
4
- data.tar.gz: bbc93da1d1d5f6f4a7895fe0e50ea5762b24142102da798f2559b86594d61858
3
+ metadata.gz: 4902a42140176efda107ea4e5caef0b4bd3f8e64554b2fde61f3507e51e80d96
4
+ data.tar.gz: 9f85490534c6667640cd050e13eeaf7ce202bbd5757e7ade6cd4d6cb4c191b90
5
5
  SHA512:
6
- metadata.gz: 0bf79eca0db499b50f9a253af0fdce5a9f11930f972e7ccad1a98b4f66e8fa644ee5c708bf9f49498264def55ecc206bb76cd60f95d6bd3597e803cfbd5bc10f
7
- data.tar.gz: 5bbad2193e08b61c4492c10cb7c2e64a611880c393e4de37a226dd29ff5c85cc0b428db816fdc893a0f10514ece7c018c5b13a952f069d446ec3447274893ba2
6
+ metadata.gz: 10ae6f605953606f563a80aa15b9cc7a70eedc73593d152aba3d5ab773b0243002dc13b0f66888e83008d6c0a341bee762a5bdbde61712e2310833b1345bc067
7
+ data.tar.gz: 8b7c7b452a1e0b962b9ef2f643dcdd220597474c87269dc4565bb5a8974af000e78bed0f2c41f8da40adf663a51bcdd21d0a6b7bb9bb3bab0f8a597c36d90032
data/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ This format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
6
+ ## 0.1.2
7
+
8
+ ### Added
9
+
10
+ - basic tests for a library
11
+
12
+ ### Changed
13
+
14
+ - #ensure_<attribute>_may_transition_to! method now actually verifies that an attribute can transition to a new state.
15
+
16
+ ## 0.1.1
17
+
18
+ ### Added
19
+
20
+ - Provide real authorts of this gem.
21
+
22
+ ## 0.1.0
23
+
24
+ - Initial release
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StateMachineEnum
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -114,6 +114,7 @@ module StateMachineEnum
114
114
  define_method(:"ensure_#{attribute_name}_may_transition_to!") do |next_state|
115
115
  val = self[attribute_name]
116
116
  raise InvalidState, "#{attribute_name} already is #{val.inspect}" if next_state.to_s == val
117
+ raise InvalidState, "#{attribute_name} may not transition from #{val.inspect} to #{next_state.inspect}" unless collector.may_transition?(val, next_state)
117
118
  end
118
119
 
119
120
  define_method(:"#{attribute_name}_may_transition_to?") do |next_state|
metadata CHANGED
@@ -1,31 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machine_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
8
8
  - Sebastian van Hesteren
9
9
  - Stanislav Katkov
10
10
  autorequire:
11
- bindir: exe
11
+ bindir: bin
12
12
  cert_chain: []
13
- date: 2024-06-07 00:00:00.000000000 Z
13
+ date: 2024-06-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '6.0'
21
+ version: '7'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '6.0'
28
+ version: '7'
29
+ - !ruby/object:Gem::Dependency
30
+ name: sqlite3
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '1.4'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.4'
43
+ - !ruby/object:Gem::Dependency
44
+ name: activerecord
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '7'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '7'
29
57
  description: Concern that makes it easy to define and enforce possibe state transitions
30
58
  for a field/object
31
59
  email:
@@ -37,6 +65,7 @@ extensions: []
37
65
  extra_rdoc_files: []
38
66
  files:
39
67
  - ".standard.yml"
68
+ - CHANGELOG.md
40
69
  - LICENSE.txt
41
70
  - README.md
42
71
  - Rakefile
@@ -49,6 +78,7 @@ licenses:
49
78
  metadata:
50
79
  homepage_uri: https://cheddar.me
51
80
  source_code_uri: https://github.com/cheddar-me/state_machine_enum
81
+ changelog_uri: https://github.com/cheddar-me/state_machine_enum/blob/main/CHANGELOG.md
52
82
  post_install_message:
53
83
  rdoc_options: []
54
84
  require_paths:
@@ -64,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
94
  - !ruby/object:Gem::Version
65
95
  version: '0'
66
96
  requirements: []
67
- rubygems_version: 3.5.10
97
+ rubygems_version: 3.5.9
68
98
  signing_key:
69
99
  specification_version: 4
70
100
  summary: Define possible state transitions for a field