simple_workflow 1.6.0 → 1.6.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
- SHA1:
3
- metadata.gz: 347f4e6b9181b3bdb9181f847ec3d42aaf25721f
4
- data.tar.gz: 2343af04ef43d5d4059fbf87b0807aab3d7851a5
2
+ SHA256:
3
+ metadata.gz: 7ebe25ee6377081e1645abaf25fd641880185acbb47f82dc7a8bd4215d3f17c6
4
+ data.tar.gz: 74a3bb2743303b8975a1b4635a942992b5aa043686c728f3147c5d4cc5f17e2e
5
5
  SHA512:
6
- metadata.gz: aa32bf4b657422f1809c85cc41edd5d9a216606cc935ae024f366433ad2aaae7bd575b5290d436e317159e146c41a77743c1e92cb8c4c630e09d66c3b9870d93
7
- data.tar.gz: 1e4e13ef6299d58e656b48202f0111df101681c681c457622cb6554f1a510cf5dc2c75ca7ddbfefc315308fd800499e723561297f4a88570712965d64a41c4a3
6
+ metadata.gz: 92b56c0557b9d76f13790f456bff4ee44fe01e23d4b10dc21e8e17267bb386f074d767b57c46c074146b58d6c0b7a7f8e322e60b93b6fd8e09005a2ed86786de
7
+ data.tar.gz: 6beb61cb7cd7649d36d38f9e53cf290cd6220089fdd6533159a8b11452c00522b75dd74b14aa03b555735eb45cd032eb9efa28a8366d987907b79b9bda8225ce
@@ -1,49 +1,49 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_workflow (1.6.0)
4
+ simple_workflow (1.6.1)
5
5
  rails (>= 4.2, < 5.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (5.2.0)
11
- actionpack (= 5.2.0)
10
+ actioncable (5.2.1)
11
+ actionpack (= 5.2.1)
12
12
  nio4r (~> 2.0)
13
13
  websocket-driver (>= 0.6.1)
14
- actionmailer (5.2.0)
15
- actionpack (= 5.2.0)
16
- actionview (= 5.2.0)
17
- activejob (= 5.2.0)
14
+ actionmailer (5.2.1)
15
+ actionpack (= 5.2.1)
16
+ actionview (= 5.2.1)
17
+ activejob (= 5.2.1)
18
18
  mail (~> 2.5, >= 2.5.4)
19
19
  rails-dom-testing (~> 2.0)
20
- actionpack (5.2.0)
21
- actionview (= 5.2.0)
22
- activesupport (= 5.2.0)
20
+ actionpack (5.2.1)
21
+ actionview (= 5.2.1)
22
+ activesupport (= 5.2.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.2.0)
28
- activesupport (= 5.2.0)
27
+ actionview (5.2.1)
28
+ activesupport (= 5.2.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.2.0)
34
- activesupport (= 5.2.0)
33
+ activejob (5.2.1)
34
+ activesupport (= 5.2.1)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.2.0)
37
- activesupport (= 5.2.0)
38
- activerecord (5.2.0)
39
- activemodel (= 5.2.0)
40
- activesupport (= 5.2.0)
36
+ activemodel (5.2.1)
37
+ activesupport (= 5.2.1)
38
+ activerecord (5.2.1)
39
+ activemodel (= 5.2.1)
40
+ activesupport (= 5.2.1)
41
41
  arel (>= 9.0)
42
- activestorage (5.2.0)
43
- actionpack (= 5.2.0)
44
- activerecord (= 5.2.0)
42
+ activestorage (5.2.1)
43
+ actionpack (= 5.2.1)
44
+ activerecord (= 5.2.1)
45
45
  marcel (~> 0.3.1)
46
- activesupport (5.2.0)
46
+ activesupport (5.2.1)
47
47
  concurrent-ruby (~> 1.0, >= 1.0.2)
48
48
  i18n (>= 0.7, < 2)
49
49
  minitest (~> 5.1)
@@ -58,7 +58,7 @@ GEM
58
58
  erubi (1.7.1)
59
59
  globalid (0.4.1)
60
60
  activesupport (>= 4.2.0)
61
- i18n (1.0.1)
61
+ i18n (1.1.0)
62
62
  concurrent-ruby (~> 1.0)
63
63
  json (2.1.0)
64
64
  loofah (2.2.2)
@@ -70,7 +70,7 @@ GEM
70
70
  mimemagic (~> 0.3.2)
71
71
  method_source (0.9.0)
72
72
  mimemagic (0.3.2)
73
- mini_mime (1.0.0)
73
+ mini_mime (1.0.1)
74
74
  mini_portile2 (2.3.0)
75
75
  minitest (5.10.3)
76
76
  minitest-reporters (1.2.0)
@@ -88,30 +88,30 @@ GEM
88
88
  rack (2.0.5)
89
89
  rack-test (1.1.0)
90
90
  rack (>= 1.0, < 3)
91
- rails (5.2.0)
92
- actioncable (= 5.2.0)
93
- actionmailer (= 5.2.0)
94
- actionpack (= 5.2.0)
95
- actionview (= 5.2.0)
96
- activejob (= 5.2.0)
97
- activemodel (= 5.2.0)
98
- activerecord (= 5.2.0)
99
- activestorage (= 5.2.0)
100
- activesupport (= 5.2.0)
91
+ rails (5.2.1)
92
+ actioncable (= 5.2.1)
93
+ actionmailer (= 5.2.1)
94
+ actionpack (= 5.2.1)
95
+ actionview (= 5.2.1)
96
+ activejob (= 5.2.1)
97
+ activemodel (= 5.2.1)
98
+ activerecord (= 5.2.1)
99
+ activestorage (= 5.2.1)
100
+ activesupport (= 5.2.1)
101
101
  bundler (>= 1.3.0)
102
- railties (= 5.2.0)
102
+ railties (= 5.2.1)
103
103
  sprockets-rails (>= 2.0.0)
104
104
  rails-dom-testing (2.0.3)
105
105
  activesupport (>= 4.2.0)
106
106
  nokogiri (>= 1.6)
107
107
  rails-html-sanitizer (1.0.4)
108
108
  loofah (~> 2.2, >= 2.2.2)
109
- railties (5.2.0)
110
- actionpack (= 5.2.0)
111
- activesupport (= 5.2.0)
109
+ railties (5.2.1)
110
+ actionpack (= 5.2.1)
111
+ activesupport (= 5.2.1)
112
112
  method_source
113
113
  rake (>= 0.8.7)
114
- thor (>= 0.18.1, < 2.0)
114
+ thor (>= 0.19.0, < 2.0)
115
115
  rainbow (3.0.0)
116
116
  rake (12.3.1)
117
117
  rubocop (0.54.0)
@@ -3,19 +3,25 @@
3
3
  # Utility methods to manage the breadcrumb history
4
4
  module SimpleWorkflow::Detour
5
5
  def store_detour_in_session(session, options)
6
- if session[:detours] && session[:detours].last == options
7
- Rails.logger.try(:debug, "Ignored duplicate detour: #{options.inspect}")
8
- return
6
+ if session[:detours]
7
+ if session[:detours].last == options
8
+ Rails.logger.try(:debug, "Ignored duplicate detour: #{options.inspect}")
9
+ return
10
+ end
11
+ if session[:detours].delete(options)
12
+ Rails.logger.try(:debug, "Deleted duplicate detour: #{options.inspect}")
13
+ end
14
+ else
15
+ session[:detours] = []
9
16
  end
10
- session[:detours] ||= []
11
17
  session[:detours] << options
12
18
  Rails.logger.try(:debug, "Added detour (#{session[:detours].try(:size) || 0}): #{options.inspect}")
13
19
  end
14
20
 
15
- def pop_detour(session)
21
+ def pop_detour(session, origin_options = nil)
16
22
  detours = session[:detours]
17
23
  return nil unless detours
18
- detour = detours.pop
24
+ detour = detours.delete(origin_options) || detours.pop
19
25
  Rails.logger.debug "popped detour: #{detour.inspect} #{session[:detours].size} more"
20
26
  reset_workflow(session) if detours.empty?
21
27
  detour
@@ -105,6 +105,6 @@ class SimpleWorkflow::Middleware
105
105
  def store_detour_from_params(env)
106
106
  store_detour_in_session(session(env), params(env)[:detour]) if params(env)[:detour]
107
107
  return unless params(env)[:return_from_detour] && session(env)[:detours]
108
- pop_detour(session(env))
108
+ pop_detour(session(env), params(env).to_h.reject { |k, _v| %i[detour return_from_detour].include? k.to_sym })
109
109
  end
110
110
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleWorkflow
4
- VERSION = '1.6.0'
4
+ VERSION = '1.6.1'
5
5
  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: 1.6.0
4
+ version: 1.6.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: 2018-08-07 00:00:00.000000000 Z
11
+ date: 2018-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project: donv/simple_workflow
119
- rubygems_version: 2.6.14.1
119
+ rubygems_version: 2.7.6
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: Add simple breadcrumbs "detour" workflow to Ruby On Rails.