wicked 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of wicked might be problematic. Click here for more details.

@@ -1,3 +1,7 @@
1
+ ## 0.3.2
2
+ * Forward params passed to the index action
3
+ * bug fix: 1.8.7 hash ordering
4
+
1
5
  ## 0.3.1
2
6
  * Prettier code, thanks code climate
3
7
 
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Wicked
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/schneems/wicked.png)](http://travis-ci.org/schneems/wicked)
4
-
5
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/schneems/wicked)
3
+ [![Build Status](https://secure.travis-ci.org/schneems/wicked.png)](http://travis-ci.org/schneems/wicked) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/schneems/wicked)
6
4
 
7
5
  Use wicked to make your Rails controllers into step-by-step wizards. To see Wicked in action check out the example [Rails app](https://github.com/schneems/wicked_example) or [watch the screencast](http://schneems.com/post/18437886598/wizard-ify-your-rails-controllers-with-wicked).
8
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -17,12 +17,17 @@ module Wicked
17
17
  before_filter :setup_wizard
18
18
  end
19
19
 
20
+ # forward to first step with whatever params are provided
20
21
  def index
21
- redirect_to wizard_path(steps.first)
22
+ redirect_to wizard_path(steps.first, clean_params)
22
23
  end
23
24
 
24
25
  private
25
26
 
27
+ def clean_params
28
+ params.except(:action, :controller)
29
+ end
30
+
26
31
  def check_redirect_to_first_last!(step)
27
32
  redirect_to wizard_path(steps.first) if step == :wizard_first
28
33
  redirect_to wizard_path(steps.last) if step == :wizard_last
@@ -14,10 +14,10 @@ module Wicked
14
14
  # {:uno=>"first", :dos=>"second"}
15
15
  #
16
16
  def wizard_translations
17
- @wizard_translations ||= steps.inject({}) do |hash, step|
17
+ @wizard_translations ||= steps.inject(ActiveSupport::OrderedHash.new) do |hash, step|
18
18
  step = step.to_s.split(".").last
19
19
  translation = I18n.t("wicked.#{step}").to_sym
20
- hash[translation] = step
20
+ hash[translation] = step.to_sym
21
21
  hash
22
22
  end
23
23
  end
@@ -0,0 +1,7 @@
1
+ class PagesController < ApplicationController
2
+
3
+ def index
4
+
5
+ end
6
+
7
+ end
@@ -1,5 +1,7 @@
1
1
  first
2
2
 
3
+
4
+ <%= "params[:foo] #{params[:foo]}" %>
3
5
  <%= link_to 'last', wizard_path(:last_step) %>
4
6
  <%= link_to 'current', wizard_path %>
5
7
  <%= link_to 'skip', next_wizard_path %>
@@ -0,0 +1,3 @@
1
+ home
2
+
3
+ <%= "params[:foo] #{params[:foo]}" %>
@@ -1,6 +1,5 @@
1
1
  Dummy::Application.routes.draw do
2
2
  resources :i18n
3
- resources :foo
4
3
  resources :bar
5
4
  resources :jump
6
5
  resources :step_positions
@@ -54,7 +53,7 @@ Dummy::Application.routes.draw do
54
53
 
55
54
  # You can have the root of your site routed with "root"
56
55
  # just remember to delete public/index.html.
57
- # root :to => "welcome#index"
56
+ root :to => "pages#index"
58
57
 
59
58
  # See how all your routes lay out with "rake routes"
60
59
 
@@ -6,11 +6,6 @@ class I18nTest < ActiveSupport::IntegrationCase
6
6
  step = :uno
7
7
  visit(i18n_path(step, :locale => :es))
8
8
  assert has_content?('uno')
9
-
10
- ## Needed to keep travis build working on 1.8.7 idk why
11
- i18n_path(:dos)
12
- page.html
13
-
14
9
  assert has_link?('hello', :href => i18n_path(:dos))
15
10
  end
16
11
 
@@ -18,11 +13,6 @@ class I18nTest < ActiveSupport::IntegrationCase
18
13
  step = :first
19
14
  visit(i18n_path(step, :locale => :en))
20
15
  assert has_content?('first')
21
-
22
- ## Needed to keep travis build working on 1.8.7 idk why
23
- i18n_path(:second)
24
- page.html
25
-
26
16
  assert has_link?('hello', :href => i18n_path(:second))
27
17
  end
28
18
  end
@@ -1,48 +1,16 @@
1
1
  require 'test_helper'
2
2
 
3
- class InheritNavigationTest < ActiveSupport::IntegrationCase
4
-
5
- test 'default index' do
6
- visit(foo_index_path)
7
- assert has_content?('first')
8
- end
9
-
10
- test 'show first' do
11
- step = :first
12
- visit(foo_path(step))
13
- assert has_content?(step.to_s)
14
- end
15
-
16
- test 'show second' do
17
- step = :second
18
- visit(foo_path(step))
19
- assert has_content?(step.to_s)
20
- end
21
-
22
- test 'skip first' do
23
- step = :first
24
- visit(foo_path(step.to_s, :skip_step => 'true'))
25
- assert has_content?('second')
3
+ class IncludeNavigationTest < ActiveSupport::IntegrationCase
4
+ test 'index forwards to first step by default' do
5
+ visit(bar_index_path)
6
+ assert has_content?("first")
26
7
  end
27
8
 
28
- test 'invalid step' do
29
- step = :notastep
30
- assert_raise(ActionView::MissingTemplate) do
31
- visit(foo_path(step))
32
- end
9
+ test 'index forwards params to first step' do
10
+ visit(bar_index_path(:foo => "first"))
11
+ assert has_content?("params[:foo] first")
33
12
  end
34
13
 
35
- test 'finish' do
36
- step = :finish
37
- visit(foo_path(step))
38
- assert has_content?('home')
39
- end
40
-
41
- end
42
-
43
-
44
- class IncludeNavigationTest < ActiveSupport::IntegrationCase
45
-
46
14
  test 'show first' do
47
15
  step = :first
48
16
  visit(bar_path(step))
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "wicked"
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["schneems"]
12
- s.date = "2012-11-12"
12
+ s.date = "2012-11-30"
13
13
  s.description = "Wicked is a Rails engine for producing easy wizard controllers"
14
14
  s.email = "richard.schneeman@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -36,24 +36,22 @@ Gem::Specification.new do |s|
36
36
  "test/dummy/Rakefile",
37
37
  "test/dummy/app/controllers/application_controller.rb",
38
38
  "test/dummy/app/controllers/bar_controller.rb",
39
- "test/dummy/app/controllers/foo_controller.rb",
40
39
  "test/dummy/app/controllers/i18n_controller.rb",
41
40
  "test/dummy/app/controllers/jump_controller.rb",
41
+ "test/dummy/app/controllers/pages_controller.rb",
42
42
  "test/dummy/app/controllers/steps_controller.rb",
43
43
  "test/dummy/app/helpers/application_helper.rb",
44
44
  "test/dummy/app/models/bar.rb",
45
45
  "test/dummy/app/views/bar/first.html.erb",
46
46
  "test/dummy/app/views/bar/last_step.html.erb",
47
47
  "test/dummy/app/views/bar/second.html.erb",
48
- "test/dummy/app/views/foo/first.html.erb",
49
- "test/dummy/app/views/foo/last_step.html.erb",
50
- "test/dummy/app/views/foo/second.html.erb",
51
48
  "test/dummy/app/views/i18n/first.html.erb",
52
49
  "test/dummy/app/views/i18n/second.html.erb",
53
50
  "test/dummy/app/views/jump/first.html.erb",
54
51
  "test/dummy/app/views/jump/last_step.html.erb",
55
52
  "test/dummy/app/views/jump/second.html.erb",
56
53
  "test/dummy/app/views/layouts/application.html.erb",
54
+ "test/dummy/app/views/pages/index.html.erb",
57
55
  "test/dummy/app/views/step_positions/_step_position.html.erb",
58
56
  "test/dummy/app/views/step_positions/first.html.erb",
59
57
  "test/dummy/app/views/step_positions/last_step.html.erb",
@@ -78,7 +76,6 @@ Gem::Specification.new do |s|
78
76
  "test/dummy/public/422.html",
79
77
  "test/dummy/public/500.html",
80
78
  "test/dummy/public/favicon.ico",
81
- "test/dummy/public/index.html",
82
79
  "test/dummy/public/javascripts/application.js",
83
80
  "test/dummy/public/javascripts/controls.js",
84
81
  "test/dummy/public/javascripts/dragdrop.js",
@@ -100,7 +97,7 @@ Gem::Specification.new do |s|
100
97
  s.homepage = "http://github.com/schneems/wicked"
101
98
  s.licenses = ["MIT"]
102
99
  s.require_paths = ["lib"]
103
- s.rubygems_version = "1.8.10"
100
+ s.rubygems_version = "1.8.24"
104
101
  s.summary = "Use Wicked to turn your controller into a wizard"
105
102
 
106
103
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wicked
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-12 00:00:00.000000000Z
12
+ date: 2012-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70119200321980 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 3.0.7
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70119200321980
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.7
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rails
27
- requirement: &70119200321480 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: 3.0.7
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70119200321480
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 3.0.7
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rake
38
- requirement: &70119200320960 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70119200320960
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: jeweler
49
- requirement: &70119200320460 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: 1.6.4
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70119200320460
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 1.6.4
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: rcov
60
- requirement: &70119200319960 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70119200319960
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: capybara
71
- requirement: &70119200319440 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: 0.4.0
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *70119200319440
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 0.4.0
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: launchy
82
- requirement: &70119200318900 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: '0'
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *70119200318900
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: sqlite3
93
- requirement: &70119200318400 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ! '>='
@@ -98,10 +133,15 @@ dependencies:
98
133
  version: '0'
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *70119200318400
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
102
142
  - !ruby/object:Gem::Dependency
103
143
  name: activerecord-jdbcsqlite3-adapter
104
- requirement: &70119200317880 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
105
145
  none: false
106
146
  requirements:
107
147
  - - ! '>='
@@ -109,7 +149,12 @@ dependencies:
109
149
  version: '0'
110
150
  type: :development
111
151
  prerelease: false
112
- version_requirements: *70119200317880
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
113
158
  description: Wicked is a Rails engine for producing easy wizard controllers
114
159
  email: richard.schneeman@gmail.com
115
160
  executables: []
@@ -137,24 +182,22 @@ files:
137
182
  - test/dummy/Rakefile
138
183
  - test/dummy/app/controllers/application_controller.rb
139
184
  - test/dummy/app/controllers/bar_controller.rb
140
- - test/dummy/app/controllers/foo_controller.rb
141
185
  - test/dummy/app/controllers/i18n_controller.rb
142
186
  - test/dummy/app/controllers/jump_controller.rb
187
+ - test/dummy/app/controllers/pages_controller.rb
143
188
  - test/dummy/app/controllers/steps_controller.rb
144
189
  - test/dummy/app/helpers/application_helper.rb
145
190
  - test/dummy/app/models/bar.rb
146
191
  - test/dummy/app/views/bar/first.html.erb
147
192
  - test/dummy/app/views/bar/last_step.html.erb
148
193
  - test/dummy/app/views/bar/second.html.erb
149
- - test/dummy/app/views/foo/first.html.erb
150
- - test/dummy/app/views/foo/last_step.html.erb
151
- - test/dummy/app/views/foo/second.html.erb
152
194
  - test/dummy/app/views/i18n/first.html.erb
153
195
  - test/dummy/app/views/i18n/second.html.erb
154
196
  - test/dummy/app/views/jump/first.html.erb
155
197
  - test/dummy/app/views/jump/last_step.html.erb
156
198
  - test/dummy/app/views/jump/second.html.erb
157
199
  - test/dummy/app/views/layouts/application.html.erb
200
+ - test/dummy/app/views/pages/index.html.erb
158
201
  - test/dummy/app/views/step_positions/_step_position.html.erb
159
202
  - test/dummy/app/views/step_positions/first.html.erb
160
203
  - test/dummy/app/views/step_positions/last_step.html.erb
@@ -179,7 +222,6 @@ files:
179
222
  - test/dummy/public/422.html
180
223
  - test/dummy/public/500.html
181
224
  - test/dummy/public/favicon.ico
182
- - test/dummy/public/index.html
183
225
  - test/dummy/public/javascripts/application.js
184
226
  - test/dummy/public/javascripts/controls.js
185
227
  - test/dummy/public/javascripts/dragdrop.js
@@ -212,7 +254,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
254
  version: '0'
213
255
  segments:
214
256
  - 0
215
- hash: 3821284544051991557
257
+ hash: 2016572717015383667
216
258
  required_rubygems_version: !ruby/object:Gem::Requirement
217
259
  none: false
218
260
  requirements:
@@ -221,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
263
  version: '0'
222
264
  requirements: []
223
265
  rubyforge_project:
224
- rubygems_version: 1.8.10
266
+ rubygems_version: 1.8.24
225
267
  signing_key:
226
268
  specification_version: 3
227
269
  summary: Use Wicked to turn your controller into a wizard
@@ -1,13 +0,0 @@
1
- ## This controller uses inheritance
2
-
3
- class FooController < Wicked::WizardController
4
- steps :first, :second, :last_step
5
-
6
- def show
7
- skip_step if params[:skip_step]
8
- render_wizard
9
- end
10
-
11
- def update
12
- end
13
- end
@@ -1 +0,0 @@
1
- last_step
@@ -1 +0,0 @@
1
- second
@@ -1 +0,0 @@
1
- home