wicked 1.1.1 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d57c6303ec9b5b9ade82da9eb85f17bbc3456c8
4
- data.tar.gz: 5020cb0b2f0af4813cd9d035a15b6c55305c8461
3
+ metadata.gz: 22f6f41073e2bea73b0a1310eb93b7cca68d9787
4
+ data.tar.gz: aceb9c69831a4ebe134fb61fe3968a909c404491
5
5
  SHA512:
6
- metadata.gz: d52c329c13d8fd610ed2bdef74cb5e25c19c923da18ec8d7977007b3afd1635ddecac017d1fd4598fae61e3a7dbc3ff8e5edb3af63f6b2a1324927b09d4305de
7
- data.tar.gz: 618e15b7c0a1b59614ba9fe9f0513527b53f56f370dbecf499efe611ef5df8c774d222485c3d1e83ce3552d7b72104068a5caf6e43125c6896367f1c9ab2771e
6
+ metadata.gz: 8101763f8b5ff60c28a458e61d4270fdcf1a9ce70a8c10dcaaad52263918fd30f6ae7a619b9a75d967fb44e5ea539623c037ae9b8ac0920744162389cb7d9964
7
+ data.tar.gz: 66fffeef5ea6e6847bfafc6f5ed809525ca97f342f22c0588ac86b53a9162fb2cb541c8dc7bb3bceef95f61bf957cbfafd27609b7ad01a61fb4069e92a103736
data/.gitignore CHANGED
@@ -11,3 +11,4 @@ Gemfile.lock
11
11
  .ruby-version
12
12
  .ruby-gemset
13
13
  gemfiles/*.lock
14
+ *.gem
data/.travis.yml CHANGED
@@ -6,12 +6,14 @@ rvm:
6
6
  - ruby-head
7
7
  - jruby-19mode
8
8
 
9
+ sudo: false
10
+
9
11
  gemfile:
10
- - gemfiles/3.0.gemfile
11
12
  - gemfiles/3.1.gemfile
12
13
  - gemfiles/3.2.gemfile
13
14
  - gemfiles/4.0.gemfile
14
15
  - gemfiles/4.1.gemfile
16
+ - gemfiles/4.2.gemfile
15
17
 
16
18
  matrix:
17
19
  allow_failures:
@@ -20,6 +22,4 @@ matrix:
20
22
  - gemfile: gemfiles/3.0.gemfile
21
23
  rvm: 2.1.1
22
24
  - rvm: ruby-head
23
- - env: "RAILS_VERSION=3.0.7"
24
- rvm: 2.1.1
25
25
 
data/Appraisals CHANGED
@@ -1,8 +1,3 @@
1
- appraise "3.0" do
2
- gem "rails", "~> 3.0.7"
3
- gemspec
4
- end
5
-
6
1
  appraise "3.1" do
7
2
  gem "rails", "~> 3.1.0"
8
3
  gemspec
@@ -22,3 +17,9 @@ appraise "4.1" do
22
17
  gem "rails", "~> 4.1.0"
23
18
  gemspec
24
19
  end
20
+
21
+
22
+ appraise "4.2" do
23
+ gem "rails", "~> 4.2"
24
+ gemspec
25
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## Master
2
2
 
3
+ ## 1.2.1 (8/28/2015)
4
+
5
+ * [#186] Do not require use of ApplicationController with wicked.
6
+
7
+
3
8
  ## 1.1.1 (2/23/2015)
4
9
 
5
10
  * [#159] Default wizard index actions now work when using `default_url_options`
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
  # Put all runtime dependencies in wicked.gemspec
5
5
  # Put development requirements for different platforms here
6
6
  # Put more specific gem declarations in different gemfiles/*.gemfile files
7
- gemspec :path => File.expand_path("../.", __FILE__)
7
+ gemspec :path => ::File.expand_path("../.", __FILE__)
8
8
 
9
9
  group :development, :test do
10
10
  gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
data/README.md CHANGED
@@ -129,6 +129,7 @@ end
129
129
 
130
130
  We're passing `render_wizard` our `@user` object here. If you pass an object into `render_wizard` it will show the next step if the object saves or re-render the previous view if it does not save.
131
131
 
132
+ Note that `render_wizard` does attempt to save the passed object. This means that in the above example, the object will be saved twice. This will cause any callbacks to run twice also. If this is undesirable for your use case, then calling `assign_attributes` (which does not save the object) instead of `update_attributes` might work better.
132
133
 
133
134
  To get to this update action, you simply need to submit a form that PUT's to the same url
134
135
 
@@ -194,13 +195,15 @@ wizard_steps # Gets ordered list of steps
194
195
 
195
196
  **Redirect options**
196
197
 
197
- Both `skip_step` and `jump_to` will cause a redirect. If you want to pass params to the step you are skipping to you can pass it into those.
198
+ Both `skip_step` and `jump_to` will cause a redirect.
198
199
 
199
200
  ```
200
201
  skip_step(foo: "bar")
201
202
  ```
202
203
 
203
- and
204
+ *Note that unlike you would do when making a call to Rails' `redirect_to`, you should not call `return` immediately after `skip_step` and `jump_to`, since the actual redirection is done in the render_wizard call.*
205
+
206
+ If you want to pass params to the step you are skipping to you can pass it into those:
204
207
 
205
208
  ```
206
209
  jump_to(:specific_step, foo: "bar")
@@ -409,28 +412,44 @@ the first step you've specified. This might be useful for redirecting a
409
412
  user to a step when you're not already in a Wicked controller. If you
410
413
  change the constants, they are expected to be strings (not symbols).
411
414
 
412
- ## About
415
+ ## Support
416
+
417
+ Most problems using this library are general problems using Ruby/Rails. If you cannot get something to work correctly please open up a question on [stack overflow](http://stackoverflow.com/). If you've not posted there before, provide a description of the problem you're having and usually some example code and a copy of your rails logs helps.
418
+
419
+ If you've found a bug, please open a ticket on the issue tracker with a small example app that reproduces the behavior.
413
420
 
414
- Please poke around the source code, if you see easier ways to get a Rails controller to do what I want, let me know.
421
+ ## About
415
422
 
416
- If you have a question file an issue or, find me on the Twitters [@schneems](http://twitter.com/schneems).
423
+ Made by [@schneems](http://twitter.com/schneems).
417
424
 
418
425
  This project rocks and uses MIT-LICENSE.
419
426
 
420
427
  ## Compatibility
421
428
 
422
- This gem works with Rails 3.0, 3.1, 3.2, 4.0 and 4.1, and is compatible with Ruby 1.9.3, 2.0.0, 2.1.1 or JRuby (with some exceptions).
423
-
424
- Refer to the Travis CI test matrix for test using your version of Ruby and Rails.
429
+ Refer to the Travis CI test matrix for test using your version of Ruby and Rails. If there is a newer Ruby or Rails you don't see on there, please add an entry to the Apprasials file, then run `$ apprasials install` and update the `.travis.yml` file and send me a pull request.
425
430
 
426
- Exceptions: Rails 3.0 support is only for Ruby 1.9.3 or JRuby, not Ruby 2.0.0 or newer.
431
+ Note: Rails 3.0 support is only for Ruby 1.9.3 or JRuby, not Ruby 2.0.0 or newer.
427
432
 
428
433
  ## Running Gem Tests
429
434
 
430
- Run tests with `rake`.
435
+ First install all gemfiles:
436
+
437
+ ```
438
+ $ appraisal install
439
+ ```
440
+
441
+ Then to run tests against all the appraisal gemfiles, use:
442
+
443
+ ```
444
+ $ appraisal rake test
445
+ ```
446
+
447
+ To run tests against one specific gemfile,
448
+ use
431
449
 
432
- To run tests against all the appraisal gemfiles, use `appraisal rake`. To run tests against one specific gemfile,
433
- use `appraisal 4.1 rake`.
450
+ ```
451
+ $ appraisal 4.1 rake test
452
+ ```
434
453
 
435
454
  Note that Rails 3.0 tests don't pass in Ruby 2.0.0 or newer, so during development it may be easier to disable this
436
455
  gemfile if you are using a current version of Ruby.
data/Rakefile CHANGED
@@ -2,6 +2,8 @@
2
2
  require 'rubygems'
3
3
  require 'bundler'
4
4
 
5
+ require 'bundler/gem_tasks'
6
+
5
7
  begin
6
8
  Bundler.setup(:default, :development, :test)
7
9
  rescue Bundler::BundlerError => e
data/gemfiles/3.1.gemfile CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- eval Pathname.new(__FILE__).join("../../Gemfile").read
6
-
7
5
  gem "rails", "~> 3.1.0"
6
+
7
+ group :development, :test do
8
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
9
+ gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", :platform => :jruby
10
+ end
11
+
12
+ gemspec :path => "../"
data/gemfiles/3.2.gemfile CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- eval Pathname.new(__FILE__).join("../../Gemfile").read
6
-
7
5
  gem "rails", "~> 3.2.15"
6
+
7
+ group :development, :test do
8
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
9
+ gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", :platform => :jruby
10
+ end
11
+
12
+ gemspec :path => "../"
data/gemfiles/4.0.gemfile CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- eval Pathname.new(__FILE__).join("../../Gemfile").read
6
-
7
5
  gem "rails", "~> 4.0.0"
8
6
 
7
+ group :development, :test do
8
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
9
+ gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", :platform => :jruby
10
+ end
11
+
12
+ gemspec :path => "../"
data/gemfiles/4.1.gemfile CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- eval Pathname.new(__FILE__).join("../../Gemfile").read
6
-
7
5
  gem "rails", "~> 4.1.0"
6
+
7
+ group :development, :test do
8
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
9
+ gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", :platform => :jruby
10
+ end
11
+
12
+ gemspec :path => "../"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.2"
6
+
7
+ group :development, :test do
8
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
9
+ gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", :platform => :jruby
10
+ end
11
+
12
+ gemspec :path => "../"
data/lib/wicked.rb CHANGED
@@ -13,6 +13,7 @@ module Wicked
13
13
  end
14
14
  module Wizard
15
15
  end
16
+ autoload :WizardController, "wicked/wizard_controller"
16
17
  end
17
18
 
18
19
  class WickedError < StandardError; end
@@ -24,4 +25,3 @@ require 'wicked/controller/concerns/path'
24
25
  require 'wicked/wizard'
25
26
  require 'wicked/wizard/translated'
26
27
  require 'wicked/engine'
27
-
@@ -81,7 +81,6 @@ module Wicked::Controller::Concerns::Steps
81
81
  index = steps.index(current_step)
82
82
  step = steps.at(index - 1) if index.present? && index != 0
83
83
  step ||= steps.first
84
- step
85
84
  end
86
85
 
87
86
 
@@ -90,7 +89,6 @@ module Wicked::Controller::Concerns::Steps
90
89
  index = steps.index(current_step)
91
90
  step = steps.at(index + 1) if index.present?
92
91
  step ||= Wicked::FINISH_STEP
93
- step
94
92
  end
95
93
 
96
94
  private
@@ -104,8 +102,7 @@ module Wicked::Controller::Concerns::Steps
104
102
  end
105
103
 
106
104
  def current_and_given_step_exists?(step_name)
107
- return false if current_step_index.nil? || steps.index(step_name).nil?
108
- return true
105
+ current_step_index.present? && steps.index(step_name).present?
109
106
  end
110
107
  end
111
108
 
@@ -1,3 +1,3 @@
1
1
  module Wicked
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -43,5 +43,6 @@ module Dummy
43
43
  config.filter_parameters += [:password]
44
44
 
45
45
  config.eager_load = false
46
+ config.secret_key_base = 'foo'
46
47
  end
47
48
  end
data/wicked.gemspec CHANGED
@@ -19,6 +19,9 @@ Gem::Specification.new do |gem|
19
19
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
20
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
21
  gem.require_paths = ["lib"]
22
- gem.add_dependency "rails", [">= 3.0.7"]
22
+ gem.add_dependency "railties", [">= 3.0.7"]
23
+ gem.add_development_dependency "rails", [">= 3.0.7"]
23
24
  gem.add_development_dependency "capybara", [">= 0"]
25
+ gem.add_development_dependency "appraisal"
26
+ gem.add_development_dependency "test-unit"
24
27
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wicked
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-23 00:00:00.000000000 Z
11
+ date: 2015-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.0.7
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.7
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.7
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: capybara
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +52,34 @@ dependencies:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: appraisal
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: test-unit
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  description: Wicked is a Rails engine for producing easy wizard controllers
42
84
  email:
43
85
  - richard.schneeman+rubygems@gmail.com
@@ -55,13 +97,11 @@ files:
55
97
  - MIT-LICENSE
56
98
  - README.md
57
99
  - Rakefile
58
- - VERSION
59
- - app/controllers/wicked/wizard_controller.rb
60
- - gemfiles/3.0.gemfile
61
100
  - gemfiles/3.1.gemfile
62
101
  - gemfiles/3.2.gemfile
63
102
  - gemfiles/4.0.gemfile
64
103
  - gemfiles/4.1.gemfile
104
+ - gemfiles/4.2.gemfile
65
105
  - lib/wicked.rb
66
106
  - lib/wicked/controller/concerns/path.rb
67
107
  - lib/wicked/controller/concerns/render_redirect.rb
@@ -70,6 +110,7 @@ files:
70
110
  - lib/wicked/version.rb
71
111
  - lib/wicked/wizard.rb
72
112
  - lib/wicked/wizard/translated.rb
113
+ - lib/wicked/wizard_controller.rb
73
114
  - test/controllers/bar_controller_test.rb
74
115
  - test/controllers/updates_controller_test.rb
75
116
  - test/dummy/Rakefile
@@ -182,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
223
  version: '0'
183
224
  requirements: []
184
225
  rubyforge_project:
185
- rubygems_version: 2.4.5
226
+ rubygems_version: 2.4.5.1
186
227
  signing_key:
187
228
  specification_version: 4
188
229
  summary: Use Wicked to turn your controller into a wizard
@@ -278,4 +319,3 @@ test_files:
278
319
  - test/support/integration_case.rb
279
320
  - test/test_helper.rb
280
321
  - test/wicked_test.rb
281
- has_rdoc:
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.1.1
data/gemfiles/3.0.gemfile DELETED
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- eval Pathname.new(__FILE__).join("../../Gemfile").read
6
-
7
- gem "rails", "~> 3.0.7"