ultra_light_wizard 0.1.1 → 0.1.2

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: 0eed69b8666f7e033857cad5aa839661f30df94e
4
- data.tar.gz: b72d941f28d75b57295f237648b59492f688c7a3
3
+ metadata.gz: 3c64b8c0380c8a7e2db0f80033b48a48c97735d6
4
+ data.tar.gz: 7a6ae221b27848282c03c2ef25920e658cba137e
5
5
  SHA512:
6
- metadata.gz: 58de5808aed736f727936ffe2b1da5b19d35930141333ffec43cd7826efb7a3a6b049faac74f75c8f6ad0fabb8f663ca21fa8a0f0655ad9b037e7e985cebbc06
7
- data.tar.gz: 0b921b545634a843236709114d82cbd0364ab02dd69568086d77c1c8c390ae12b0aa883834fd5aff765bc48b0805655c56844e103e66b9889c126fd861e45470
6
+ metadata.gz: 77dee7699ee96bb7996523dc280346d048d1831602eb1a67524ba7f7eaf609c36015603788aa577f26601de21d41928141f100a1217d681d19e65851cf7a7968
7
+ data.tar.gz: ba0d001a3d4b715e5ead5711daa9a9c8734830ce7d77b5ad98f14a45b300e85e16d5f601d96c5e46b4c8d63608982e4c6a0dc3ac84030e1cdaf2008802cf511e
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- Ultra Light Wizard v0.1.1 (beta)
1
+ Ultra Light Wizard v0.1.2 (beta)
2
2
  ================================
3
3
 
4
- No time to manage a wizard state machine, session variables, or complicated controllers? Use Ultra Light Wizard!! A RESTful session-less validation-friendly simple wizard approach in Rails.
4
+ No time to manage a wizard state machine, session variables, or complicated controllers? Use Ultra Light Wizard!! A RESTful session-less validation-friendly simple wizard architectural pattern in Rails.
5
5
 
6
6
  ![Ultra Light Wizard Image](https://cdn.rawgit.com/AndyObtiva/ultra_light_wizard/master/ultra_light_wizard.jpg)
7
7
 
@@ -22,13 +22,20 @@ Principles
22
22
  - Performance: stateless design means scalability
23
23
  - Security: stateless design is compatible with Rails security measures
24
24
 
25
+ Details
26
+ =======
27
+
28
+ To learn more about the Ultra Light Wizard architectural pattern philosophy and function, please read this [Code Painter](http://www.codepainter.ca) blog post: [Ultra Light & Maintainable Wizard in Rails] (http://www.codepainter.ca/2013/10/ultra-light-maintainable-wizards-in.html)
29
+
30
+ **Note**: Since Ultra Light Wizard is an architectural pattern that can be applied whether using this library or not, it is more important to understand it well first through watching the video and reading the article provided above. Afterward, you may use the library to get started quickly via Rails scaffolding for new project models or otherwise avoid by applying pattern manually for existing project models.
31
+
25
32
  Instructions
26
33
  ============
27
34
 
28
35
  Add the following to your Rails project ```Gemfile```:
29
36
 
30
37
  ```
31
- gem 'ultra_light_wizard', '~> 0.1.0'
38
+ gem 'ultra_light_wizard', '~> 0.1.2'
32
39
  ```
33
40
 
34
41
  Run the command:
@@ -87,9 +94,10 @@ generate scaffold
87
94
  create app/assets/stylesheets/projects.scss
88
95
  invoke scss
89
96
  identical app/assets/stylesheets/scaffolds.scss
90
- conflict app/controllers/projects_controller.rb
91
- Overwrite ~/code/rails_example/app/controllers/projects_controller.rb? (enter "h" for help) [Ynaqdh] a
92
- force app/controllers/projects_controller.rb
97
+ gsub app/controllers/projects_controller.rb
98
+ gsub app/controllers/projects_controller.rb
99
+ insert app/controllers/projects_controller.rb
100
+ gsub app/views/projects/index.html.erb
93
101
  create app/controllers/project_steps_controller.rb
94
102
  create app/helpers/project_steps_helper.rb
95
103
  create app/views/project_steps/_step_navigation.html.erb
@@ -118,8 +126,6 @@ For example, the following will kick-off the project wizard by creating a projec
118
126
  <%= link_to 'New Project', projects_path, method: :post %>
119
127
  ```
120
128
 
121
- It will ask you at one point to overwrite projects_controller generated in included scaffold. Type y or a to have it continue.
122
-
123
129
  If you'd like to customize the term "step", you can add a step_alias:(alias) option as in the following:
124
130
 
125
131
  Example:
@@ -164,9 +170,10 @@ generate scaffold
164
170
  create app/assets/stylesheets/projects.scss
165
171
  invoke scss
166
172
  identical app/assets/stylesheets/scaffolds.scss
167
- conflict app/controllers/projects_controller.rb
168
- Overwrite ~/code/rails_example/app/controllers/projects_controller.rb? (enter "h" for help) [Ynaqdh] a
169
- force app/controllers/projects_controller.rb
173
+ gsub app/controllers/projects_controller.rb
174
+ gsub app/controllers/projects_controller.rb
175
+ insert app/controllers/projects_controller.rb
176
+ gsub app/views/projects/index.html.erb
170
177
  create app/controllers/project_parts_controller.rb
171
178
  create app/helpers/project_parts_helper.rb
172
179
  create app/views/project_parts/_part_navigation.html.erb
@@ -185,33 +192,39 @@ resources :project_parts, only: [:edit, :update]
185
192
  end
186
193
  ```
187
194
 
188
- To learn more about the Ultra Light Wizard philosophy and function, please read this [Code Painter](http://www.codepainter.ca) blog post: [Ultra Light & Maintainable Wizard in Rails] (http://www.codepainter.ca/2013/10/ultra-light-maintainable-wizards-in.html)
189
-
190
195
  Features
191
196
  ========
192
197
 
193
198
  - Ultra Light Wizard scaffold generator
194
- + [DONE] Scaffolding of main model controller/views/migration
195
- + [DONE] Routes
196
- + [DONE] Controller steps
197
- + [DONE] Model parts
198
- + [DONE] View parts
199
- + [DONE] View navigation
200
- + [DONE] Helper for ultra light wizard support
201
- + [DONE] Route helper methods
202
- + [DONE] Wizard kick-off helper/view
203
- + [DONE] Forms
204
- + [DONE] Support for attributes
205
- + [DONE] Form fields
206
- + [DONE] Custom name conventions
207
- - Write automated tests
208
- - Support for nested resources
209
- - Modularize (perhaps extracting sub-generators)
199
+ + Scaffolding of main model controller/views/migration
200
+ + Routes
201
+ + Controller steps
202
+ + Model parts
203
+ + View parts
204
+ + View navigation
205
+ + Helper for ultra light wizard support
206
+ + Route helper methods
207
+ + Wizard kick-off helper/view
208
+ + Forms
209
+ + Support for attributes
210
+ + Form fields
211
+ + Custom name conventions
212
+ - [UPCOMING] Write automated tests
213
+ - [UPCOMING] Support for nested resources
214
+ - [UPCOMING] Modularize (perhaps extracting sub-generators)
215
+ - [UPCOMING] Haml and Slim templates
210
216
 
211
217
  Enhancements
212
218
  ============
213
219
 
214
- If you are interested in having enhancements implemented, please report via a GitHub issue, describing the problem, providing use case examples, and suggesting solutions to implement. I'd be happy to implement as part of paid work if needed ASAP using the [CodeMentor platform](https://www.codementor.io/andymaleh).
220
+ If you are interested in having enhancements implemented, please report via a GitHub issue, describing the problem, providing use case examples, and suggesting solutions to implement.
221
+
222
+ History
223
+ =======
224
+
225
+ v0.1.2 ensure resource creation redirects to first step / include step helper in resource controller
226
+ v0.1.1 includes permitted params and edit/update actions
227
+ v0.1.0 initial implementation
215
228
 
216
229
  License
217
230
  =======
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -1,9 +1,8 @@
1
1
  class <%= class_name %><%= step_alias.pluralize.camelize %>Controller < ApplicationController
2
2
  include <%= class_name %><%= step_alias.pluralize.camelize %>Helper
3
+ helper <%= class_name %><%= step_alias.pluralize.camelize %>Helper
3
4
  before_action :load_<%= file_path %>
4
5
 
5
- <%= step_alias.pluralize.upcase %> = %w(<%= steps.to_a.join(' ') %>)
6
-
7
6
  def edit
8
7
  if <%= file_path %>_<%= step_alias %>_model.editable?
9
8
  if <%= step_alias %>.present?
@@ -20,11 +20,7 @@ module UltraLightWizard
20
20
  end
21
21
 
22
22
  def controller_class_name
23
- file_path.pluralize.titleize
24
- end
25
-
26
- def orm_class
27
- file_path.camelize.titleize
23
+ "#{class_name.pluralize}Controller"
28
24
  end
29
25
 
30
26
  def index_helper
@@ -85,12 +81,19 @@ module UltraLightWizard
85
81
  def copy_config
86
82
  generate "scaffold", "#{file_path} #{scaffold_attributes} #{arg_options}"
87
83
 
84
+ gsub_file "app/controllers/#{file_path.pluralize}_controller.rb",
85
+ "class #{controller_class_name} < ApplicationController",
86
+ <<-CONTENT
87
+ class #{controller_class_name} < ApplicationController
88
+ include #{class_name}#{step_alias.pluralize.camelize}Helper
89
+ helper #{class_name}#{step_alias.pluralize.camelize}Helper
90
+ CONTENT
88
91
  gsub_file "app/controllers/#{file_path.pluralize}_controller.rb",
89
92
  "@#{singular_table_name}.save\n",
90
93
  "@#{singular_table_name}.save(validation: false)\n"
91
94
  gsub_file "app/controllers/#{file_path.pluralize}_controller.rb",
92
- "redirect_to @#{singular_table_name}, notice: 'Video was successfully created.'",
93
- "redirect_to edit_#{file_path}_#{file_path}_#{step_alias}_path(@#{singular_table_name}, #{orm_class}#{step_alias.camelize.titleize.pluralize}Helper::#{step_alias.pluralize.upcase}.first)"
95
+ "redirect_to @#{singular_table_name}, notice: '#{class_name} was successfully created.'",
96
+ "redirect_to edit_#{file_path}_#{file_path}_#{step_alias}_path(@#{singular_table_name}, #{class_name}#{step_alias.camelize.titleize.pluralize}Helper::#{step_alias.pluralize.upcase}.first)"
94
97
  inject_into_file "app/controllers/#{file_path.pluralize}_controller.rb",
95
98
  after: "def #{singular_table_name}_params\n" do
96
99
  " return {} unless params[:#{singular_table_name}].present?\n"
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: ultra_light_wizard 0.1.1 ruby lib
5
+ # stub: ultra_light_wizard 0.1.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "ultra_light_wizard"
9
- s.version = "0.1.1"
9
+ s.version = "0.1.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Andy Maleh"]
14
- s.date = "2016-02-17"
14
+ s.date = "2017-02-22"
15
15
  s.description = "Ultra light & maintainble wizards in Rails that honor REST, MVC, and OO with minimal writing of code involved and maximum flexibility"
16
16
  s.email = "andy.am@gmail.com"
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultra_light_wizard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-17 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jeweler