simple_workflow 2.1.0 → 2.2.1

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: f3e6b480412f12b33ab1a43ea40edfd280fcf843e7b48307b79a186ea8dfec18
4
- data.tar.gz: '094717e238b6c347acdab6f597b65b1139f1a73dc2646c55ffe3bc702f2074c2'
3
+ metadata.gz: b48b1e1e4e2c025d51b43bcd8800688bd5b34701e614477e59b31db2be525653
4
+ data.tar.gz: 102dd804824b1deac4b309b0150cd9149524be5926ff048c21479ec9c7ed2d98
5
5
  SHA512:
6
- metadata.gz: aa6f9b54442208aee5c61201b3277862a055c6d5e7cbf462f0abbf2e8d249909505dd684ca2c786fdafaba445ed55a0b3a0dcee4d6d3afffde7edbe47a3ee92a
7
- data.tar.gz: 43249992ddb88144cfcc00ced9d9570c2aa722604ae4c2ff6f4d25c23db8f614bf33c0e9b2d197a3d48d92eb06253e35b72e3142d1ec6d090b9e2c380123869b
6
+ metadata.gz: a99be761b12d1fe90b73b108fea8f4fb611dcf458c350c10158e70f05d4e2bfbc2c857069272c8cee498445b6d41e53cab73a4ea483f42c7f7f099a086ac072e
7
+ data.tar.gz: 7015168be5b0f6c000fa98415155f3e4dd6be1f2561e450c25b75c3b78835abec87a8bfae2bcb84d332fae4a645911a34fbf47c8b2cf72e8662a66d947830b71
data/Gemfile.lock CHANGED
@@ -1,186 +1,236 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_workflow (2.1.0)
5
- rails (>= 4.2, < 7)
4
+ simple_workflow (2.2.1)
5
+ rails (>= 6.1, < 8)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.1.0)
11
- actionpack (= 6.1.0)
12
- activesupport (= 6.1.0)
10
+ actioncable (7.1.3.4)
11
+ actionpack (= 7.1.3.4)
12
+ activesupport (= 7.1.3.4)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (6.1.0)
16
- actionpack (= 6.1.0)
17
- activejob (= 6.1.0)
18
- activerecord (= 6.1.0)
19
- activestorage (= 6.1.0)
20
- activesupport (= 6.1.0)
15
+ zeitwerk (~> 2.6)
16
+ actionmailbox (7.1.3.4)
17
+ actionpack (= 7.1.3.4)
18
+ activejob (= 7.1.3.4)
19
+ activerecord (= 7.1.3.4)
20
+ activestorage (= 7.1.3.4)
21
+ activesupport (= 7.1.3.4)
21
22
  mail (>= 2.7.1)
22
- actionmailer (6.1.0)
23
- actionpack (= 6.1.0)
24
- actionview (= 6.1.0)
25
- activejob (= 6.1.0)
26
- activesupport (= 6.1.0)
23
+ net-imap
24
+ net-pop
25
+ net-smtp
26
+ actionmailer (7.1.3.4)
27
+ actionpack (= 7.1.3.4)
28
+ actionview (= 7.1.3.4)
29
+ activejob (= 7.1.3.4)
30
+ activesupport (= 7.1.3.4)
27
31
  mail (~> 2.5, >= 2.5.4)
28
- rails-dom-testing (~> 2.0)
29
- actionpack (6.1.0)
30
- actionview (= 6.1.0)
31
- activesupport (= 6.1.0)
32
- rack (~> 2.0, >= 2.0.9)
32
+ net-imap
33
+ net-pop
34
+ net-smtp
35
+ rails-dom-testing (~> 2.2)
36
+ actionpack (7.1.3.4)
37
+ actionview (= 7.1.3.4)
38
+ activesupport (= 7.1.3.4)
39
+ nokogiri (>= 1.8.5)
40
+ racc
41
+ rack (>= 2.2.4)
42
+ rack-session (>= 1.0.1)
33
43
  rack-test (>= 0.6.3)
34
- rails-dom-testing (~> 2.0)
35
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.1.0)
37
- actionpack (= 6.1.0)
38
- activerecord (= 6.1.0)
39
- activestorage (= 6.1.0)
40
- activesupport (= 6.1.0)
44
+ rails-dom-testing (~> 2.2)
45
+ rails-html-sanitizer (~> 1.6)
46
+ actiontext (7.1.3.4)
47
+ actionpack (= 7.1.3.4)
48
+ activerecord (= 7.1.3.4)
49
+ activestorage (= 7.1.3.4)
50
+ activesupport (= 7.1.3.4)
51
+ globalid (>= 0.6.0)
41
52
  nokogiri (>= 1.8.5)
42
- actionview (6.1.0)
43
- activesupport (= 6.1.0)
53
+ actionview (7.1.3.4)
54
+ activesupport (= 7.1.3.4)
44
55
  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.0)
49
- activesupport (= 6.1.0)
56
+ erubi (~> 1.11)
57
+ rails-dom-testing (~> 2.2)
58
+ rails-html-sanitizer (~> 1.6)
59
+ activejob (7.1.3.4)
60
+ activesupport (= 7.1.3.4)
50
61
  globalid (>= 0.3.6)
51
- activemodel (6.1.0)
52
- activesupport (= 6.1.0)
53
- activerecord (6.1.0)
54
- activemodel (= 6.1.0)
55
- activesupport (= 6.1.0)
56
- activestorage (6.1.0)
57
- actionpack (= 6.1.0)
58
- activejob (= 6.1.0)
59
- activerecord (= 6.1.0)
60
- activesupport (= 6.1.0)
61
- marcel (~> 0.3.1)
62
- mimemagic (~> 0.3.2)
63
- activesupport (6.1.0)
62
+ activemodel (7.1.3.4)
63
+ activesupport (= 7.1.3.4)
64
+ activerecord (7.1.3.4)
65
+ activemodel (= 7.1.3.4)
66
+ activesupport (= 7.1.3.4)
67
+ timeout (>= 0.4.0)
68
+ activestorage (7.1.3.4)
69
+ actionpack (= 7.1.3.4)
70
+ activejob (= 7.1.3.4)
71
+ activerecord (= 7.1.3.4)
72
+ activesupport (= 7.1.3.4)
73
+ marcel (~> 1.0)
74
+ activesupport (7.1.3.4)
75
+ base64
76
+ bigdecimal
64
77
  concurrent-ruby (~> 1.0, >= 1.0.2)
78
+ connection_pool (>= 2.2.5)
79
+ drb
65
80
  i18n (>= 1.6, < 2)
66
81
  minitest (>= 5.1)
82
+ mutex_m
67
83
  tzinfo (~> 2.0)
68
- zeitwerk (~> 2.3)
69
- ansi (1.5.0)
70
- ast (2.4.1)
71
- builder (3.2.4)
72
- concurrent-ruby (1.1.7)
84
+ ast (2.4.2)
85
+ base64 (0.2.0)
86
+ bigdecimal (3.1.8)
87
+ builder (3.3.0)
88
+ concurrent-ruby (1.3.2)
89
+ connection_pool (2.4.1)
73
90
  crass (1.0.6)
74
- docile (1.3.3)
75
- erubi (1.10.0)
76
- globalid (0.4.2)
77
- activesupport (>= 4.2.0)
78
- i18n (1.8.5)
91
+ date (3.3.4)
92
+ docile (1.4.0)
93
+ drb (2.2.1)
94
+ erubi (1.12.0)
95
+ globalid (1.2.1)
96
+ activesupport (>= 6.1)
97
+ i18n (1.14.5)
79
98
  concurrent-ruby (~> 1.0)
80
- loofah (2.8.0)
99
+ io-console (0.7.2)
100
+ irb (1.13.1)
101
+ rdoc (>= 4.0.0)
102
+ reline (>= 0.4.2)
103
+ json (2.7.2)
104
+ language_server-protocol (3.17.0.3)
105
+ loofah (2.22.0)
81
106
  crass (~> 1.0.2)
82
- nokogiri (>= 1.5.9)
83
- mail (2.7.1)
107
+ nokogiri (>= 1.12.0)
108
+ mail (2.8.1)
84
109
  mini_mime (>= 0.1.1)
85
- marcel (0.3.3)
86
- mimemagic (~> 0.3.2)
87
- method_source (1.0.0)
88
- mimemagic (0.3.5)
89
- mini_mime (1.0.2)
90
- mini_portile2 (2.4.0)
91
- minitest (5.14.2)
92
- minitest-reporters (1.4.2)
93
- ansi
94
- builder
95
- minitest (>= 5.0)
96
- ruby-progressbar
97
- nio4r (2.5.4)
98
- nokogiri (1.10.10)
99
- mini_portile2 (~> 2.4.0)
100
- parallel (1.20.1)
101
- parser (2.7.2.0)
110
+ net-imap
111
+ net-pop
112
+ net-smtp
113
+ marcel (1.0.4)
114
+ mini_mime (1.1.5)
115
+ mini_portile2 (2.8.7)
116
+ minitest (5.23.1)
117
+ mutex_m (0.2.0)
118
+ net-imap (0.4.12)
119
+ date
120
+ net-protocol
121
+ net-pop (0.1.2)
122
+ net-protocol
123
+ net-protocol (0.2.2)
124
+ timeout
125
+ net-smtp (0.5.0)
126
+ net-protocol
127
+ nio4r (2.7.3)
128
+ nokogiri (1.16.5)
129
+ mini_portile2 (~> 2.8.2)
130
+ racc (~> 1.4)
131
+ parallel (1.25.1)
132
+ parser (3.3.2.0)
102
133
  ast (~> 2.4.1)
103
- rack (2.2.3)
104
- rack-test (1.1.0)
105
- rack (>= 1.0, < 3)
106
- rails (6.1.0)
107
- actioncable (= 6.1.0)
108
- actionmailbox (= 6.1.0)
109
- actionmailer (= 6.1.0)
110
- actionpack (= 6.1.0)
111
- actiontext (= 6.1.0)
112
- actionview (= 6.1.0)
113
- activejob (= 6.1.0)
114
- activemodel (= 6.1.0)
115
- activerecord (= 6.1.0)
116
- activestorage (= 6.1.0)
117
- activesupport (= 6.1.0)
134
+ racc
135
+ psych (5.1.2)
136
+ stringio
137
+ racc (1.8.0)
138
+ rack (3.0.11)
139
+ rack-session (2.0.0)
140
+ rack (>= 3.0.0)
141
+ rack-test (2.1.0)
142
+ rack (>= 1.3)
143
+ rackup (2.1.0)
144
+ rack (>= 3)
145
+ webrick (~> 1.8)
146
+ rails (7.1.3.4)
147
+ actioncable (= 7.1.3.4)
148
+ actionmailbox (= 7.1.3.4)
149
+ actionmailer (= 7.1.3.4)
150
+ actionpack (= 7.1.3.4)
151
+ actiontext (= 7.1.3.4)
152
+ actionview (= 7.1.3.4)
153
+ activejob (= 7.1.3.4)
154
+ activemodel (= 7.1.3.4)
155
+ activerecord (= 7.1.3.4)
156
+ activestorage (= 7.1.3.4)
157
+ activesupport (= 7.1.3.4)
118
158
  bundler (>= 1.15.0)
119
- railties (= 6.1.0)
120
- sprockets-rails (>= 2.0.0)
121
- rails-dom-testing (2.0.3)
122
- activesupport (>= 4.2.0)
159
+ railties (= 7.1.3.4)
160
+ rails-dom-testing (2.2.0)
161
+ activesupport (>= 5.0.0)
162
+ minitest
123
163
  nokogiri (>= 1.6)
124
- rails-html-sanitizer (1.3.0)
125
- loofah (~> 2.3)
126
- railties (6.1.0)
127
- actionpack (= 6.1.0)
128
- activesupport (= 6.1.0)
129
- method_source
130
- rake (>= 0.8.7)
131
- thor (~> 1.0)
132
- rainbow (3.0.0)
133
- rake (13.0.3)
134
- regexp_parser (2.0.1)
135
- rexml (3.2.4)
136
- rubocop (0.93.1)
164
+ rails-html-sanitizer (1.6.0)
165
+ loofah (~> 2.21)
166
+ nokogiri (~> 1.14)
167
+ railties (7.1.3.4)
168
+ actionpack (= 7.1.3.4)
169
+ activesupport (= 7.1.3.4)
170
+ irb
171
+ rackup (>= 1.0.0)
172
+ rake (>= 12.2)
173
+ thor (~> 1.0, >= 1.2.2)
174
+ zeitwerk (~> 2.6)
175
+ rainbow (3.1.1)
176
+ rake (13.2.1)
177
+ rdoc (6.7.0)
178
+ psych (>= 4.0.0)
179
+ regexp_parser (2.9.2)
180
+ reline (0.5.8)
181
+ io-console (~> 0.5)
182
+ rexml (3.2.9)
183
+ strscan
184
+ rubocop (1.64.1)
185
+ json (~> 2.3)
186
+ language_server-protocol (>= 3.17.0)
137
187
  parallel (~> 1.10)
138
- parser (>= 2.7.1.5)
188
+ parser (>= 3.3.0.2)
139
189
  rainbow (>= 2.2.2, < 4.0)
140
- regexp_parser (>= 1.8)
141
- rexml
142
- rubocop-ast (>= 0.6.0)
190
+ regexp_parser (>= 1.8, < 3.0)
191
+ rexml (>= 3.2.5, < 4.0)
192
+ rubocop-ast (>= 1.31.1, < 2.0)
143
193
  ruby-progressbar (~> 1.7)
144
- unicode-display_width (>= 1.4.0, < 2.0)
145
- rubocop-ast (1.3.0)
146
- parser (>= 2.7.1.5)
147
- rubocop-performance (1.9.1)
148
- rubocop (>= 0.90.0, < 2.0)
149
- rubocop-ast (>= 0.4.0)
150
- rubocop-rails (2.9.1)
194
+ unicode-display_width (>= 2.4.0, < 3.0)
195
+ rubocop-ast (1.31.3)
196
+ parser (>= 3.3.1.0)
197
+ rubocop-performance (1.21.0)
198
+ rubocop (>= 1.48.1, < 2.0)
199
+ rubocop-ast (>= 1.31.1, < 2.0)
200
+ rubocop-rails (2.25.0)
151
201
  activesupport (>= 4.2.0)
152
202
  rack (>= 1.1)
153
- rubocop (>= 0.90.0, < 2.0)
154
- ruby-progressbar (1.10.1)
155
- simplecov (0.20.0)
203
+ rubocop (>= 1.33.0, < 2.0)
204
+ rubocop-ast (>= 1.31.1, < 2.0)
205
+ ruby-progressbar (1.13.0)
206
+ simplecov (0.22.0)
156
207
  docile (~> 1.1)
157
208
  simplecov-html (~> 0.11)
158
209
  simplecov_json_formatter (~> 0.1)
159
210
  simplecov-html (0.12.3)
160
- simplecov_json_formatter (0.1.2)
161
- sprockets (4.0.2)
211
+ simplecov_json_formatter (0.1.4)
212
+ stringio (3.1.0)
213
+ strscan (3.1.0)
214
+ thor (1.3.1)
215
+ timeout (0.4.1)
216
+ tzinfo (2.0.6)
162
217
  concurrent-ruby (~> 1.0)
163
- rack (> 1, < 3)
164
- sprockets-rails (3.2.2)
165
- actionpack (>= 4.0)
166
- activesupport (>= 4.0)
167
- sprockets (>= 3.0.0)
168
- thor (1.0.1)
169
- tzinfo (2.0.4)
170
- concurrent-ruby (~> 1.0)
171
- unicode-display_width (1.7.0)
172
- websocket-driver (0.7.3)
218
+ unicode-display_width (2.5.0)
219
+ webrick (1.8.1)
220
+ websocket-driver (0.7.6)
173
221
  websocket-extensions (>= 0.1.0)
174
222
  websocket-extensions (0.1.5)
175
- zeitwerk (2.4.2)
223
+ zeitwerk (2.6.15)
176
224
 
177
225
  PLATFORMS
178
226
  ruby
179
227
 
180
228
  DEPENDENCIES
181
- minitest-reporters (~> 1.0)
182
- rubocop (~> 0.49)
229
+ rubocop (~> 1.0)
183
230
  rubocop-performance (~> 1.5)
184
231
  rubocop-rails (~> 2.4)
185
232
  simple_workflow!
186
233
  simplecov (~> 0.9)
234
+
235
+ BUNDLED WITH
236
+ 2.3.8
data/README.md CHANGED
@@ -2,7 +2,7 @@ simple_workflow
2
2
  ===============
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/simple_workflow.svg)](https://badge.fury.io/rb/simple_workflow)
5
- [![Build Status](https://travis-ci.org/donv/simple_workflow.svg?branch=master)](https://travis-ci.org/donv/simple_workflow)
5
+ [![Test](https://github.com/donv/simple_workflow/actions/workflows/test.yml/badge.svg)](https://github.com/donv/simple_workflow/actions/workflows/test.yml)
6
6
 
7
7
  * http://github.com/donv/simple_workflow
8
8
  * http://rubydoc.info/gems/simple_workflow
data/Rakefile CHANGED
@@ -1,35 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rake'
4
- require 'rake/clean'
5
- require 'rake/testtask'
6
- require "#{File.dirname(__FILE__)}/lib/simple_workflow/version"
7
-
8
- GEM_FILE = "simple_workflow-#{SimpleWorkflow::VERSION}.gem"
9
- GEM_SPEC_FILE = 'simple_workflow.gemspec'
10
-
11
- CLEAN.include('simple_workflow-*.gem', 'tmp')
3
+ require 'bundler/gem_tasks'
12
4
 
13
5
  task default: :test
14
6
 
15
- desc 'Generate a gem'
16
- task gem: GEM_FILE
17
-
18
- file(GEM_FILE => GEM_SPEC_FILE) do
19
- puts "Generating #{GEM_FILE}"
20
- `gem build #{GEM_SPEC_FILE}`
21
- end
22
-
23
- desc 'Push the gem to RubyGems'
24
- task release: :gem do
25
- output = `git status --porcelain`
26
- raise "Workspace not clean!\n#{output}" unless output.empty?
27
-
28
- sh "git tag #{SimpleWorkflow::VERSION}"
29
- sh 'git push --tags'
30
- sh "gem push #{GEM_FILE}"
31
- end
32
-
7
+ require 'rake/testtask'
33
8
  Rake::TestTask.new do |t|
34
9
  t.libs << 'test'
35
10
  t.test_files = FileList['test/*_test.rb']
@@ -38,4 +13,7 @@ end
38
13
 
39
14
  require 'rubocop/rake_task'
40
15
  RuboCop::RakeTask.new
41
- Rake::Task[:test].enhance ['rubocop:auto_correct']
16
+
17
+ namespace :test do
18
+ task full: ['rubocop:autocorrect_all', :test]
19
+ end
@@ -66,7 +66,7 @@ module SimpleWorkflow::Controller
66
66
 
67
67
  def redirect_to_post(options)
68
68
  url = url_for options
69
- render text: <<~HTML.strip_heredoc, layout: false
69
+ render text: <<~HTML, layout: false
70
70
  <html>
71
71
  <body onload="document.getElementById('form').submit()">
72
72
  <form id="form" action="#{url}" method="POST">
@@ -23,7 +23,7 @@ module SimpleWorkflow::Detour
23
23
  return nil unless detours
24
24
 
25
25
  detour = detours.delete(origin_options) || detours.pop
26
- Rails.logger.debug "popped detour: #{detour.inspect} #{session[:detours].size} more"
26
+ Rails.logger.debug { "popped detour: #{detour.inspect} #{session[:detours].size} more" }
27
27
  reset_workflow(session) if detours.empty?
28
28
  detour
29
29
  end
@@ -44,7 +44,7 @@ module SimpleWorkflow::Helper
44
44
  end
45
45
  origin.update(origin_options) if origin.keys == [:anchor]
46
46
  url = url_for(options)
47
- url + (/\?/.match?(url) ? '&' : '?') + origin.to_h.to_param('detour')
47
+ url + (url.include?('?') ? '&' : '?') + origin.to_h.to_param('detour')
48
48
  end
49
49
 
50
50
  def origin_options
@@ -14,9 +14,9 @@ class SimpleWorkflow::Middleware
14
14
 
15
15
  def call(env)
16
16
  store_detour_from_params(env)
17
- status, headers, response = @app.call(env)
17
+ status, headers, body = @app.call(env)
18
18
  remove_old_detours(env)
19
- [status, headers, response]
19
+ [status, headers, body]
20
20
  end
21
21
 
22
22
  private
@@ -42,7 +42,7 @@ class SimpleWorkflow::Middleware
42
42
  end
43
43
 
44
44
  def remove_old_detours(env)
45
- return unless session(env).instance_variable_get('@by').is_a?(ActionDispatch::Session::CookieStore)
45
+ return unless session(env).instance_variable_get(:@by).is_a?(ActionDispatch::Session::CookieStore)
46
46
 
47
47
  session_size = workflow_size = nil
48
48
  session = session(env)
@@ -60,12 +60,12 @@ class SimpleWorkflow::Middleware
60
60
  session[:detours].shift
61
61
  reset_workflow(session) if session[:detours].empty?
62
62
  end
63
- Rails.logger.debug <<-MSG.strip_heredoc
63
+ Rails.logger.debug { <<~MSG }
64
64
  session: #{session_size} bytes, workflow(#{session[:detours].try(:size) || 0}): #{workflow_size} bytes
65
65
  MSG
66
66
  return unless session_size > 4096
67
67
 
68
- Rails.logger.warn <<-MSG.strip_heredoc
68
+ Rails.logger.warn <<~MSG
69
69
  simple_workflow: session exceeds cookie size limit: #{session_size} bytes. Workflow empty! Not My Fault!
70
70
  MSG
71
71
  Rails.logger.warn "simple_workflow: session: #{session.to_hash}"
@@ -75,20 +75,20 @@ class SimpleWorkflow::Middleware
75
75
  def remove_discarded_flashes(session)
76
76
  return unless (old_flashes = session[:flash] && session[:flash]['discard'])
77
77
 
78
- Rails.logger.warn <<-MSG.strip_heredoc
78
+ Rails.logger.warn <<~MSG
79
79
  simple_workflow: found discarded flash entries: #{old_flashes}. Deleting them.
80
80
  MSG
81
81
  session[:flash]['flashes'] = session[:flash]['flashes'].except(*old_flashes)
82
82
  Rails.logger.warn "simple_workflow: session: #{session.to_hash}"
83
83
  end
84
84
 
85
- if ActionPack::VERSION::MAJOR >= 5
85
+ if ActionPack::VERSION::MAJOR >= 7
86
86
  def serialize_session(cookie_jar, session)
87
- cookie_jar.send(:serialize, session)
87
+ cookie_jar.send(:serializer).send(:dump, session)
88
88
  end
89
- else # Rails 4.x
89
+ else # Rails 6
90
90
  def serialize_session(cookie_jar, session)
91
- cookie_jar.send(:serialize, nil, session)
91
+ cookie_jar.send(:serialize, session)
92
92
  end
93
93
  end
94
94
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleWorkflow
4
- VERSION = '2.1.0'
4
+ VERSION = '2.2.1'
5
5
  end
@@ -1,27 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rake'
4
3
  require './lib/simple_workflow/version'
5
4
  require 'date'
6
5
 
7
6
  Gem::Specification.new do |s|
8
7
  s.name = 'simple_workflow'
9
8
  s.version = SimpleWorkflow::VERSION
10
- s.date = Date.today.strftime '%Y-%m-%d' # rubocop:disable Rails/Date
11
9
  s.authors = ['Uwe Kubosch']
12
10
  s.email = 'uwe@kubosch.no'
13
11
  s.summary = 'Add simple breadcrumbs "detour" workflow to Ruby On Rails.'
14
12
  s.homepage = 'https://github.com/donv/simple_workflow'
15
13
  s.description = 'Expands Ruby on Rails to allow simple breadcrumb detour workflows.'
16
- s.required_ruby_version = '>= 2.5', '<4'
14
+ s.required_ruby_version = '~> 3.1'
17
15
  s.licenses = %w[MIT]
18
- s.files = FileList['[A-Z]*', 'lib/**/*', 'test/**/*'].to_a
16
+ s.files = Dir['[A-Z]*', 'lib/**/*', 'test/**/*']
19
17
 
20
- s.add_runtime_dependency('rails', '>=4.2', '<7')
18
+ s.add_runtime_dependency('rails', '>=6.1', '<8')
21
19
 
22
- s.add_development_dependency('minitest-reporters', '~>1.0')
23
20
  s.add_development_dependency('rubocop', '~>1.0')
24
21
  s.add_development_dependency('rubocop-performance', '~>1.5')
25
22
  s.add_development_dependency('rubocop-rails', '~>2.4')
26
23
  s.add_development_dependency('simplecov', '~>0.9')
24
+ s.metadata['rubygems_mfa_required'] = 'true'
27
25
  end
@@ -3,7 +3,7 @@
3
3
  require_relative 'test_helper'
4
4
  require 'rails'
5
5
 
6
- class ControllerTest < MiniTest::Test
6
+ class ControllerTest < Minitest::Test
7
7
  include SimpleWorkflow::Controller
8
8
  attr_accessor :cookies, :logger, :session
9
9
 
data/test/helper_test.rb CHANGED
@@ -4,12 +4,12 @@ require_relative 'test_helper'
4
4
  require 'action_controller/metal/exceptions'
5
5
  require 'test_app'
6
6
 
7
- class HelperTest < MiniTest::Test
7
+ class HelperTest < Minitest::Test
8
8
  include SimpleWorkflow::Helper
9
9
 
10
10
  def test_with_detour
11
11
  assert_equal '?detour%5Baction%5D=myaction&detour%5Bcontroller%5D=mycontroller&detour%5Bid%5D=42' \
12
- '&detour%5Bquery%5D%5Bnested%5D=criterium',
12
+ '&detour%5Bquery%5D%5Bnested%5D=criterium',
13
13
  with_detour('')
14
14
  end
15
15
 
@@ -20,7 +20,8 @@ class HelperTest < MiniTest::Test
20
20
 
21
21
  def test_with_detour_with_only_anchor_as_origin
22
22
  assert_equal '?detour%5Baction%5D=myaction&detour%5Banchor%5D=tab_2' \
23
- '&detour%5Bcontroller%5D=mycontroller&detour%5Bid%5D=42&detour%5Bquery%5D%5Bnested%5D=criterium',
23
+ '&detour%5Bcontroller%5D=mycontroller&detour%5Bid%5D=42' \
24
+ '&detour%5Bquery%5D%5Bnested%5D=criterium',
24
25
  with_detour('', anchor: :tab_2)
25
26
  end
26
27
 
@@ -38,7 +39,7 @@ class HelperTest < MiniTest::Test
38
39
  end
39
40
 
40
41
  assert_equal '?detour%5Baction%5D=index&detour%5Banchor%5D=tab_2' \
41
- '&detour%5Bcontroller%5D=simple_workflow%2F&detour%5Bhullo%5D=1',
42
+ '&detour%5Bcontroller%5D=simple_workflow%2F&detour%5Bhullo%5D=1',
42
43
  with_detour('', '/dashboard/index?hullo=1#tab_2')
43
44
  ensure
44
45
  Rails.application = nil
@@ -48,7 +49,7 @@ class HelperTest < MiniTest::Test
48
49
  assert_equal [
49
50
  'Link Text',
50
51
  'Link target?detour%5Baction%5D=myaction&detour%5Bcontroller%5D=mycontroller&detour%5Bid%5D=42' \
51
- '&detour%5Bquery%5D%5Bnested%5D=criterium',
52
+ '&detour%5Bquery%5D%5Bnested%5D=criterium',
52
53
  { id: 'link_tag_id', title: 'Link title' },
53
54
  ],
54
55
  detour_to('Link Text', 'Link target', id: 'link_tag_id', title: 'Link title')
@@ -4,7 +4,7 @@ require_relative 'test_helper'
4
4
  require 'simple_workflow/middleware'
5
5
  require_relative 'test_app'
6
6
 
7
- class MiddlewareTest < MiniTest::Test
7
+ class MiddlewareTest < Minitest::Test
8
8
  def setup
9
9
  @app = TestApp.instance
10
10
  # @app = ->(env) { [200, env, 'app response'] }
@@ -20,11 +20,10 @@ class MiddlewareTest < MiniTest::Test
20
20
  def test_get_without_detour
21
21
  env = env_for('/')
22
22
 
23
- status, headers, response = @stack.call env
23
+ status, headers, body = @stack.call env
24
24
 
25
25
  assert_equal 200, status
26
- assert_equal env, headers
27
- assert_equal 'app response', response
26
+ assert_equal ['app response'], [*body]
28
27
  assert_equal [], headers['rack.session'].to_hash.keys
29
28
  assert_nil headers['rack.session'].to_hash['detours']
30
29
  end
@@ -32,11 +31,10 @@ class MiddlewareTest < MiniTest::Test
32
31
  def test_detour
33
32
  env = env_for('/?detour[controller]=test')
34
33
 
35
- status, headers, response = @stack.call env
34
+ status, headers, body = @stack.call(env)
36
35
 
37
36
  assert_equal 200, status
38
- assert_equal(env, headers)
39
- assert_equal 'app response', response
37
+ assert_equal ['app response'], [*body]
40
38
  assert_equal(%w[session_id detours], headers['rack.session'].to_hash.keys)
41
39
  assert_equal([{ 'controller' => 'test' }], headers['rack.session'].to_hash['detours'])
42
40
  end
@@ -52,10 +50,10 @@ class MiddlewareTest < MiniTest::Test
52
50
  last_env = env_for('/?detour[controller]=test_last',
53
51
  'rack.session' => env['rack.session'],
54
52
  'rack.session.options' => env['rack.session.options'])
55
- status, env, response = @stack.call last_env
53
+ status, env, body = @stack.call last_env
56
54
 
57
55
  assert_equal 200, status
58
- assert_equal 'app response', response
56
+ assert_equal ['app response'], [*body]
59
57
  assert_equal(%w[session_id detours], env['rack.session'].to_hash.keys)
60
58
 
61
59
  assert_equal(((57..99).to_a + [:last]).map { |i| { 'controller' => "test_#{i}" } },
@@ -63,16 +61,15 @@ class MiddlewareTest < MiniTest::Test
63
61
  end
64
62
 
65
63
  def test_huge_detour_over_4k
66
- # rubocop:disable Metrics/LineLength
64
+ # rubocop:disable Layout/LineLength
67
65
  query = "/orders/TeYphD2wcYyBDFaKTnmAog/edit?detour%5Baction%5D=index&detour%5Bcommit%5D=Search&detour%5Bcontroller%5D=order_drilldown&detour%5Bdrilldown_search%5D%5Bdimensions%5D%5B%5D=arrival&detour%5Bdrilldown_search%5D%5Bdimensions%5D%5B%5D=delay&detour%5Bdrilldown_search%5D%5Bdisplay_type%5D=NONE&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bactual_time%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bcomments%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bdelay%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bdescription%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bdirection%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bdrop_off_stand%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bestimated%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bfirst_vehicle%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bofb%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bonb%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Boperation%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bpick_up%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bpick_up_stand%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bplanned%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bprobable%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bscheduled%5D=1&detour%5Bdrilldown_search%5D%5Bfields%5D%5Bsta%5D=0&detour%5Bdrilldown_search%5D%5Bfields%5D%5Btime%5D=0&detour%5Bdrilldown_search%5D%5Bfilter%5D%5Barrival%5D%5B%5D=Arrival&detour%5Bdrilldown_search%5D%5Bfilter%5D%5Barrival%5D%5B%5D=Departure&detour%5Bdrilldown_search%5D%5Bfilter%5D%5Bcalendar_date%5D%5B%5D=2016-03-01&detour%5Bdrilldown_search%5D%5Blist%5D=1&detour%5Bdrilldown_search%5D%5Blist_change_times%5D=0&detour%5Bdrilldown_search%5D%5Border_by_value%5D=0&detour%5Bdrilldown_search%5D%5Bpercent%5D=1&detour%5Bdrilldown_search%5D%5Bselect_value%5D=COUNT&detour%5Bdrilldown_search%5D%5Btitle%5D=OSL+Daily+Delay+Report+2016-04-16#{'+etc' * 200}&detour%5Butf8%5D=%E2%9C%93"
68
- # rubocop:enable Metrics/LineLength
66
+ # rubocop:enable Layout/LineLength
69
67
  env = env_for(query)
70
68
 
71
69
  status, headers, response = @stack.call env
72
70
 
73
71
  assert_equal 200, status
74
- assert_equal(env, headers)
75
- assert_equal 'app response', response
72
+ assert_equal ['app response'], [*response]
76
73
  assert_equal(%w[session_id], headers['rack.session'].to_hash.keys)
77
74
  end
78
75
 
@@ -84,8 +81,10 @@ class MiddlewareTest < MiniTest::Test
84
81
  status, headers, response = @stack.call env
85
82
 
86
83
  assert_equal 200, status
87
- assert_equal env, headers
88
- assert_equal 'app response', response
84
+ if headers['set-cookie']
85
+ assert_match(%r{_session_id=\w+--\w+; path=/; httponly}, headers['set-cookie'])
86
+ end
87
+ assert_equal ['app response'], [*response]
89
88
  assert_equal ['session_id'], headers['rack.session'].to_hash.keys
90
89
  assert_nil headers['rack.session'].to_hash['detours']
91
90
  end
@@ -101,9 +100,6 @@ class MiddlewareTest < MiniTest::Test
101
100
  ActionDispatch::Cookies::GENERATOR_KEY => ActiveSupport::KeyGenerator.new('secret'),
102
101
  ActionDispatch::Cookies::SECRET_KEY_BASE => 'secret',
103
102
  }
104
- if /^5\.2\./.match?(Rails.version)
105
- default_opts[ActionDispatch::Cookies::COOKIES_ROTATIONS] = Struct.new(:encrypted).new([])
106
- end
107
103
  Rack::MockRequest.env_for(url, default_opts.update(opts))
108
104
  end
109
105
  end
data/test/test_helper.rb CHANGED
@@ -5,18 +5,16 @@ require 'bundler/setup'
5
5
  require 'simplecov'
6
6
  SimpleCov.start do
7
7
  coverage_dir File.expand_path('../coverage', File.dirname(__FILE__))
8
- minimum_coverage 76
8
+ minimum_coverage 75
9
9
  end
10
10
  require 'minitest/autorun'
11
- require 'minitest/reporters'
12
- MiniTest::Reporters.use!
13
11
  require 'rails'
14
12
  require 'simple_workflow'
15
13
 
16
14
  FileUtils.mkdir_p File.expand_path '../log', __dir__
17
15
 
18
16
  module SimpleWorkflow::Controller
19
- def self.action_encoding_template(action)
17
+ def self.action_encoding_template(_action)
20
18
  false
21
19
  end
22
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-02 00:00:00.000000000 Z
11
+ date: 2024-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,34 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '6.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7'
22
+ version: '8'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.2'
29
+ version: '6.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7'
33
- - !ruby/object:Gem::Dependency
34
- name: minitest-reporters
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.0'
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.0'
32
+ version: '8'
47
33
  - !ruby/object:Gem::Dependency
48
34
  name: rubocop
49
35
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +105,6 @@ files:
119
105
  - lib/simple_workflow/railtie.rb
120
106
  - lib/simple_workflow/test_helper.rb
121
107
  - lib/simple_workflow/version.rb
122
- - simple_workflow-2.0.0.gem
123
108
  - simple_workflow.gemspec
124
109
  - test/controller_test.rb
125
110
  - test/helper_test.rb
@@ -129,26 +114,24 @@ files:
129
114
  homepage: https://github.com/donv/simple_workflow
130
115
  licenses:
131
116
  - MIT
132
- metadata: {}
117
+ metadata:
118
+ rubygems_mfa_required: 'true'
133
119
  post_install_message:
134
120
  rdoc_options: []
135
121
  require_paths:
136
122
  - lib
137
123
  required_ruby_version: !ruby/object:Gem::Requirement
138
124
  requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- version: '2.5'
142
- - - "<"
125
+ - - "~>"
143
126
  - !ruby/object:Gem::Version
144
- version: '4'
127
+ version: '3.1'
145
128
  required_rubygems_version: !ruby/object:Gem::Requirement
146
129
  requirements:
147
130
  - - ">="
148
131
  - !ruby/object:Gem::Version
149
132
  version: '0'
150
133
  requirements: []
151
- rubygems_version: 3.2.3
134
+ rubygems_version: 3.5.9
152
135
  signing_key:
153
136
  specification_version: 4
154
137
  summary: Add simple breadcrumbs "detour" workflow to Ruby On Rails.
Binary file