simple_workflow 1.3.5 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +39 -39
- data/lib/simple_workflow/middleware.rb +5 -1
- data/lib/simple_workflow/version.rb +1 -1
- data/test/middleware_test.rb +6 -6
- data/test/test_app.rb +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d6b798b0bc76a844f247ac8e546eb90913326db
|
4
|
+
data.tar.gz: d5e8c3b6e0b38604893d3c1e5da655ac78cd17cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f533f2b1d385ce1c1dd6888985f2a31a39b47e8d4f66e503bcab3b90602cf7ed8eafd07e5c1b53400dbfa9760ef45ae2b3a739e33a7ca63b046e34a1581d51d1
|
7
|
+
data.tar.gz: 41a1d21a8b6bd1bb40382fa6878d6ead98a4ad80392c8bc4e4e7b568c15e678042f8a1e9be43c5e67a5634aeb0def06592491d583c4655b70023a5ef163a7687
|
data/Gemfile.lock
CHANGED
@@ -1,56 +1,56 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simple_workflow (1.3.
|
5
|
-
rails (>= 4, < 5.
|
4
|
+
simple_workflow (1.3.5)
|
5
|
+
rails (>= 4, < 5.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (5.
|
11
|
-
actionpack (= 5.
|
12
|
-
nio4r (
|
10
|
+
actioncable (5.1.1)
|
11
|
+
actionpack (= 5.1.1)
|
12
|
+
nio4r (~> 2.0)
|
13
13
|
websocket-driver (~> 0.6.1)
|
14
|
-
actionmailer (5.
|
15
|
-
actionpack (= 5.
|
16
|
-
actionview (= 5.
|
17
|
-
activejob (= 5.
|
14
|
+
actionmailer (5.1.1)
|
15
|
+
actionpack (= 5.1.1)
|
16
|
+
actionview (= 5.1.1)
|
17
|
+
activejob (= 5.1.1)
|
18
18
|
mail (~> 2.5, >= 2.5.4)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.
|
21
|
-
actionview (= 5.
|
22
|
-
activesupport (= 5.
|
20
|
+
actionpack (5.1.1)
|
21
|
+
actionview (= 5.1.1)
|
22
|
+
activesupport (= 5.1.1)
|
23
23
|
rack (~> 2.0)
|
24
24
|
rack-test (~> 0.6.3)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.
|
28
|
-
activesupport (= 5.
|
27
|
+
actionview (5.1.1)
|
28
|
+
activesupport (= 5.1.1)
|
29
29
|
builder (~> 3.1)
|
30
|
-
|
30
|
+
erubi (~> 1.4)
|
31
31
|
rails-dom-testing (~> 2.0)
|
32
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.
|
34
|
-
activesupport (= 5.
|
33
|
+
activejob (5.1.1)
|
34
|
+
activesupport (= 5.1.1)
|
35
35
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.
|
37
|
-
activesupport (= 5.
|
38
|
-
activerecord (5.
|
39
|
-
activemodel (= 5.
|
40
|
-
activesupport (= 5.
|
41
|
-
arel (~>
|
42
|
-
activesupport (5.
|
36
|
+
activemodel (5.1.1)
|
37
|
+
activesupport (= 5.1.1)
|
38
|
+
activerecord (5.1.1)
|
39
|
+
activemodel (= 5.1.1)
|
40
|
+
activesupport (= 5.1.1)
|
41
|
+
arel (~> 8.0)
|
42
|
+
activesupport (5.1.1)
|
43
43
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
44
44
|
i18n (~> 0.7)
|
45
45
|
minitest (~> 5.1)
|
46
46
|
tzinfo (~> 1.1)
|
47
47
|
ansi (1.5.0)
|
48
|
-
arel (
|
48
|
+
arel (8.0.0)
|
49
49
|
ast (2.3.0)
|
50
50
|
builder (3.2.3)
|
51
51
|
concurrent-ruby (1.0.5)
|
52
52
|
docile (1.1.5)
|
53
|
-
|
53
|
+
erubi (1.6.0)
|
54
54
|
globalid (0.4.0)
|
55
55
|
activesupport (>= 4.2.0)
|
56
56
|
i18n (0.8.4)
|
@@ -79,26 +79,26 @@ GEM
|
|
79
79
|
rack (2.0.3)
|
80
80
|
rack-test (0.6.3)
|
81
81
|
rack (>= 1.0)
|
82
|
-
rails (5.
|
83
|
-
actioncable (= 5.
|
84
|
-
actionmailer (= 5.
|
85
|
-
actionpack (= 5.
|
86
|
-
actionview (= 5.
|
87
|
-
activejob (= 5.
|
88
|
-
activemodel (= 5.
|
89
|
-
activerecord (= 5.
|
90
|
-
activesupport (= 5.
|
82
|
+
rails (5.1.1)
|
83
|
+
actioncable (= 5.1.1)
|
84
|
+
actionmailer (= 5.1.1)
|
85
|
+
actionpack (= 5.1.1)
|
86
|
+
actionview (= 5.1.1)
|
87
|
+
activejob (= 5.1.1)
|
88
|
+
activemodel (= 5.1.1)
|
89
|
+
activerecord (= 5.1.1)
|
90
|
+
activesupport (= 5.1.1)
|
91
91
|
bundler (>= 1.3.0, < 2.0)
|
92
|
-
railties (= 5.
|
92
|
+
railties (= 5.1.1)
|
93
93
|
sprockets-rails (>= 2.0.0)
|
94
94
|
rails-dom-testing (2.0.3)
|
95
95
|
activesupport (>= 4.2.0)
|
96
96
|
nokogiri (>= 1.6)
|
97
97
|
rails-html-sanitizer (1.0.3)
|
98
98
|
loofah (~> 2.0)
|
99
|
-
railties (5.
|
100
|
-
actionpack (= 5.
|
101
|
-
activesupport (= 5.
|
99
|
+
railties (5.1.1)
|
100
|
+
actionpack (= 5.1.1)
|
101
|
+
activesupport (= 5.1.1)
|
102
102
|
method_source
|
103
103
|
rake (>= 0.8.7)
|
104
104
|
thor (>= 0.18.1, < 2.0)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'simple_workflow/detour'
|
2
|
+
require 'active_support/core_ext/string/strip'
|
2
3
|
|
3
4
|
# Rack middleware to detect and store detours and manage returns from detours.
|
4
5
|
class SimpleWorkflow::Middleware
|
@@ -43,7 +44,6 @@ class SimpleWorkflow::Middleware
|
|
43
44
|
.is_a?(ActionDispatch::Session::CookieStore)
|
44
45
|
session_size = workflow_size = nil
|
45
46
|
session = session(env)
|
46
|
-
# env[ActionDispatch::Cookies::COOKIES_SERIALIZER]
|
47
47
|
cookie_jar = cookie_jar(env)
|
48
48
|
encryptor = encryptor(env)
|
49
49
|
loop do
|
@@ -67,6 +67,10 @@ class SimpleWorkflow::Middleware
|
|
67
67
|
simple_workflow: session exceeds cookie size limit: #{session_size} bytes. Workflow empty! Not My Fault!
|
68
68
|
MSG
|
69
69
|
Rails.logger.warn "simple_workflow: session: #{session.to_hash}"
|
70
|
+
remove_discarded_flashes(session)
|
71
|
+
end
|
72
|
+
|
73
|
+
def remove_discarded_flashes(session)
|
70
74
|
return unless (old_flashes = session[:flash] && session[:flash]['discard'])
|
71
75
|
Rails.logger.warn <<-MSG.strip_heredoc
|
72
76
|
simple_workflow: found discarded flash entries: #{old_flashes}. Deleting them.
|
data/test/middleware_test.rb
CHANGED
@@ -42,13 +42,13 @@ class MiddlewareTest < MiniTest::Test
|
|
42
42
|
def test_detour_cleanup
|
43
43
|
_, env, = @stack.call env_for('/?detour[controller]=test_first')
|
44
44
|
(50..99).each do |i|
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
next_env = env_for("/?detour[controller]=test_#{i}", 'rack.session' => env['rack.session'],
|
46
|
+
'rack.session.options' => env['rack.session.options'])
|
47
|
+
_, env, = @stack.call next_env
|
48
48
|
end
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
last_env = env_for('/?detour[controller]=test_last', 'rack.session' => env['rack.session'],
|
50
|
+
'rack.session.options' => env['rack.session.options'])
|
51
|
+
status, env, response = @stack.call last_env
|
52
52
|
|
53
53
|
assert_equal 200, status
|
54
54
|
assert_equal 'app response', response
|
data/test/test_app.rb
CHANGED
@@ -5,7 +5,6 @@ class TestApp < Rails::Application
|
|
5
5
|
config.action_dispatch.key_generator = ActiveSupport::KeyGenerator.new('secret')
|
6
6
|
config.logger = Logger.new(File.expand_path('../log/test.log', __dir__))
|
7
7
|
config.secret_key_base = 'secret key base'
|
8
|
-
# config.secret_token = 'secret token'
|
9
8
|
|
10
9
|
Rails.logger = config.logger
|
11
10
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uwe Kubosch
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '4'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '5.
|
22
|
+
version: '5.2'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '4'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '5.
|
32
|
+
version: '5.2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: simplecov
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|