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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e7561337bcd8f7901c56c282f7ccec7a400669d
4
- data.tar.gz: 577ab6a1a4b68888c1d0ebbc09c2bf10560a98d8
3
+ metadata.gz: 0d6b798b0bc76a844f247ac8e546eb90913326db
4
+ data.tar.gz: d5e8c3b6e0b38604893d3c1e5da655ac78cd17cd
5
5
  SHA512:
6
- metadata.gz: b93b823a451398aa2ce55a63ee6a770e3fc50c6da276184c8cbaec396b5fdc13375d44cc29e3bb20426256c7cee67f87a7a964ef1f4b20f17a649fb847a9a69b
7
- data.tar.gz: 070c0c1de094db11f4258ac7c78db93c26cca7ac8dd165732361a17bc2c3624d2426c76c07f30a1a6c5027d3db676adc5fc2cfa318c729148ca179a4ca663549
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.4)
5
- rails (>= 4, < 5.1)
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.0.3)
11
- actionpack (= 5.0.3)
12
- nio4r (>= 1.2, < 3.0)
10
+ actioncable (5.1.1)
11
+ actionpack (= 5.1.1)
12
+ nio4r (~> 2.0)
13
13
  websocket-driver (~> 0.6.1)
14
- actionmailer (5.0.3)
15
- actionpack (= 5.0.3)
16
- actionview (= 5.0.3)
17
- activejob (= 5.0.3)
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.0.3)
21
- actionview (= 5.0.3)
22
- activesupport (= 5.0.3)
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.0.3)
28
- activesupport (= 5.0.3)
27
+ actionview (5.1.1)
28
+ activesupport (= 5.1.1)
29
29
  builder (~> 3.1)
30
- erubis (~> 2.7.0)
30
+ erubi (~> 1.4)
31
31
  rails-dom-testing (~> 2.0)
32
32
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.0.3)
34
- activesupport (= 5.0.3)
33
+ activejob (5.1.1)
34
+ activesupport (= 5.1.1)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.0.3)
37
- activesupport (= 5.0.3)
38
- activerecord (5.0.3)
39
- activemodel (= 5.0.3)
40
- activesupport (= 5.0.3)
41
- arel (~> 7.0)
42
- activesupport (5.0.3)
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 (7.1.4)
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
- erubis (2.7.0)
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.0.3)
83
- actioncable (= 5.0.3)
84
- actionmailer (= 5.0.3)
85
- actionpack (= 5.0.3)
86
- actionview (= 5.0.3)
87
- activejob (= 5.0.3)
88
- activemodel (= 5.0.3)
89
- activerecord (= 5.0.3)
90
- activesupport (= 5.0.3)
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.0.3)
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.0.3)
100
- actionpack (= 5.0.3)
101
- activesupport (= 5.0.3)
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.
@@ -1,3 +1,3 @@
1
1
  module SimpleWorkflow
2
- VERSION = '1.3.5'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
@@ -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
- _, env, = @stack.call env_for("/?detour[controller]=test_#{i}",
46
- 'rack.session' => env['rack.session'],
47
- 'rack.session.options' => env['rack.session.options'])
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
- status, env, response = @stack.call env_for('/?detour[controller]=test_last',
50
- 'rack.session' => env['rack.session'],
51
- 'rack.session.options' => env['rack.session.options'])
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.3.5
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.1'
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.1'
32
+ version: '5.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: simplecov
35
35
  requirement: !ruby/object:Gem::Requirement