statesman 12.0.0 → 13.0.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/.devcontainer/devcontainer.json +31 -0
- data/.devcontainer/docker-compose.yml +39 -0
- data/.github/workflows/tests.yml +42 -20
- data/.rspec +1 -0
- data/.rubocop.yml +1 -4
- data/.rubocop_todo.yml +23 -38
- data/.ruby-version +1 -1
- data/CHANGELOG.md +185 -51
- data/CONTRIBUTING.md +14 -13
- data/Gemfile +15 -1
- data/README.md +136 -77
- data/docs/COMPATIBILITY.md +3 -3
- data/lib/statesman/adapters/active_record.rb +0 -2
- data/lib/statesman/adapters/active_record_queries.rb +1 -1
- data/lib/statesman/callback.rb +2 -2
- data/lib/statesman/config.rb +1 -1
- data/lib/statesman/guard.rb +1 -1
- data/lib/statesman/machine.rb +8 -0
- data/lib/statesman/version.rb +1 -1
- data/lib/statesman.rb +1 -1
- data/spec/statesman/adapters/active_record_queries_spec.rb +2 -2
- data/spec/statesman/adapters/active_record_spec.rb +8 -6
- data/spec/statesman/adapters/shared_examples.rb +4 -3
- data/spec/statesman/adapters/type_safe_active_record_queries_spec.rb +1 -1
- data/spec/statesman/machine_spec.rb +81 -9
- data/spec/support/active_record.rb +2 -2
- data/statesman.gemspec +1 -15
- metadata +7 -202
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15bf5cd57e2049db1ae4a0e93f41b16528c8a73c5741cf6337ec280f6ed1041
|
4
|
+
data.tar.gz: 28fba6b8a3304b97fb97a56d145243b5da73f79057fc05449dd3c48a6ea76f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5df7c20cbbc737fc8527d959ad8d894cc0e5fece227099287dc1a96d72cbc62000d5d87b854f4a8483b2ee58c726154d9d50ca7568be27fc4126afe5a94818e5
|
7
|
+
data.tar.gz: 29c4efb1b93e7057ba343b8c4894978e3d9660a53043755f8d26e6378fa804085cd83e8d81203ab7f81a2cbcdd89bab5126042a113d9bb0ca376cb5967b65ba3
|
@@ -0,0 +1,31 @@
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
2
|
+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
3
|
+
{
|
4
|
+
"name": "Ruby",
|
5
|
+
"dockerComposeFile": "docker-compose.yml",
|
6
|
+
"service": "ruby",
|
7
|
+
"workspaceFolder": "/workspace",
|
8
|
+
// Environment variables for database connections
|
9
|
+
"containerEnv": {
|
10
|
+
"POSTGRES_URL": "postgresql://postgres:password@postgres:5432/statesman_dev",
|
11
|
+
"MYSQL_URL": "mysql2://root:password@mysql:3306/statesman_dev",
|
12
|
+
"PGHOST": "postgres",
|
13
|
+
"PGPORT": "5432",
|
14
|
+
"PGDATABASE": "statesman_dev",
|
15
|
+
"PGUSER": "postgres",
|
16
|
+
"PGPASSWORD": "password",
|
17
|
+
"MYSQL_HOST": "mysql",
|
18
|
+
"MYSQL_PORT": "3306",
|
19
|
+
"MYSQL_DATABASE": "statesman_dev",
|
20
|
+
"MYSQL_USER": "root",
|
21
|
+
"MYSQL_PASSWORD": "password"
|
22
|
+
},
|
23
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
24
|
+
// "forwardPorts": [],
|
25
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
26
|
+
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y postgresql-client default-mysql-client && sudo chown -R vscode:vscode /usr/local/rvm/gems/default && bundle install",
|
27
|
+
// Configure tool-specific properties.
|
28
|
+
// "customizations": {},
|
29
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
30
|
+
// "remoteUser": "root"
|
31
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
version: '3.8'
|
2
|
+
|
3
|
+
services:
|
4
|
+
ruby:
|
5
|
+
image: mcr.microsoft.com/devcontainers/ruby:1-3.4-bullseye
|
6
|
+
volumes:
|
7
|
+
- ..:/workspace:cached
|
8
|
+
- gem-cache:/usr/local/rvm/gems/default
|
9
|
+
command: sleep infinity
|
10
|
+
depends_on:
|
11
|
+
- postgres
|
12
|
+
- mysql
|
13
|
+
|
14
|
+
postgres:
|
15
|
+
image: postgres:15
|
16
|
+
restart: unless-stopped
|
17
|
+
environment:
|
18
|
+
POSTGRES_PASSWORD: password
|
19
|
+
POSTGRES_DB: statesman_dev
|
20
|
+
volumes:
|
21
|
+
- postgres-data:/var/lib/postgresql/data
|
22
|
+
expose:
|
23
|
+
- "5432"
|
24
|
+
|
25
|
+
mysql:
|
26
|
+
image: mysql:8.0
|
27
|
+
restart: unless-stopped
|
28
|
+
environment:
|
29
|
+
MYSQL_ROOT_PASSWORD: password
|
30
|
+
MYSQL_DATABASE: statesman_dev
|
31
|
+
volumes:
|
32
|
+
- mysql-data:/var/lib/mysql
|
33
|
+
expose:
|
34
|
+
- "3306"
|
35
|
+
|
36
|
+
volumes:
|
37
|
+
postgres-data:
|
38
|
+
mysql-data:
|
39
|
+
gem-cache:
|
data/.github/workflows/tests.yml
CHANGED
@@ -3,8 +3,9 @@ name: tests
|
|
3
3
|
on:
|
4
4
|
push:
|
5
5
|
branches:
|
6
|
-
-
|
6
|
+
- master
|
7
7
|
pull_request:
|
8
|
+
types: [opened, reopened, synchronize]
|
8
9
|
|
9
10
|
concurrency:
|
10
11
|
group: ${{ github.workflow }}-${{ github.ref }}
|
@@ -14,26 +15,47 @@ jobs:
|
|
14
15
|
rubocop:
|
15
16
|
runs-on: ubuntu-latest
|
16
17
|
steps:
|
17
|
-
- uses: actions/checkout@
|
18
|
+
- uses: actions/checkout@v5
|
18
19
|
- uses: ruby/setup-ruby@v1
|
19
20
|
with:
|
20
21
|
bundler-cache: true
|
21
22
|
- run: bundle exec rubocop --extra-details --display-style-guide --parallel --force-exclusion
|
22
23
|
|
24
|
+
sqlite:
|
25
|
+
strategy:
|
26
|
+
fail-fast: false
|
27
|
+
matrix:
|
28
|
+
ruby-version: ["3.2", "3.3", "3.4", "3.5"]
|
29
|
+
rails-version:
|
30
|
+
- "7.1"
|
31
|
+
- "7.2"
|
32
|
+
- "8.0"
|
33
|
+
- "main"
|
34
|
+
runs-on: ubuntu-latest
|
35
|
+
env:
|
36
|
+
RAILS_VERSION: ${{ matrix.rails-version }}
|
37
|
+
steps:
|
38
|
+
- uses: actions/checkout@v5
|
39
|
+
- name: Set up Ruby
|
40
|
+
uses: ruby/setup-ruby@v1
|
41
|
+
with:
|
42
|
+
bundler-cache: true
|
43
|
+
ruby-version: "${{ matrix.ruby-version }}"
|
44
|
+
- name: Run specs
|
45
|
+
run: |
|
46
|
+
bundle exec rspec --profile --format progress --format RSpec::Github::Formatter
|
47
|
+
|
23
48
|
postgres:
|
24
49
|
strategy:
|
25
50
|
fail-fast: false
|
26
51
|
matrix:
|
27
|
-
ruby-version: ["3.
|
52
|
+
ruby-version: ["3.2", "3.3", "3.4", "3.5"]
|
28
53
|
rails-version:
|
29
|
-
- "
|
30
|
-
- "7.
|
31
|
-
- "
|
54
|
+
- "7.1"
|
55
|
+
- "7.2"
|
56
|
+
- "8.0"
|
32
57
|
- "main"
|
33
|
-
postgres-version: ["
|
34
|
-
exclude:
|
35
|
-
- ruby-version: "3.2"
|
36
|
-
rails-version: "6.1.7.6"
|
58
|
+
postgres-version: ["14", "15", "16", "17"]
|
37
59
|
runs-on: ubuntu-latest
|
38
60
|
services:
|
39
61
|
postgres:
|
@@ -52,8 +74,9 @@ jobs:
|
|
52
74
|
env:
|
53
75
|
DATABASE_URL: postgres://postgres:statesman@localhost/statesman_test
|
54
76
|
DATABASE_DEPENDENCY_PORT: "5432"
|
77
|
+
RAILS_VERSION: ${{ matrix.rails-version }}
|
55
78
|
steps:
|
56
|
-
- uses: actions/checkout@
|
79
|
+
- uses: actions/checkout@v5
|
57
80
|
- name: Set up Ruby
|
58
81
|
uses: ruby/setup-ruby@v1
|
59
82
|
with:
|
@@ -67,16 +90,14 @@ jobs:
|
|
67
90
|
strategy:
|
68
91
|
fail-fast: false
|
69
92
|
matrix:
|
70
|
-
ruby-version: ["3.
|
93
|
+
ruby-version: ["3.2", "3.3", "3.4", "3.5"]
|
71
94
|
rails-version:
|
72
|
-
- "
|
73
|
-
- "7.
|
74
|
-
- "
|
95
|
+
- "7.1"
|
96
|
+
- "7.2"
|
97
|
+
- "8.0"
|
75
98
|
- "main"
|
76
|
-
mysql-version: ["8.0", "8.
|
77
|
-
|
78
|
-
- ruby-version: 3.2
|
79
|
-
rails-version: "6.1.7.6"
|
99
|
+
mysql-version: ["8.0", "8.4", "9.4"]
|
100
|
+
|
80
101
|
runs-on: ubuntu-latest
|
81
102
|
services:
|
82
103
|
mysql:
|
@@ -96,8 +117,9 @@ jobs:
|
|
96
117
|
env:
|
97
118
|
DATABASE_URL: mysql2://foobar:password@127.0.0.1/statesman_test
|
98
119
|
DATABASE_DEPENDENCY_PORT: "3306"
|
120
|
+
RAILS_VERSION: ${{ matrix.rails-version }}
|
99
121
|
steps:
|
100
|
-
- uses: actions/checkout@
|
122
|
+
- uses: actions/checkout@v5
|
101
123
|
- name: Set up Ruby
|
102
124
|
uses: ruby/setup-ruby@v1
|
103
125
|
with:
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -4,7 +4,7 @@ inherit_gem:
|
|
4
4
|
gc_ruboconfig: rubocop.yml
|
5
5
|
|
6
6
|
AllCops:
|
7
|
-
TargetRubyVersion: 2
|
7
|
+
TargetRubyVersion: 3.2
|
8
8
|
NewCops: enable
|
9
9
|
|
10
10
|
Metrics/AbcSize:
|
@@ -15,6 +15,3 @@ Metrics/CyclomaticComplexity:
|
|
15
15
|
|
16
16
|
Metrics/PerceivedComplexity:
|
17
17
|
Max: 11
|
18
|
-
|
19
|
-
Gemspec/DevelopmentDependencies:
|
20
|
-
Enabled: false
|
data/.rubocop_todo.yml
CHANGED
@@ -1,56 +1,47 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2025-08-29 17:37:05 UTC using RuboCop version 1.80.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 1
|
10
|
-
# Configuration parameters:
|
11
|
-
# Include: **/*.gemspec
|
12
|
-
Gemspec/RequiredRubyVersion:
|
13
|
-
Exclude:
|
14
|
-
- 'statesman.gemspec'
|
15
|
-
|
16
|
-
# Offense count: 1
|
10
|
+
# Configuration parameters: AllowedParentClasses.
|
17
11
|
Lint/MissingSuper:
|
18
12
|
Exclude:
|
19
13
|
- 'lib/statesman/adapters/active_record_queries.rb'
|
20
14
|
|
21
|
-
# Offense count:
|
22
|
-
# Configuration parameters:
|
23
|
-
|
24
|
-
|
15
|
+
# Offense count: 2
|
16
|
+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
|
17
|
+
# AllowedMethods: call
|
18
|
+
# WaywardPredicates: nonzero?
|
19
|
+
Naming/PredicateMethod:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/statesman/callback.rb'
|
25
22
|
|
26
23
|
# Offense count: 1
|
27
|
-
# Configuration parameters:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
#
|
32
|
-
|
33
|
-
|
34
|
-
|
24
|
+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
|
25
|
+
# NamePrefix: is_, has_, have_, does_
|
26
|
+
# ForbiddenPrefixes: is_, has_, have_, does_
|
27
|
+
# AllowedMethods: is_a?
|
28
|
+
# MethodDefinitionMacros: define_method, define_singleton_method
|
29
|
+
Naming/PredicatePrefix:
|
30
|
+
Exclude:
|
31
|
+
- 'spec/**/*'
|
32
|
+
- 'lib/statesman/adapters/active_record.rb'
|
35
33
|
|
36
|
-
# Offense count:
|
34
|
+
# Offense count: 15
|
37
35
|
# Configuration parameters: CountAsOne.
|
38
36
|
RSpec/ExampleLength:
|
39
37
|
Max: 14
|
40
38
|
|
41
|
-
# Offense count:
|
39
|
+
# Offense count: 5
|
42
40
|
RSpec/ExpectInHook:
|
43
41
|
Exclude:
|
44
42
|
- 'spec/statesman/adapters/active_record_spec.rb'
|
45
43
|
- 'spec/statesman/machine_spec.rb'
|
46
44
|
|
47
|
-
# Offense count: 1
|
48
|
-
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
49
|
-
# Include: **/*_spec*rb*, **/spec/**/*
|
50
|
-
RSpec/FilePath:
|
51
|
-
Exclude:
|
52
|
-
- 'spec/statesman/exceptions_spec.rb'
|
53
|
-
|
54
45
|
# Offense count: 1
|
55
46
|
# Configuration parameters: AssignmentOnly.
|
56
47
|
RSpec/InstanceVariable:
|
@@ -80,11 +71,12 @@ RSpec/MessageSpies:
|
|
80
71
|
Exclude:
|
81
72
|
- 'spec/statesman/callback_spec.rb'
|
82
73
|
|
83
|
-
# Offense count:
|
74
|
+
# Offense count: 20
|
84
75
|
RSpec/MultipleExpectations:
|
85
76
|
Max: 3
|
86
77
|
|
87
|
-
# Offense count:
|
78
|
+
# Offense count: 64
|
79
|
+
# Configuration parameters: AllowedGroups.
|
88
80
|
RSpec/NestedGroups:
|
89
81
|
Max: 6
|
90
82
|
|
@@ -93,13 +85,6 @@ RSpec/RepeatedExampleGroupBody:
|
|
93
85
|
Exclude:
|
94
86
|
- 'spec/statesman/exceptions_spec.rb'
|
95
87
|
|
96
|
-
# Offense count: 12
|
97
|
-
RSpec/ScatteredSetup:
|
98
|
-
Exclude:
|
99
|
-
- 'spec/statesman/adapters/active_record_spec.rb'
|
100
|
-
- 'spec/statesman/adapters/shared_examples.rb'
|
101
|
-
- 'spec/statesman/machine_spec.rb'
|
102
|
-
|
103
88
|
# Offense count: 7
|
104
89
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
105
90
|
RSpec/VerifiedDoubles:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.5
|