rails_state_machine 2.0.0 → 2.1.0

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: 12ccebe03922ae8add9f35e88e0b2d9759e8105b8278713242fc88df697a320a
4
- data.tar.gz: 44c8d685840968e1e69ce0a225062a9ca84e2715fd515cc7cbada5923dff204a
3
+ metadata.gz: d01a1094865abf2d8451c41a75bb4da8b5c1f457d46c88580045cf13ac5af2ea
4
+ data.tar.gz: f7575ce50426110e387c438974a30ed4b3511413506243f50537e15abd1baef6
5
5
  SHA512:
6
- metadata.gz: 6e1a075ea8c01a222e872672925ce96c884491f4deced754c21dc598f65dd5aecb9381f0097269c9efdd5da855a10a69e9a1da63b1decaf047990cc7e8e57487
7
- data.tar.gz: 6337d7f34d934b8a62239dcef8ed45a88fe545311cbc0e0c7b0728a03f047362e237104802caf929ff3ea72e669ba445365dc8afa7e92737893904421f798ff4
6
+ metadata.gz: 50ebcbd93b785b373721dc3d5ae6d84108c2a7d7942ce573f454c17198a63654a0782ea5bd4a797fb5220276af17addee8788d240ec4314df505aeced00dee1a
7
+ data.tar.gz: d28ec9396d3b28a2ba7b4741039e4ff2b9936fec67d0b7f7d3be89e62c4ac68f739871ed422b1b2a1f260f0fb422e55b0bd8b5da8d7cfc6073d973e70a293a90
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: Tests
3
+ 'on':
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ jobs:
11
+ test_pg:
12
+ runs-on: ubuntu-20.04
13
+ services:
14
+ postgres:
15
+ image: postgres:9.3
16
+ env:
17
+ POSTGRES_PASSWORD: postgres
18
+ options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s
19
+ --health-retries 5"
20
+ ports:
21
+ - 5432:5432
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ include:
26
+ - ruby: 2.3.8
27
+ gemfile: Gemfile.5.1.pg
28
+ - ruby: 2.4.6
29
+ gemfile: Gemfile.5.1.pg
30
+ - ruby: 2.3.8
31
+ gemfile: Gemfile.5.2.pg
32
+ - ruby: 2.4.6
33
+ gemfile: Gemfile.5.2.pg
34
+ - ruby: 2.5.6
35
+ gemfile: Gemfile.5.2.pg
36
+ - ruby: 2.5.6
37
+ gemfile: Gemfile.6.0.pg
38
+ - ruby: 2.6.6
39
+ gemfile: Gemfile.6.0.pg
40
+ - ruby: 2.7.2
41
+ gemfile: Gemfile.6.0.pg
42
+ - ruby: 2.7.2
43
+ gemfile: Gemfile.6.1.pg
44
+ - ruby: 3.0.0
45
+ gemfile: Gemfile.6.1.pg
46
+ env:
47
+ BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
48
+ steps:
49
+ - uses: actions/checkout@v2
50
+ - name: Install ruby
51
+ uses: ruby/setup-ruby@v1
52
+ with:
53
+ ruby-version: "${{ matrix.ruby }}"
54
+ - name: Setup database
55
+ run: |
56
+ sudo apt-get install -y postgresql-client
57
+ PGPASSWORD=postgres psql -c 'create database rails_state_machine_test;' -U postgres -p 5432 -h localhost
58
+ - name: Bundle
59
+ run: |
60
+ gem install bundler:2.1.4
61
+ bundle install --no-deployment
62
+ - name: Run tests
63
+ run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
10
10
  ### Breaking changes
11
11
 
12
12
 
13
+ ## 2.1.0 2021-03-30
14
+
15
+ ### Compatible changes
16
+
17
+ - Added support for Ruby 3.0.
18
+
13
19
  ## 2.0.0 2019-09-30
14
20
 
15
21
  ### Compatible changes
data/Gemfile.5.1.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_state_machine (2.0.0)
4
+ rails_state_machine (2.1.0)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -53,7 +53,7 @@ GEM
53
53
  database_cleaner (1.6.2)
54
54
  diff-lcs (1.3)
55
55
  erubi (1.7.0)
56
- gemika (0.4.0)
56
+ gemika (0.5.0)
57
57
  globalid (0.4.1)
58
58
  activesupport (>= 4.2.0)
59
59
  i18n (0.9.1)
@@ -146,4 +146,4 @@ DEPENDENCIES
146
146
  rspec (~> 3.5)
147
147
 
148
148
  BUNDLED WITH
149
- 2.0.2
149
+ 2.2.3
data/Gemfile.5.2.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_state_machine (2.0.0)
4
+ rails_state_machine (2.1.0)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -57,7 +57,7 @@ GEM
57
57
  database_cleaner (1.7.0)
58
58
  diff-lcs (1.3)
59
59
  erubi (1.7.1)
60
- gemika (0.4.0)
60
+ gemika (0.5.0)
61
61
  globalid (0.4.1)
62
62
  activesupport (>= 4.2.0)
63
63
  i18n (1.1.0)
@@ -70,7 +70,9 @@ GEM
70
70
  marcel (0.3.2)
71
71
  mimemagic (~> 0.3.2)
72
72
  method_source (0.9.0)
73
- mimemagic (0.3.2)
73
+ mimemagic (0.3.10)
74
+ nokogiri (~> 1)
75
+ rake
74
76
  mini_mime (1.0.1)
75
77
  mini_portile2 (2.3.0)
76
78
  minitest (5.11.3)
@@ -154,4 +156,4 @@ DEPENDENCIES
154
156
  rspec (~> 3.5)
155
157
 
156
158
  BUNDLED WITH
157
- 2.0.2
159
+ 2.2.15
data/Gemfile.6.0.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_state_machine (2.0.0)
4
+ rails_state_machine (2.1.0)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -70,7 +70,7 @@ GEM
70
70
  database_cleaner (1.7.0)
71
71
  diff-lcs (1.3)
72
72
  erubi (1.9.0)
73
- gemika (0.4.0)
73
+ gemika (0.5.0)
74
74
  globalid (0.4.2)
75
75
  activesupport (>= 4.2.0)
76
76
  i18n (1.6.0)
@@ -83,7 +83,9 @@ GEM
83
83
  marcel (0.3.3)
84
84
  mimemagic (~> 0.3.2)
85
85
  method_source (0.9.2)
86
- mimemagic (0.3.3)
86
+ mimemagic (0.3.10)
87
+ nokogiri (~> 1)
88
+ rake
87
89
  mini_mime (1.0.2)
88
90
  mini_portile2 (2.4.0)
89
91
  minitest (5.12.2)
@@ -170,4 +172,4 @@ DEPENDENCIES
170
172
  rspec (~> 3.5)
171
173
 
172
174
  BUNDLED WITH
173
- 2.0.2
175
+ 2.1.4
data/Gemfile.6.1.pg ADDED
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Runtime dependencies
4
+ gem 'rails', '~>6.1.0'
5
+ gem 'pg'
6
+
7
+ # Development dependencies
8
+ gem 'rspec', '~>3.5'
9
+ gem 'rake'
10
+ gem 'pry-byebug'
11
+ gem 'gemika'
12
+ gem 'database_cleaner'
13
+
14
+ # Gem under test
15
+ gem 'rails_state_machine', :path => '.'
@@ -0,0 +1,181 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rails_state_machine (2.1.0)
5
+ activerecord
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (6.1.3.1)
11
+ actionpack (= 6.1.3.1)
12
+ activesupport (= 6.1.3.1)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (6.1.3.1)
16
+ actionpack (= 6.1.3.1)
17
+ activejob (= 6.1.3.1)
18
+ activerecord (= 6.1.3.1)
19
+ activestorage (= 6.1.3.1)
20
+ activesupport (= 6.1.3.1)
21
+ mail (>= 2.7.1)
22
+ actionmailer (6.1.3.1)
23
+ actionpack (= 6.1.3.1)
24
+ actionview (= 6.1.3.1)
25
+ activejob (= 6.1.3.1)
26
+ activesupport (= 6.1.3.1)
27
+ mail (~> 2.5, >= 2.5.4)
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (6.1.3.1)
30
+ actionview (= 6.1.3.1)
31
+ activesupport (= 6.1.3.1)
32
+ rack (~> 2.0, >= 2.0.9)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
+ actiontext (6.1.3.1)
37
+ actionpack (= 6.1.3.1)
38
+ activerecord (= 6.1.3.1)
39
+ activestorage (= 6.1.3.1)
40
+ activesupport (= 6.1.3.1)
41
+ nokogiri (>= 1.8.5)
42
+ actionview (6.1.3.1)
43
+ activesupport (= 6.1.3.1)
44
+ builder (~> 3.1)
45
+ erubi (~> 1.4)
46
+ rails-dom-testing (~> 2.0)
47
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
+ activejob (6.1.3.1)
49
+ activesupport (= 6.1.3.1)
50
+ globalid (>= 0.3.6)
51
+ activemodel (6.1.3.1)
52
+ activesupport (= 6.1.3.1)
53
+ activerecord (6.1.3.1)
54
+ activemodel (= 6.1.3.1)
55
+ activesupport (= 6.1.3.1)
56
+ activestorage (6.1.3.1)
57
+ actionpack (= 6.1.3.1)
58
+ activejob (= 6.1.3.1)
59
+ activerecord (= 6.1.3.1)
60
+ activesupport (= 6.1.3.1)
61
+ marcel (~> 1.0.0)
62
+ mini_mime (~> 1.0.2)
63
+ activesupport (6.1.3.1)
64
+ concurrent-ruby (~> 1.0, >= 1.0.2)
65
+ i18n (>= 1.6, < 2)
66
+ minitest (>= 5.1)
67
+ tzinfo (~> 2.0)
68
+ zeitwerk (~> 2.3)
69
+ builder (3.2.4)
70
+ byebug (11.1.3)
71
+ coderay (1.1.3)
72
+ concurrent-ruby (1.1.8)
73
+ crass (1.0.6)
74
+ database_cleaner (2.0.1)
75
+ database_cleaner-active_record (~> 2.0.0)
76
+ database_cleaner-active_record (2.0.0)
77
+ activerecord (>= 5.a)
78
+ database_cleaner-core (~> 2.0.0)
79
+ database_cleaner-core (2.0.1)
80
+ diff-lcs (1.4.4)
81
+ erubi (1.10.0)
82
+ gemika (0.5.0)
83
+ globalid (0.4.2)
84
+ activesupport (>= 4.2.0)
85
+ i18n (1.8.9)
86
+ concurrent-ruby (~> 1.0)
87
+ loofah (2.9.0)
88
+ crass (~> 1.0.2)
89
+ nokogiri (>= 1.5.9)
90
+ mail (2.7.1)
91
+ mini_mime (>= 0.1.1)
92
+ marcel (1.0.0)
93
+ method_source (1.0.0)
94
+ mini_mime (1.0.3)
95
+ mini_portile2 (2.5.0)
96
+ minitest (5.14.4)
97
+ nio4r (2.5.7)
98
+ nokogiri (1.11.2)
99
+ mini_portile2 (~> 2.5.0)
100
+ racc (~> 1.4)
101
+ pg (1.2.3)
102
+ pry (0.13.1)
103
+ coderay (~> 1.1)
104
+ method_source (~> 1.0)
105
+ pry-byebug (3.9.0)
106
+ byebug (~> 11.0)
107
+ pry (~> 0.13.0)
108
+ racc (1.5.2)
109
+ rack (2.2.3)
110
+ rack-test (1.1.0)
111
+ rack (>= 1.0, < 3)
112
+ rails (6.1.3.1)
113
+ actioncable (= 6.1.3.1)
114
+ actionmailbox (= 6.1.3.1)
115
+ actionmailer (= 6.1.3.1)
116
+ actionpack (= 6.1.3.1)
117
+ actiontext (= 6.1.3.1)
118
+ actionview (= 6.1.3.1)
119
+ activejob (= 6.1.3.1)
120
+ activemodel (= 6.1.3.1)
121
+ activerecord (= 6.1.3.1)
122
+ activestorage (= 6.1.3.1)
123
+ activesupport (= 6.1.3.1)
124
+ bundler (>= 1.15.0)
125
+ railties (= 6.1.3.1)
126
+ sprockets-rails (>= 2.0.0)
127
+ rails-dom-testing (2.0.3)
128
+ activesupport (>= 4.2.0)
129
+ nokogiri (>= 1.6)
130
+ rails-html-sanitizer (1.3.0)
131
+ loofah (~> 2.3)
132
+ railties (6.1.3.1)
133
+ actionpack (= 6.1.3.1)
134
+ activesupport (= 6.1.3.1)
135
+ method_source
136
+ rake (>= 0.8.7)
137
+ thor (~> 1.0)
138
+ rake (13.0.3)
139
+ rspec (3.10.0)
140
+ rspec-core (~> 3.10.0)
141
+ rspec-expectations (~> 3.10.0)
142
+ rspec-mocks (~> 3.10.0)
143
+ rspec-core (3.10.1)
144
+ rspec-support (~> 3.10.0)
145
+ rspec-expectations (3.10.1)
146
+ diff-lcs (>= 1.2.0, < 2.0)
147
+ rspec-support (~> 3.10.0)
148
+ rspec-mocks (3.10.2)
149
+ diff-lcs (>= 1.2.0, < 2.0)
150
+ rspec-support (~> 3.10.0)
151
+ rspec-support (3.10.2)
152
+ sprockets (4.0.2)
153
+ concurrent-ruby (~> 1.0)
154
+ rack (> 1, < 3)
155
+ sprockets-rails (3.2.2)
156
+ actionpack (>= 4.0)
157
+ activesupport (>= 4.0)
158
+ sprockets (>= 3.0.0)
159
+ thor (1.1.0)
160
+ tzinfo (2.0.4)
161
+ concurrent-ruby (~> 1.0)
162
+ websocket-driver (0.7.3)
163
+ websocket-extensions (>= 0.1.0)
164
+ websocket-extensions (0.1.5)
165
+ zeitwerk (2.4.2)
166
+
167
+ PLATFORMS
168
+ ruby
169
+
170
+ DEPENDENCIES
171
+ database_cleaner
172
+ gemika
173
+ pg
174
+ pry-byebug
175
+ rails (~> 6.1.0)
176
+ rails_state_machine!
177
+ rake
178
+ rspec (~> 3.5)
179
+
180
+ BUNDLED WITH
181
+ 2.2.3
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- # Rails State Machine
2
- [![Build Status](https://travis-ci.org/makandra/rails_state_machine.svg?branch=master)](https://travis-ci.org/makandra/rails_state_machine)
1
+ # Rails State Machine [![Tests](https://github.com/makandra/rails_state_machine/workflows/Tests/badge.svg)](https://github.com/makandra/rails_state_machine/actions?query=branch:master)
3
2
 
4
3
  Rails State Machine is a ActiveRecord-bound state machine.
5
4
 
@@ -149,15 +148,15 @@ end
149
148
 
150
149
  There are tests in `spec`. We only accept PRs with tests. To run tests:
151
150
 
152
- - Install Ruby 2.4.4
151
+ - Install Ruby 2.4.6
153
152
  - Copy the file `spec/support/database.sample.yml` to `spec/support/database.yml` and enter your PostgreSQL credentials. You can create the database afterwards with `createdb rails_state_machine_test`.
154
153
  - Run `bin/setup` to install development dependencies.
155
154
  - Run tests using `bundle exec rspec`
156
155
 
157
- We recommend to test large changes against multiple versions of Ruby and multiple dependency sets. Supported combinations are configured in `.travis.yml`. We provide some rake tasks to help with this:
156
+ We recommend to test large changes against multiple versions of Ruby and multiple dependency sets. Supported combinations are configured in `.github/workflows/test.yml`. We provide some rake tasks to help with this:
158
157
 
159
- - Install development dependencies using `bundle matrix:install`
160
- - Run tests using `bundle matrix:spec`
158
+ - Install development dependencies using `rake matrix:install`
159
+ - Run tests using `rake matrix:spec`
161
160
 
162
161
  You can also run `bin/console` for an interactive prompt that will allow you to experiment.
163
162
 
@@ -175,7 +174,7 @@ If you would like to contribute:
175
174
 
176
175
  We want to keep this gem leightweight and on topic. If you are unsure whether a change would make it into the gem, open an issue and discuss.
177
176
 
178
- Note that we have configured Travis CI to automatically run tests in all supported Ruby versions and dependency sets after each push. We will only merge pull requests after a green Travis build.
177
+ Note that we have configured GitHub Actions to automatically run tests in all supported Ruby versions and dependency sets after each push. We will only merge pull requests after a green workflow build.
179
178
 
180
179
  ## License
181
180
 
@@ -26,7 +26,7 @@ module RailsStateMachine
26
26
 
27
27
  def transitions(**options)
28
28
  if options.present?
29
- add_transitions(options)
29
+ add_transitions(**options)
30
30
  else
31
31
  @transitions_by_state_name.values
32
32
  end
@@ -48,7 +48,7 @@ module RailsStateMachine
48
48
  private
49
49
 
50
50
  def state(name, **options)
51
- @states_by_name[name] = State.new(name, options)
51
+ @states_by_name[name] = State.new(name, **options)
52
52
  end
53
53
 
54
54
  def event(name, &block)
@@ -1,3 +1,3 @@
1
1
  module RailsStateMachine
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_state_machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Hartherz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-09-30 00:00:00.000000000 Z
12
+ date: 2021-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -74,10 +74,10 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".github/workflows/test.yml"
77
78
  - ".gitignore"
78
79
  - ".rspec"
79
80
  - ".ruby-version"
80
- - ".travis.yml"
81
81
  - CHANGELOG.md
82
82
  - Gemfile
83
83
  - Gemfile.5.1.pg
@@ -86,6 +86,8 @@ files:
86
86
  - Gemfile.5.2.pg.lock
87
87
  - Gemfile.6.0.pg
88
88
  - Gemfile.6.0.pg.lock
89
+ - Gemfile.6.1.pg
90
+ - Gemfile.6.1.pg.lock
89
91
  - Gemfile.lock
90
92
  - LICENSE
91
93
  - LICENSE.txt
@@ -121,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
123
  - !ruby/object:Gem::Version
122
124
  version: '0'
123
125
  requirements: []
124
- rubygems_version: 3.0.3
126
+ rubygems_version: 3.2.3
125
127
  signing_key:
126
128
  specification_version: 4
127
129
  summary: ActiveRecord-bound state machine
data/.travis.yml DELETED
@@ -1,37 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
-
5
- before_script:
6
- - psql -c 'create database rails_state_machine_test;' -U postgres
7
- - mysql -e 'create database IF NOT EXISTS rails_state_machine_test;'
8
-
9
- install:
10
- - gem install bundler:2.0.2
11
- # Replace default Travis CI bundler script with a version that doesn't
12
- # explode when lockfile doesn't match recently bumped version
13
- - bundle install --no-deployment --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
14
-
15
- script: bundle exec rake current_rspec
16
-
17
- matrix:
18
- include:
19
- - rvm: 2.3.8
20
- gemfile: Gemfile.5.1.pg
21
- - rvm: 2.4.6
22
- gemfile: Gemfile.5.1.pg
23
- - rvm: 2.3.8
24
- gemfile: Gemfile.5.2.pg
25
- - rvm: 2.4.6
26
- gemfile: Gemfile.5.2.pg
27
- - rvm: 2.5.6
28
- gemfile: Gemfile.5.2.pg
29
- - rvm: 2.5.6
30
- gemfile: Gemfile.6.0.pg
31
- - rvm: 2.6.4
32
- gemfile: Gemfile.6.0.pg
33
-
34
- dist: trusty
35
-
36
- addons:
37
- postgresql: 9.3