simple_workflow 1.0.3 → 1.0.4

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
  SHA1:
3
- metadata.gz: 7a3fd13f0e5f2e22766c12b3934b7b2526a29391
4
- data.tar.gz: a8eaae28c3e9eef111b4d6c708e16e427d786b0c
3
+ metadata.gz: 1c584a56b66575a882914c51fcaa05bed96a088d
4
+ data.tar.gz: f0df5c91f58f27bed3fec56af7705838f51c5541
5
5
  SHA512:
6
- metadata.gz: f172ae3abd7e3fae4e402bb11c25b7f96f1b226a7b881deddc62217fcf928309dc75afbc3ed2049434709951f4f2cf347c65e1895ff3a00270d573ef920fdcaa
7
- data.tar.gz: f15c8e17c57d2c60235915fa27f8adc901ac9fb968983b65bc451b4538c621db75091df433f7255ae81bdd7706f21ef8cda14ec31fa4778d612ac4134b9eb7c5
6
+ metadata.gz: ad22ae44d1921866e12608eb93cf76b97f9fe09f8e73bc83863ffa2f8f3aede73944b6c415fa8f59c1beda314901c289fb0c387d6fedcac1f86c87ae9244dbc7
7
+ data.tar.gz: 7d7f74ddfd991fb44e47219fab444665beb640548faeb06853731e2be10e5ae487435425b9460709b120bd6fd7c22ec8933c779914da025c4027d8258b7940b4
data/History.rdoc CHANGED
@@ -1,8 +1,16 @@
1
+ == 1.0.4 2014-02-28
2
+
3
+ === Feature
4
+
5
+ * Added support for setting just the anchor of the originating page in with_detour.
6
+
7
+
1
8
  == 1.0.3 2014-02-28
2
9
 
3
10
  === Fixes
4
11
 
5
12
  * The second argument to detour_to is optional if a block is given.
13
+ * Fixed URL overflow error when detour URL was > 4096 characters.
6
14
 
7
15
 
8
16
  == 1.0.1 2014-02-10
@@ -7,8 +7,8 @@ module SimpleWorkflow::Helper
7
7
 
8
8
  def detour_to(title, options = nil, html_options = nil, &block)
9
9
  if block
10
- html_options = options
11
- options = title
10
+ html_options = options
11
+ options = title
12
12
  link_with_detour = link_to(with_detour(options), html_options, &block)
13
13
  else
14
14
  link_with_detour = link_to(title, with_detour(options), html_options)
@@ -23,10 +23,17 @@ module SimpleWorkflow::Helper
23
23
  link_with_detour
24
24
  end
25
25
 
26
- def with_detour(options, back_options = nil)
27
- detour = back_options || params.reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }
26
+ # Takes a link destination and augments it with the current page as origin.
27
+ # If the optional second argument is given, it is used as the origin.
28
+ # If the given origin is only an anchor, it is added to the current page.
29
+ def with_detour(options, origin = origin_options)
30
+ origin.update(origin_options) if origin.keys == [:anchor]
28
31
  url = url_for(options)
29
- return url + (url =~ /\?/ ? '&' : '?') + detour.to_param('detour')
32
+ url + (url =~ /\?/ ? '&' : '?') + origin.to_param('detour')
33
+ end
34
+
35
+ def origin_options
36
+ params.reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }
30
37
  end
31
38
 
32
39
  def image_detour_to(image_source, title, url_options, image_options = nil, link_options = nil)
@@ -63,7 +70,7 @@ module SimpleWorkflow::Helper
63
70
 
64
71
  def back_or_link_to(title, options = nil, html_options = nil)
65
72
  if session[:detours]
66
- options = {:return_from_detour => true}.update(session[:detours].last)
73
+ options = {:return_from_detour => true}.update(session[:detours].last)
67
74
  options[:id] ||= nil
68
75
  logger.debug "linked return from detour: #{options.inspect}"
69
76
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleWorkflow
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  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.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-28 00:00:00.000000000 Z
11
+ date: 2014-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project: donv/simple_workflow
63
- rubygems_version: 2.2.0
63
+ rubygems_version: 2.2.2
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: Add simple breadcrumbs "detour" workflow to Ruby On Rails.