simple_workflow 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.3.5 2012-11-22
2
+
3
+ === Fixes
4
+
5
+ * Changes detour_to to accept all url forms that url_for accepts.
6
+
7
+
1
8
  == 0.3.1 2012-03-21
2
9
 
3
10
  === Fixes
@@ -87,4 +94,3 @@
87
94
 
88
95
  * 1 major enhancement:
89
96
  * Initial release
90
-
@@ -10,9 +10,9 @@ module SimpleWorkflow::Helper
10
10
  end
11
11
 
12
12
  def with_detour(options, back_options = {})
13
- detour_options = {:detour => (params.merge(back_options)).reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }}
14
- url = url_for(options) if options.respond_to? :to_param
15
- return url + (url =~ /\?/ ? '&' : '?') + detour_options[:detour].map{|k,v| "detour[#{k}]=#{v}"}.join('&')
13
+ detour = params.merge(back_options).reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }
14
+ url = url_for(options)
15
+ return url + (url =~ /\?/ ? '&' : '?') + detour.to_param('detour')
16
16
  end
17
17
 
18
18
  def image_detour_to(image_source, title, url_options, image_options = nil, link_options = nil)
@@ -1,3 +1,3 @@
1
1
  module SimpleWorkflow
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
- require 'action_controller/base'
4
+ require 'action_controller'
5
5
 
6
6
  require 'simple_workflow/version'
7
7
  require 'simple_workflow/helper'
@@ -0,0 +1,24 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class SimpleWorkflowTest < Test::Unit::TestCase
4
+ include SimpleWorkflow::Helper
5
+
6
+ def setup
7
+ end
8
+
9
+ def test_with_detour
10
+ assert_equal '?detour%5Baction%5D=myaction&detour%5Bcontroller%5D=mycontroller&detour%5Bid%5D=42&detour%5Bquery%5D%5Bnested%5D=criterium',
11
+ with_detour('')
12
+ end
13
+
14
+ private
15
+
16
+ def params
17
+ {:controller => 'mycontroller', :action => 'myaction', :id => 42, :query => {:nested => 'criterium'}}
18
+ end
19
+
20
+ # FIXME(donv): This should not be faked.
21
+ def url_for(options)
22
+ options.to_s
23
+ end
24
+ end
data/test/test_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
1
  require 'stringio'
2
2
  require 'test/unit'
3
+ require 'rubygems'
3
4
  require File.dirname(__FILE__) + '/../lib/simple_workflow'
5
+ require 'active_support/core_ext'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_workflow
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 5
10
- version: 0.3.5
9
+ - 6
10
+ version: 0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Uwe Kubosch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-11-22 00:00:00 Z
18
+ date: 2012-12-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -50,8 +50,8 @@ files:
50
50
  - lib/simple_workflow/test_helper.rb
51
51
  - lib/simple_workflow/version.rb
52
52
  - lib/simple_workflow.rb
53
+ - test/simple_workflow_test.rb
53
54
  - test/test_helper.rb
54
- - test/test_simple_workflow.rb
55
55
  homepage: https://github.com/donv/simple_workflow
56
56
  licenses: []
57
57
 
@@ -1,11 +0,0 @@
1
- require File.dirname(__FILE__) + '/test_helper.rb'
2
-
3
- class TestRubyShoppe < Test::Unit::TestCase
4
-
5
- def setup
6
- end
7
-
8
- def test_truth
9
- assert true
10
- end
11
- end