wicked 0.3.2 → 0.3.3

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.

data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.3.3
2
+ * warn users users who forgot to set steps
3
+
1
4
  ## 0.3.2
2
5
  * Forward params passed to the index action
3
6
  * bug fix: 1.8.7 hash ordering
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -74,6 +74,7 @@ module Wicked::Controller::Concerns::Steps
74
74
 
75
75
  def next_step(current_step = nil)
76
76
  return @next_step if current_step == nil
77
+ raise "Wicked Wizard steps not set, but expected" if steps.blank?
77
78
  index = steps.index(current_step)
78
79
  step = steps.at(index + 1) if index.present?
79
80
  step ||= :finish
@@ -0,0 +1,18 @@
1
+ ## This controller uses includes
2
+
3
+ class Nested::BuilderController < ApplicationController
4
+ include Wicked::Wizard
5
+
6
+ steps :first, :second, :last_step
7
+
8
+ # nested_builder GET /nested/:nested_id/builder/:id(.:format) {:action=>"show", :controller=>"builder"}
9
+ def show
10
+ raise "no nested_id: #{params.inspect}" unless params[:nested_id].present?
11
+ raise "no id: #{params.inspect}" unless params[:id].present?
12
+
13
+ render_wizard
14
+ end
15
+
16
+ def update
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ last
2
+
3
+ <%= "params[:nested_id] #{params[:nested_id]}" %>
4
+
5
+ <%= link_to 'next', next_wizard_path %>
@@ -4,6 +4,10 @@ Dummy::Application.routes.draw do
4
4
  resources :jump
5
5
  resources :step_positions
6
6
 
7
+ resources :nested do
8
+ resources :builder, :controller => 'nested/builder'
9
+ end
10
+
7
11
  # The priority is based upon order of creation:
8
12
  # first created -> highest priority.
9
13
 
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ class NestedBuilderTest < ActiveSupport::IntegrationCase
4
+
5
+ test 'can use nested ids' do
6
+ visit nested_builder_path(:last_step, :nested_id => "foo")
7
+ assert has_content?("last")
8
+ assert has_content?("params[:nested_id] foo")
9
+ end
10
+
11
+ test 'forwards nested ids' do
12
+ visit nested_builder_path(:last_step, :nested_id => "foo")
13
+ assert has_content?("last")
14
+ click_link 'next'
15
+ assert has_content?("home")
16
+ end
17
+
18
+ end
data/wicked.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "wicked"
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
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-30"
12
+ s.date = "2012-12-22"
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 = [
@@ -38,6 +38,7 @@ Gem::Specification.new do |s|
38
38
  "test/dummy/app/controllers/bar_controller.rb",
39
39
  "test/dummy/app/controllers/i18n_controller.rb",
40
40
  "test/dummy/app/controllers/jump_controller.rb",
41
+ "test/dummy/app/controllers/nested/builder_controller.rb",
41
42
  "test/dummy/app/controllers/pages_controller.rb",
42
43
  "test/dummy/app/controllers/steps_controller.rb",
43
44
  "test/dummy/app/helpers/application_helper.rb",
@@ -51,6 +52,9 @@ Gem::Specification.new do |s|
51
52
  "test/dummy/app/views/jump/last_step.html.erb",
52
53
  "test/dummy/app/views/jump/second.html.erb",
53
54
  "test/dummy/app/views/layouts/application.html.erb",
55
+ "test/dummy/app/views/nested/builder/first.html.erb",
56
+ "test/dummy/app/views/nested/builder/last_step.html.erb",
57
+ "test/dummy/app/views/nested/builder/second.html.erb",
54
58
  "test/dummy/app/views/pages/index.html.erb",
55
59
  "test/dummy/app/views/step_positions/_step_position.html.erb",
56
60
  "test/dummy/app/views/step_positions/first.html.erb",
@@ -88,6 +92,7 @@ Gem::Specification.new do |s|
88
92
  "test/integration/i18n_test.rb",
89
93
  "test/integration/jump_test.rb",
90
94
  "test/integration/navigation_test.rb",
95
+ "test/integration/nested_builder_test.rb",
91
96
  "test/integration/steps_test.rb",
92
97
  "test/support/integration_case.rb",
93
98
  "test/test_helper.rb",
@@ -97,7 +102,7 @@ Gem::Specification.new do |s|
97
102
  s.homepage = "http://github.com/schneems/wicked"
98
103
  s.licenses = ["MIT"]
99
104
  s.require_paths = ["lib"]
100
- s.rubygems_version = "1.8.24"
105
+ s.rubygems_version = "1.8.10"
101
106
  s.summary = "Use Wicked to turn your controller into a wizard"
102
107
 
103
108
  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.2
4
+ version: 0.3.3
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-30 00:00:00.000000000 Z
12
+ date: 2012-12-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70141352669580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: 3.0.7
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: 3.0.7
24
+ version_requirements: *70141352669580
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rails
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70141352669060 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: 3.0.7
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: 3.0.7
35
+ version_requirements: *70141352669060
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: rake
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70141352668580 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: '0'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *70141352668580
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: jeweler
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &70141352668060 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ~>
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: 1.6.4
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: 1.6.4
57
+ version_requirements: *70141352668060
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: rcov
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &70141352667560 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,15 +65,10 @@ dependencies:
85
65
  version: '0'
86
66
  type: :development
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
68
+ version_requirements: *70141352667560
94
69
  - !ruby/object:Gem::Dependency
95
70
  name: capybara
96
- requirement: !ruby/object:Gem::Requirement
71
+ requirement: &70141352667080 !ruby/object:Gem::Requirement
97
72
  none: false
98
73
  requirements:
99
74
  - - ! '>='
@@ -101,15 +76,10 @@ dependencies:
101
76
  version: 0.4.0
102
77
  type: :development
103
78
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: 0.4.0
79
+ version_requirements: *70141352667080
110
80
  - !ruby/object:Gem::Dependency
111
81
  name: launchy
112
- requirement: !ruby/object:Gem::Requirement
82
+ requirement: &70141352666580 !ruby/object:Gem::Requirement
113
83
  none: false
114
84
  requirements:
115
85
  - - ! '>='
@@ -117,15 +87,10 @@ dependencies:
117
87
  version: '0'
118
88
  type: :development
119
89
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ! '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
90
+ version_requirements: *70141352666580
126
91
  - !ruby/object:Gem::Dependency
127
92
  name: sqlite3
128
- requirement: !ruby/object:Gem::Requirement
93
+ requirement: &70141352666060 !ruby/object:Gem::Requirement
129
94
  none: false
130
95
  requirements:
131
96
  - - ! '>='
@@ -133,15 +98,10 @@ dependencies:
133
98
  version: '0'
134
99
  type: :development
135
100
  prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: '0'
101
+ version_requirements: *70141352666060
142
102
  - !ruby/object:Gem::Dependency
143
103
  name: activerecord-jdbcsqlite3-adapter
144
- requirement: !ruby/object:Gem::Requirement
104
+ requirement: &70141352665540 !ruby/object:Gem::Requirement
145
105
  none: false
146
106
  requirements:
147
107
  - - ! '>='
@@ -149,12 +109,7 @@ dependencies:
149
109
  version: '0'
150
110
  type: :development
151
111
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: '0'
112
+ version_requirements: *70141352665540
158
113
  description: Wicked is a Rails engine for producing easy wizard controllers
159
114
  email: richard.schneeman@gmail.com
160
115
  executables: []
@@ -184,6 +139,7 @@ files:
184
139
  - test/dummy/app/controllers/bar_controller.rb
185
140
  - test/dummy/app/controllers/i18n_controller.rb
186
141
  - test/dummy/app/controllers/jump_controller.rb
142
+ - test/dummy/app/controllers/nested/builder_controller.rb
187
143
  - test/dummy/app/controllers/pages_controller.rb
188
144
  - test/dummy/app/controllers/steps_controller.rb
189
145
  - test/dummy/app/helpers/application_helper.rb
@@ -197,6 +153,9 @@ files:
197
153
  - test/dummy/app/views/jump/last_step.html.erb
198
154
  - test/dummy/app/views/jump/second.html.erb
199
155
  - test/dummy/app/views/layouts/application.html.erb
156
+ - test/dummy/app/views/nested/builder/first.html.erb
157
+ - test/dummy/app/views/nested/builder/last_step.html.erb
158
+ - test/dummy/app/views/nested/builder/second.html.erb
200
159
  - test/dummy/app/views/pages/index.html.erb
201
160
  - test/dummy/app/views/step_positions/_step_position.html.erb
202
161
  - test/dummy/app/views/step_positions/first.html.erb
@@ -234,6 +193,7 @@ files:
234
193
  - test/integration/i18n_test.rb
235
194
  - test/integration/jump_test.rb
236
195
  - test/integration/navigation_test.rb
196
+ - test/integration/nested_builder_test.rb
237
197
  - test/integration/steps_test.rb
238
198
  - test/support/integration_case.rb
239
199
  - test/test_helper.rb
@@ -254,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
214
  version: '0'
255
215
  segments:
256
216
  - 0
257
- hash: 2016572717015383667
217
+ hash: -1133389636491458885
258
218
  required_rubygems_version: !ruby/object:Gem::Requirement
259
219
  none: false
260
220
  requirements:
@@ -263,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
223
  version: '0'
264
224
  requirements: []
265
225
  rubyforge_project:
266
- rubygems_version: 1.8.24
226
+ rubygems_version: 1.8.10
267
227
  signing_key:
268
228
  specification_version: 3
269
229
  summary: Use Wicked to turn your controller into a wizard