├── .gitignore ├── .ruby-gemset ├── .ruby-version ├── Gemfile ├── Gemfile.lock ├── LICENSE.txt ├── README.md ├── Rakefile ├── VERSION ├── lib ├── generators │ ├── templates │ │ └── app │ │ │ ├── assets │ │ │ └── stylesheets │ │ │ │ └── wizard_steps.scss │ │ │ ├── controllers │ │ │ └── wizard_steps_controller.rb.erb │ │ │ ├── helpers │ │ │ └── wizard_steps_helper.rb.erb │ │ │ ├── models │ │ │ └── wizard_step_model.rb.erb │ │ │ └── views │ │ │ ├── wizard_step_breadcrumb_view.html.erb │ │ │ ├── wizard_step_navigation_view.html.erb │ │ │ └── wizard_step_view.html.erb │ └── ultra_light_wizard │ │ └── scaffold_generator.rb └── ultra_light_wizard.rb ├── ruby187.Gemfile ├── spec ├── fixtures │ └── ref_rails_app │ │ ├── .gitignore │ │ ├── Gemfile │ │ ├── Gemfile.lock │ │ ├── README.rdoc │ │ ├── Rakefile │ │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── .keep │ │ │ ├── javascripts │ │ │ │ └── application.js │ │ │ └── stylesheets │ │ │ │ └── application.css │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ └── concerns │ │ │ │ └── .keep │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── mailers │ │ │ └── .keep │ │ ├── models │ │ │ ├── .keep │ │ │ └── concerns │ │ │ │ └── .keep │ │ └── views │ │ │ └── layouts │ │ │ └── application.html.erb │ │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ ├── rake │ │ ├── setup │ │ └── spring │ │ ├── config.ru │ │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── assets.rb │ │ │ ├── backtrace_silencers.rb │ │ │ ├── cookies_serializer.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── session_store.rb │ │ │ ├── to_time_preserves_timezone.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── routes.rb │ │ └── secrets.yml │ │ ├── db │ │ ├── schema.rb │ │ └── seeds.rb │ │ ├── lib │ │ ├── assets │ │ │ └── .keep │ │ └── tasks │ │ │ └── .keep │ │ ├── log │ │ └── .keep │ │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ ├── favicon.ico │ │ └── robots.txt │ │ ├── spec │ │ ├── features │ │ │ └── ultra_light_wizard_spec.rb │ │ ├── rails_helper.rb │ │ └── spec_helper.rb │ │ └── vendor │ │ └── assets │ │ ├── javascripts │ │ └── .keep │ │ └── stylesheets │ │ └── .keep ├── lib │ └── ultra_light_wizard │ │ └── ultra_light_wizard_spec.rb └── spec_helper.rb ├── ultra_light_wizard.gemspec ├── ultra_light_wizard.jpg └── ultra_light_wizard_step_breadcrumb.png /.gitignore: -------------------------------------------------------------------------------- 1 | # rcov generated 2 | coverage 3 | coverage.data 4 | 5 | # rdoc generated 6 | rdoc 7 | 8 | # yard generated 9 | doc 10 | .yardoc 11 | 12 | # bundler 13 | .bundle 14 | 15 | # jeweler generated 16 | pkg 17 | 18 | # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore: 19 | # 20 | # * Create a file at ~/.gitignore 21 | # * Include files you want ignored 22 | # * Run: git config --global core.excludesfile ~/.gitignore 23 | # 24 | # After doing this, these files will be ignored in all your git projects, 25 | # saving you from having to 'pollute' every project you touch with them 26 | # 27 | # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line) 28 | # 29 | # For MacOS: 30 | # 31 | #.DS_Store 32 | 33 | # For TextMate 34 | #*.tmproj 35 | #tmtags 36 | 37 | # For emacs: 38 | #*~ 39 | #\#* 40 | #.\#* 41 | 42 | # For vim: 43 | #*.swp 44 | 45 | # For redcar: 46 | #.redcar 47 | 48 | # For rubinius: 49 | #*.rbc 50 | *.rbc 51 | *.sassc 52 | .sass-cache 53 | capybara-*.html 54 | .rspec 55 | /.bundle 56 | /vendor/bundle 57 | /log/* 58 | /tmp/* 59 | /db/*.sqlite3 60 | /public/system/* 61 | /coverage/ 62 | /spec/tmp/* 63 | **.orig 64 | rerun.txt 65 | pickle-email-*.html 66 | 67 | .idea 68 | .DS_Store 69 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | ultra_light_wizard 2 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.4.1 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | group :development, :test do 4 | gem 'puts_debuggerer', '~> 0.7.1' 5 | gem 'rails', '~> 4.2.9' 6 | gem 'rspec-rails', '~> 3.6.0' 7 | gem 'sass-rails', '~> 5.0' 8 | gem 'coffee-rails', '~> 4.1.0' 9 | end 10 | 11 | group :development do 12 | gem 'jeweler', '~> 2.3.7' 13 | end 14 | 15 | group :test do 16 | gem 'capybara' 17 | gem 'coveralls' 18 | gem 'ultra_light_wizard', path: '.' #used in specs 19 | gem 'sqlite3' 20 | gem 'launchy' 21 | end 22 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | ultra_light_wizard (0.1.4) 5 | 6 | GEM 7 | remote: http://rubygems.org/ 8 | specs: 9 | actionmailer (4.2.9) 10 | actionpack (= 4.2.9) 11 | actionview (= 4.2.9) 12 | activejob (= 4.2.9) 13 | mail (~> 2.5, >= 2.5.4) 14 | rails-dom-testing (~> 1.0, >= 1.0.5) 15 | actionpack (4.2.9) 16 | actionview (= 4.2.9) 17 | activesupport (= 4.2.9) 18 | rack (~> 1.6) 19 | rack-test (~> 0.6.2) 20 | rails-dom-testing (~> 1.0, >= 1.0.5) 21 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 22 | actionview (4.2.9) 23 | activesupport (= 4.2.9) 24 | builder (~> 3.1) 25 | erubis (~> 2.7.0) 26 | rails-dom-testing (~> 1.0, >= 1.0.5) 27 | rails-html-sanitizer (~> 1.0, >= 1.0.3) 28 | activejob (4.2.9) 29 | activesupport (= 4.2.9) 30 | globalid (>= 0.3.0) 31 | activemodel (4.2.9) 32 | activesupport (= 4.2.9) 33 | builder (~> 3.1) 34 | activerecord (4.2.9) 35 | activemodel (= 4.2.9) 36 | activesupport (= 4.2.9) 37 | arel (~> 6.0) 38 | activesupport (4.2.9) 39 | i18n (~> 0.7) 40 | minitest (~> 5.1) 41 | thread_safe (~> 0.3, >= 0.3.4) 42 | tzinfo (~> 1.1) 43 | addressable (2.4.0) 44 | arel (6.0.4) 45 | awesome_print (1.8.0) 46 | builder (3.2.3) 47 | capybara (2.14.4) 48 | addressable 49 | mime-types (>= 1.16) 50 | nokogiri (>= 1.3.3) 51 | rack (>= 1.0.0) 52 | rack-test (>= 0.5.4) 53 | xpath (~> 2.0) 54 | coffee-rails (4.1.1) 55 | coffee-script (>= 2.2.0) 56 | railties (>= 4.0.0, < 5.1.x) 57 | coffee-script (2.4.1) 58 | coffee-script-source 59 | execjs 60 | coffee-script-source (1.12.2) 61 | concurrent-ruby (1.0.5) 62 | coveralls (0.8.21) 63 | json (>= 1.8, < 3) 64 | simplecov (~> 0.14.1) 65 | term-ansicolor (~> 1.3) 66 | thor (~> 0.19.4) 67 | tins (~> 1.6) 68 | descendants_tracker (0.0.4) 69 | thread_safe (~> 0.3, >= 0.3.1) 70 | diff-lcs (1.3) 71 | docile (1.1.5) 72 | erubis (2.7.0) 73 | execjs (2.7.0) 74 | faraday (0.9.2) 75 | multipart-post (>= 1.2, < 3) 76 | ffi (1.9.18) 77 | git (1.3.0) 78 | github_api (0.16.0) 79 | addressable (~> 2.4.0) 80 | descendants_tracker (~> 0.0.4) 81 | faraday (~> 0.8, < 0.10) 82 | hashie (>= 3.4) 83 | mime-types (>= 1.16, < 3.0) 84 | oauth2 (~> 1.0) 85 | globalid (0.4.0) 86 | activesupport (>= 4.2.0) 87 | hashie (3.5.6) 88 | highline (1.7.8) 89 | i18n (0.8.6) 90 | jeweler (2.3.7) 91 | builder 92 | bundler (>= 1) 93 | git (>= 1.2.5) 94 | github_api (~> 0.16.0) 95 | highline (>= 1.6.15) 96 | nokogiri (>= 1.5.10) 97 | psych (~> 2.2) 98 | rake 99 | rdoc 100 | semver2 101 | json (2.1.0) 102 | jwt (1.5.6) 103 | launchy (2.4.3) 104 | addressable (~> 2.3) 105 | loofah (2.0.3) 106 | nokogiri (>= 1.5.9) 107 | mail (2.6.6) 108 | mime-types (>= 1.16, < 4) 109 | mime-types (2.99.3) 110 | mini_portile2 (2.2.0) 111 | minitest (5.10.3) 112 | multi_json (1.12.1) 113 | multi_xml (0.6.0) 114 | multipart-post (2.0.0) 115 | nokogiri (1.8.0) 116 | mini_portile2 (~> 2.2.0) 117 | oauth2 (1.4.0) 118 | faraday (>= 0.8, < 0.13) 119 | jwt (~> 1.0) 120 | multi_json (~> 1.3) 121 | multi_xml (~> 0.5) 122 | rack (>= 1.2, < 3) 123 | psych (2.2.4) 124 | puts_debuggerer (0.7.1) 125 | awesome_print (~> 1.8.0) 126 | rack (1.6.8) 127 | rack-test (0.6.3) 128 | rack (>= 1.0) 129 | rails (4.2.9) 130 | actionmailer (= 4.2.9) 131 | actionpack (= 4.2.9) 132 | actionview (= 4.2.9) 133 | activejob (= 4.2.9) 134 | activemodel (= 4.2.9) 135 | activerecord (= 4.2.9) 136 | activesupport (= 4.2.9) 137 | bundler (>= 1.3.0, < 2.0) 138 | railties (= 4.2.9) 139 | sprockets-rails 140 | rails-deprecated_sanitizer (1.0.3) 141 | activesupport (>= 4.2.0.alpha) 142 | rails-dom-testing (1.0.8) 143 | activesupport (>= 4.2.0.beta, < 5.0) 144 | nokogiri (~> 1.6) 145 | rails-deprecated_sanitizer (>= 1.0.1) 146 | rails-html-sanitizer (1.0.3) 147 | loofah (~> 2.0) 148 | railties (4.2.9) 149 | actionpack (= 4.2.9) 150 | activesupport (= 4.2.9) 151 | rake (>= 0.8.7) 152 | thor (>= 0.18.1, < 2.0) 153 | rake (12.0.0) 154 | rb-fsevent (0.10.2) 155 | rb-inotify (0.9.10) 156 | ffi (>= 0.5.0, < 2) 157 | rdoc (5.1.0) 158 | rspec-core (3.6.0) 159 | rspec-support (~> 3.6.0) 160 | rspec-expectations (3.6.0) 161 | diff-lcs (>= 1.2.0, < 2.0) 162 | rspec-support (~> 3.6.0) 163 | rspec-mocks (3.6.0) 164 | diff-lcs (>= 1.2.0, < 2.0) 165 | rspec-support (~> 3.6.0) 166 | rspec-rails (3.6.0) 167 | actionpack (>= 3.0) 168 | activesupport (>= 3.0) 169 | railties (>= 3.0) 170 | rspec-core (~> 3.6.0) 171 | rspec-expectations (~> 3.6.0) 172 | rspec-mocks (~> 3.6.0) 173 | rspec-support (~> 3.6.0) 174 | rspec-support (3.6.0) 175 | sass (3.5.1) 176 | sass-listen (~> 4.0.0) 177 | sass-listen (4.0.0) 178 | rb-fsevent (~> 0.9, >= 0.9.4) 179 | rb-inotify (~> 0.9, >= 0.9.7) 180 | sass-rails (5.0.6) 181 | railties (>= 4.0.0, < 6) 182 | sass (~> 3.1) 183 | sprockets (>= 2.8, < 4.0) 184 | sprockets-rails (>= 2.0, < 4.0) 185 | tilt (>= 1.1, < 3) 186 | semver2 (3.4.2) 187 | simplecov (0.14.1) 188 | docile (~> 1.1.0) 189 | json (>= 1.8, < 3) 190 | simplecov-html (~> 0.10.0) 191 | simplecov-html (0.10.1) 192 | sprockets (3.7.1) 193 | concurrent-ruby (~> 1.0) 194 | rack (> 1, < 3) 195 | sprockets-rails (3.2.0) 196 | actionpack (>= 4.0) 197 | activesupport (>= 4.0) 198 | sprockets (>= 3.0.0) 199 | sqlite3 (1.3.13) 200 | term-ansicolor (1.6.0) 201 | tins (~> 1.0) 202 | thor (0.19.4) 203 | thread_safe (0.3.6) 204 | tilt (2.0.8) 205 | tins (1.15.0) 206 | tzinfo (1.2.3) 207 | thread_safe (~> 0.1) 208 | xpath (2.1.0) 209 | nokogiri (~> 1.3) 210 | 211 | PLATFORMS 212 | ruby 213 | 214 | DEPENDENCIES 215 | capybara 216 | coffee-rails (~> 4.1.0) 217 | coveralls 218 | jeweler (~> 2.3.7) 219 | launchy 220 | puts_debuggerer (~> 0.7.1) 221 | rails (~> 4.2.9) 222 | rspec-rails (~> 3.6.0) 223 | sass-rails (~> 5.0) 224 | sqlite3 225 | ultra_light_wizard! 226 | 227 | BUNDLED WITH 228 | 1.15.3 229 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Andy Maleh 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Ultra Light Wizard v0.1.4 (beta) 2 | ================================ 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 multi-step form architectural pattern in Rails. 5 | 6 | ![Ultra Light Wizard Image](https://cdn.rawgit.com/AndyObtiva/ultra_light_wizard/master/ultra_light_wizard.jpg) 7 | 8 | This RailsConf 2014 talk video explains it all: 9 | https://www.youtube.com/watch?v=muyfoiKHMMA 10 | 11 | And, this blog summarizes it: 12 | https://andymaleh.blogspot.com/2013/10/ultra-light-maintainable-wizards-in.html 13 | 14 | Principles 15 | ========== 16 | 17 | - REST: wizard (multi-step form) steps are represented as REST nested resources under the model resource being built 18 | - MVC: respects MVC separation of concerns 19 | - OO: honors OO principles of low coupling and high cohesion 20 | - Design Patterns: wizard (multi-step form) is simply a model Builder 21 | - DDD: supports domain concepts directly with customizable vocabulary 22 | - Non-Functional Requirements: 23 | - Productivity: minimum effort for adding wizards (multi-step forms) and wizard steps 24 | - Maintainability: minimum code to maintain while adhering to other principles 25 | - Performance: stateless design means scalability 26 | - Security: stateless design is compatible with Rails security measures 27 | 28 | Details 29 | ======= 30 | 31 | To learn more about the Ultra Light Wizard architectural pattern philosophy and function, please read this blog post: [Ultra Light & Maintainable Wizard in Rails](https://andymaleh.blogspot.com/2013/10/ultra-light-maintainable-wizards-in.html) 32 | 33 | **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 (or an Ultra Light Wizard compatible gem like [Wicked](https://rubygems.org/gems/wicked)) to get started quickly via Rails scaffolding for new project models or otherwise avoid by applying pattern manually for existing project models. 34 | 35 | ![Ultra Light Wizard Step Breadcrumb](https://cdn.rawgit.com/AndyObtiva/ultra_light_wizard/master/ultra_light_wizard_step_breadcrumb.png) 36 | 37 | 38 | Instructions 39 | ============ 40 | 41 | Add the following to your Rails project ```Gemfile```: 42 | 43 | ``` 44 | gem 'ultra_light_wizard', '~> 0.1.4' 45 | ``` 46 | 47 | Run the command: 48 | 49 | ``` 50 | bundle 51 | ``` 52 | 53 | Then, use the following command in place of the Rails scaffold generator, and it will scaffold both standard resource components and wizard-related components: 54 | 55 | ``` 56 | rails generate ultra_light_wizard:scaffold (resource) steps:(step1),(step2),(step3),... attributes:(attribute1:db_type1),(attribute2:db_type2),... 57 | ``` 58 | 59 | This will generate wizard (multi-step form) step routes, controller, models, and views 60 | 61 | Example: 62 | 63 | ``` 64 | rails generate ultra_light_wizard:scaffold Project steps:basic_info,project_detail,file_uploads,preview attributes:name:string,description:text,start_date:date,delivery_date:date 65 | ``` 66 | 67 | Output: 68 | 69 | ``` 70 | generate scaffold 71 | invoke active_record 72 | create db/migrate/20160201025849_create_projects.rb 73 | create app/models/project.rb 74 | invoke test_unit 75 | create test/models/project_test.rb 76 | create test/fixtures/projects.yml 77 | invoke resource_route 78 | route resources :projects 79 | invoke scaffold_controller 80 | create app/controllers/projects_controller.rb 81 | invoke erb 82 | create app/views/projects 83 | create app/views/projects/index.html.erb 84 | create app/views/projects/edit.html.erb 85 | create app/views/projects/show.html.erb 86 | create app/views/projects/new.html.erb 87 | create app/views/projects/_form.html.erb 88 | invoke test_unit 89 | create test/controllers/projects_controller_test.rb 90 | invoke helper 91 | create app/helpers/projects_helper.rb 92 | invoke test_unit 93 | invoke jbuilder 94 | create app/views/projects/index.json.jbuilder 95 | create app/views/projects/show.json.jbuilder 96 | invoke assets 97 | invoke coffee 98 | create app/assets/javascripts/projects.coffee 99 | invoke scss 100 | create app/assets/stylesheets/projects.scss 101 | invoke scss 102 | identical app/assets/stylesheets/scaffolds.scss 103 | gsub app/controllers/projects_controller.rb 104 | gsub app/controllers/projects_controller.rb 105 | insert app/controllers/projects_controller.rb 106 | gsub app/views/projects/index.html.erb 107 | create app/controllers/project_steps_controller.rb 108 | create app/helpers/project_steps_helper.rb 109 | create app/views/project_steps/_step_navigation.html.erb 110 | create app/models/project/name.rb 111 | create app/views/project_steps/name.html.erb 112 | create app/models/project/description.rb 113 | create app/views/project_steps/description.html.erb 114 | create app/models/project/start_date.rb 115 | create app/views/project_steps/start_date.html.erb 116 | create app/models/project/delivery_date.rb 117 | create app/views/project_steps/delivery_date.html.erb 118 | create app/models/project/preview.rb 119 | create app/views/project_steps/preview.html.erb 120 | route resources :projects, only: [:create, :show] do 121 | resources :project_steps, only: [:edit, :update] 122 | end 123 | ``` 124 | 125 | Once the files are generated, you can proceed to place your own code customizations in the wizard step models and views. 126 | 127 | To kick-off wizard, simply trigger the main model controller create action, and it will transition to the wizard step first step edit action. 128 | 129 | For example, the following will kick-off the project wizard by creating a project and automatically redirecting to first step: 130 | 131 | ``` 132 | <%= link_to 'New Project', projects_path, method: :post %> 133 | ``` 134 | 135 | If you'd like to customize the term "step", you can add a step_alias:(alias) option as in the following: 136 | 137 | Example: 138 | 139 | ``` 140 | rails generate ultra_light_wizard:scaffold Project step_alias:part steps:basic_info,project_detail,file_uploads,preview attributes:name:string,description:text,start_date:date,delivery_date:date 141 | ``` 142 | 143 | Output: 144 | 145 | ``` 146 | generate scaffold 147 | invoke active_record 148 | create db/migrate/20160201025849_create_projects.rb 149 | create app/models/project.rb 150 | invoke test_unit 151 | create test/models/project_test.rb 152 | create test/fixtures/projects.yml 153 | invoke resource_route 154 | route resources :projects 155 | invoke scaffold_controller 156 | create app/controllers/projects_controller.rb 157 | invoke erb 158 | create app/views/projects 159 | create app/views/projects/index.html.erb 160 | create app/views/projects/edit.html.erb 161 | create app/views/projects/show.html.erb 162 | create app/views/projects/new.html.erb 163 | create app/views/projects/_form.html.erb 164 | invoke test_unit 165 | create test/controllers/projects_controller_test.rb 166 | invoke helper 167 | create app/helpers/projects_helper.rb 168 | invoke test_unit 169 | invoke jbuilder 170 | create app/views/projects/index.json.jbuilder 171 | create app/views/projects/show.json.jbuilder 172 | invoke assets 173 | invoke coffee 174 | create app/assets/javascripts/projects.coffee 175 | invoke scss 176 | create app/assets/stylesheets/projects.scss 177 | invoke scss 178 | identical app/assets/stylesheets/scaffolds.scss 179 | gsub app/controllers/projects_controller.rb 180 | gsub app/controllers/projects_controller.rb 181 | insert app/controllers/projects_controller.rb 182 | gsub app/views/projects/index.html.erb 183 | create app/controllers/project_parts_controller.rb 184 | create app/helpers/project_parts_helper.rb 185 | create app/views/project_parts/_part_navigation.html.erb 186 | create app/models/project/name.rb 187 | create app/views/project_parts/name.html.erb 188 | create app/models/project/description.rb 189 | create app/views/project_parts/description.html.erb 190 | create app/models/project/start_date.rb 191 | create app/views/project_parts/start_date.html.erb 192 | create app/models/project/delivery_date.rb 193 | create app/views/project_parts/delivery_date.html.erb 194 | create app/models/project/preview.rb 195 | create app/views/project_parts/preview.html.erb 196 | route resources :projects, only: [:create, :show] do 197 | resources :project_parts, only: [:edit, :update] 198 | end 199 | ``` 200 | 201 | Features 202 | ======== 203 | 204 | - Ultra Light Wizard scaffold generator 205 | + Scaffolding of main model controller/views/migration 206 | + Routes 207 | + Controller steps 208 | + Model parts 209 | + View parts 210 | + View navigation 211 | + Helper for ultra light wizard support 212 | + Route helper methods 213 | + Wizard kick-off helper/view 214 | + Forms 215 | + Support for attributes 216 | + Form fields 217 | + Custom name conventions 218 | + Wizard step breadcrumb with easily stylable semantic markup 219 | - [UPCOMING] JS Ajax support 220 | 221 | Enhancements 222 | ============ 223 | 224 | 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. 225 | 226 | History 227 | ======= 228 | 229 | v0.1.4 Step breadcrumb, having easily customizable semantic markup 230 | v0.1.3 test coverage with feature specs / fixed issue 4 Generate routes in the right order 231 | v0.1.2 ensure resource creation redirects to first step / include step helper in resource controller 232 | v0.1.1 includes permitted params and edit/update actions 233 | v0.1.0 initial implementation 234 | 235 | License 236 | ======= 237 | 238 | MIT 239 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require 'rubygems' 4 | require 'bundler' 5 | begin 6 | Bundler.setup(:default, :development) 7 | rescue Bundler::BundlerError => e 8 | $stderr.puts e.message 9 | $stderr.puts "Run `bundle install` to install missing gems" 10 | exit e.status_code 11 | end 12 | require 'rake' 13 | 14 | require 'jeweler' 15 | Jeweler::Tasks.new do |gem| 16 | # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options 17 | gem.name = "ultra_light_wizard" 18 | gem.homepage = "http://github.com/AndyObtiva/ultra_light_wizard" 19 | gem.license = "MIT" 20 | gem.summary = %Q{Ultra Light & Maintainable Wizards In Rails} 21 | gem.description = %Q{Ultra light & maintainble wizards in Rails that honor REST, MVC, and OO with minimal writing of code involved and maximum flexibility} 22 | gem.email = "andy.am@gmail.com" 23 | gem.authors = ["Andy Maleh"] 24 | # dependencies defined in Gemfile 25 | end 26 | Jeweler::RubygemsDotOrgTasks.new 27 | 28 | require 'rspec/core/rake_task' 29 | 30 | RSpec::Core::RakeTask.new(:spec) do |spec| 31 | spec.pattern = FileList['spec/lib/**/*_spec.rb'] 32 | end 33 | 34 | task :default => :spec 35 | 36 | require 'rdoc/task' 37 | Rake::RDocTask.new do |rdoc| 38 | version = File.exist?('VERSION') ? File.read('VERSION') : "" 39 | 40 | rdoc.rdoc_dir = 'rdoc' 41 | rdoc.title = "ultra_light_wizard #{version}" 42 | rdoc.rdoc_files.include('README*') 43 | rdoc.rdoc_files.include('lib/**/*.rb') 44 | end 45 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.1.4 2 | -------------------------------------------------------------------------------- /lib/generators/templates/app/assets/stylesheets/wizard_steps.scss: -------------------------------------------------------------------------------- 1 | .step_breadcrumbs { 2 | .step_breadcrumb { 3 | display: inline-block; 4 | border-radius: 5px; 5 | border: 1px black solid; 6 | background-color: lightgrey; 7 | text-align: center; 8 | padding: 5px 10px; 9 | text-decoration: underline; 10 | 11 | &.selected_step { 12 | background-color: white; 13 | color: black; 14 | text-decoration: none; 15 | 16 | .step_number { 17 | background-color: black; 18 | } 19 | } 20 | 21 | .step_number { 22 | display: block; 23 | border-radius: 18px; 24 | width: 18px; 25 | margin-left: auto; 26 | margin-right: auto; 27 | color: white; 28 | background-color: grey; 29 | } 30 | .step_name { 31 | display: block; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/generators/templates/app/controllers/wizard_steps_controller.rb.erb: -------------------------------------------------------------------------------- 1 | class <%= class_name %><%= step_alias.pluralize.camelize %>Controller < ApplicationController 2 | include <%= class_name %><%= step_alias.pluralize.camelize %>Helper 3 | helper <%= class_name %><%= step_alias.pluralize.camelize %>Helper 4 | before_action :load_<%= file_path %> 5 | 6 | def edit 7 | if <%= file_path %>_<%= step_alias %>_model.editable? 8 | if <%= step_alias %>.present? 9 | render <%= step_alias %> 10 | else 11 | render "#{Rails.root.to_s}/public/404.html", :layout => false, :status => 404 12 | end 13 | else 14 | redirect_to :back, :alert => I18n.t("<%= file_path %>.#{@<%= file_path %>.status}_editable_error") 15 | end 16 | end 17 | 18 | def update 19 | if <%= file_path %>_<%= step_alias %>_model.update_attributes(<%= file_path %>_params || {}) 20 | if next_<%= step_alias %> && params[:commit].downcase.include?('next') 21 | redirect_to edit_<%= file_path %>_<%= file_path %>_<%= step_alias %>_path(<%= file_path %>_<%= step_alias %>_model, next_<%= step_alias %>) 22 | else 23 | redirect_to <%= file_path %>_path(@<%= file_path %>) 24 | end 25 | else 26 | render <%= step_alias %>, :error => "Please complete all required fields" 27 | end 28 | end 29 | 30 | private 31 | 32 | def load_<%= file_path %> 33 | @<%= file_path %> = <%= file_path %>_<%= step_alias %>_model 34 | end 35 | 36 | def <%= file_path %>_params 37 | params.require(:<%= file_path %>).permit(<%= controller_attribute_names %>) 38 | end 39 | 40 | end 41 | -------------------------------------------------------------------------------- /lib/generators/templates/app/helpers/wizard_steps_helper.rb.erb: -------------------------------------------------------------------------------- 1 | module <%= class_name %><%= step_alias.pluralize.camelize %>Helper 2 | <%= step_alias.pluralize.upcase %> = %w(<%= steps.to_a.join(' ') %>) 3 | 4 | def <%= file_path %>_<%= step_alias %>_model 5 | <%= file_path %>_class = "<%= class_name %>::#{<%= step_alias %>.camelcase}".constantize rescue <%= class_name %> 6 | @<%= file_path %> ||= <%= file_path %>_class.find(params[:<%= file_path %>_id]) 7 | end 8 | 9 | def <%= step_alias %> 10 | # Filter for security reasons 11 | @<%= step_alias %> ||= <%= step_alias.pluralize.upcase %>.find {|a_<%= step_alias %>| a_<%= step_alias %> == params[:id].to_s.downcase} 12 | end 13 | alias current_<%= step_alias %> <%= step_alias %> 14 | 15 | def previous_<%= step_alias %> 16 | current_<%= step_alias %>_index = <%= step_alias.pluralize.upcase %>.index(<%= step_alias %>) 17 | previous_<%= step_alias %>_index = current_<%= step_alias %>_index-1 18 | previous_<%= step_alias %>_index < 0 ? nil : <%= step_alias.pluralize.upcase %>[previous_<%= step_alias %>_index] 19 | end 20 | 21 | def next_<%= step_alias %> 22 | current_<%= step_alias %>_index = <%= step_alias.pluralize.upcase %>.index(<%= step_alias %>) 23 | <%= step_alias.pluralize.upcase %>[current_<%= step_alias %>_index+1] 24 | end 25 | 26 | <% %w(path url).each do |route_term| %> 27 | <% ["edit_", ""].each do |action_prefix| %> 28 | def <%= action_prefix %>first_<%= step_alias %>_<%= route_term %> 29 | <%= action_prefix %><%= file_path %>_<%= step_alias %>_model_<%= route_term %>(<%= step_alias.pluralize.upcase %>.first) 30 | end 31 | 32 | def <%= action_prefix %>previous_<%= step_alias %>_<%= route_term %> 33 | <%= action_prefix %><%= file_path %>_<%= step_alias %>_model_<%= route_term %>(previous_<%= step_alias %>) 34 | end 35 | 36 | def <%= action_prefix %>next_<%= step_alias %>_<%= route_term %> 37 | <%= action_prefix %><%= file_path %>_<%= step_alias %>_model_<%= route_term %>(next_<%= step_alias %>) 38 | end 39 | 40 | def <%= action_prefix %>last_<%= step_alias %>_<%= route_term %> 41 | <%= action_prefix %><%= file_path %>_<%= step_alias %>_model_<%= route_term %>(<%= step_alias.pluralize.upcase %>.last) 42 | end 43 | 44 | def <%= action_prefix %>current_<%= step_alias %>_<%= route_term %> 45 | <%= action_prefix %><%= file_path %>_<%= step_alias %>_model_<%= route_term %>(<%= step_alias %>) 46 | end 47 | 48 | def <%= action_prefix %><%= file_path %>_<%= step_alias %>_model_<%= route_term %>(<%= step_alias %>) 49 | <%= action_prefix %><%= file_path %>_<%= file_path %>_<%= step_alias %>_<%= route_term %>(<%= file_path %>_<%= step_alias %>_model, <%= step_alias %>) 50 | end 51 | <% end %> 52 | <% end %> 53 | end 54 | -------------------------------------------------------------------------------- /lib/generators/templates/app/models/wizard_step_model.rb.erb: -------------------------------------------------------------------------------- 1 | class <%= class_name %>::<%= @wizard_step.camelize %> < <%= class_name %> 2 | # Include step validations here 3 | 4 | # Include step after_initialize attribute default settings here 5 | 6 | # Include step after_save changes here 7 | 8 | def editable? 9 | true 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/generators/templates/app/views/wizard_step_breadcrumb_view.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%% <%= file_path.camelize %><%= step_alias.pluralize.camelize %>Helper::STEPS.each_with_index do |breadcrumb_step, index| %> 3 | <%%= link_to edit_<%= file_path %>_<%= step_alias %>_model_path(breadcrumb_step), class: "step_breadcrumb #{"selected_step" if breadcrumb_step == current_step}" do %> 4 |
<%%= step_number = index + 1 %>
5 |
<%%= breadcrumb_step.humanize %>
6 | <%% end %> 7 | <%% end %> 8 |
9 | -------------------------------------------------------------------------------- /lib/generators/templates/app/views/wizard_step_navigation_view.html.erb: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /lib/generators/templates/app/views/wizard_step_view.html.erb: -------------------------------------------------------------------------------- 1 |

<%= file_path.humanize %> wizard

2 | <%%= render '<%= step_alias %>_breadcrumb' %> 3 |

<%= step_alias.titleize %>: <%= @wizard_step.humanize %>

4 | <%%= form_for <%= file_path %>_<%= step_alias %>_model, :url => current_<%= step_alias %>_path, :as => :<%= file_path %> do |f| %> 5 | <%%# TODO limit to fields of this particular step %> 6 | <%= form_content(true) %> 7 | <%%= render '<%= step_alias %>_navigation', f: f %> 8 | <%% end %> 9 | -------------------------------------------------------------------------------- /lib/generators/ultra_light_wizard/scaffold_generator.rb: -------------------------------------------------------------------------------- 1 | module UltraLightWizard 2 | module Generators 3 | class ScaffoldGenerator < Rails::Generators::NamedBase 4 | source_root File.expand_path("../../templates", __FILE__) 5 | def arguments 6 | args.inject({}) do |output, arg| 7 | # Accommodate argument values containing colon by matching against 8 | # occurance of it only 9 | arg_parts = arg.match(/^([^:]+)\:(.+)$/) 10 | output.merge(arg_parts[1] => arg_parts[2]) 11 | end 12 | end 13 | 14 | def step_alias 15 | arguments['step_alias'] || 'step' 16 | end 17 | 18 | def steps 19 | arguments['steps'].to_s.split(',').map(&:strip) 20 | end 21 | 22 | def controller_class_name 23 | "#{class_name.pluralize}Controller" 24 | end 25 | 26 | def index_helper 27 | file_path.pluralize 28 | end 29 | 30 | def model_attributes 31 | arguments['attributes'] 32 | end 33 | 34 | def hashed_model_attributes 35 | model_attributes.split(',').inject({}) do |output, pair| 36 | split_pair = pair.split(':') 37 | output.merge(split_pair.first => split_pair.last) 38 | end 39 | end 40 | 41 | def attributes_names 42 | hashed_model_attributes.keys 43 | end 44 | 45 | def scaffold_attributes 46 | model_attributes.gsub(',', ' ') 47 | end 48 | 49 | def controller_attribute_names 50 | hashed_model_attributes.keys.map {|key| "\"#{key}\""}.join(', ') 51 | end 52 | 53 | def human_name 54 | file_path.humanize 55 | end 56 | 57 | def plural_table_name 58 | file_path.pluralize 59 | end 60 | 61 | def arg_options 62 | options.select {|key, value| value}.map {|key, value| "--#{key}"}.join(' ') 63 | end 64 | 65 | def form_content(execute=false) 66 | if execute #prevents thor from executing too early 67 | @form_content ||= lambda { 68 | # TODO support formats other than html.erb like html.haml (autodetect) 69 | scaffold_form_lines = File.new(Rails.root.join('app', 'views', plural_table_name, '_form.html.erb')).readlines 70 | form_start_index = scaffold_form_lines.find_index {|line| line.include?('form')} 71 | form_end_index = scaffold_form_lines.length - 1 - scaffold_form_lines.reverse.find_index {|line| line.include?('actions')} 72 | form_content_start_index = form_start_index + 1 73 | form_content_end_index = form_end_index - 1 74 | extracted_form_lines = scaffold_form_lines[form_content_start_index..form_content_end_index] 75 | extracted_form_lines.join 76 | }.() 77 | end 78 | end 79 | 80 | desc "Creates a configuration file for a specific application context (e.g. admin). Takes context path as argument (e.g. admin or internal/wiki) to create config/features/[context_path].yml" 81 | def copy_config 82 | generate "scaffold", "#{file_path} #{scaffold_attributes} #{arg_options}" 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 91 | gsub_file "app/controllers/#{file_path.pluralize}_controller.rb", 92 | "@#{singular_table_name}.save\n", 93 | "@#{singular_table_name}.save(validation: false)\n" 94 | gsub_file "app/controllers/#{file_path.pluralize}_controller.rb", 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)" 97 | inject_into_file "app/controllers/#{file_path.pluralize}_controller.rb", 98 | after: "def #{singular_table_name}_params\n" do 99 | " return {} unless params[:#{singular_table_name}].present?\n" 100 | end 101 | gsub_file "app/views/#{file_path.pluralize}/index.html.erb", 102 | "new_#{singular_table_name}_path", 103 | "#{file_path.pluralize}_path, method: :post" 104 | template "app/controllers/wizard_steps_controller.rb.erb", "app/controllers/#{file_path}_#{step_alias.pluralize}_controller.rb" 105 | template "app/helpers/wizard_steps_helper.rb.erb", "app/helpers/#{file_path}_#{step_alias.pluralize}_helper.rb" 106 | template "app/views/wizard_step_navigation_view.html.erb", "app/views/#{file_path}_#{step_alias.pluralize}/_#{step_alias}_navigation.html.erb" 107 | template "app/views/wizard_step_breadcrumb_view.html.erb", "app/views/#{file_path}_#{step_alias.pluralize}/_#{step_alias}_breadcrumb.html.erb" 108 | template "app/assets/stylesheets/wizard_steps.scss", "app/assets/stylesheets/#{file_path}_#{step_alias.pluralize}.scss" 109 | steps.each do |step| 110 | @wizard_step = step 111 | template "app/models/wizard_step_model.rb.erb", "app/models/#{file_path}/#{step}.rb" 112 | template "app/views/wizard_step_view.html.erb", "app/views/#{file_path}_#{step_alias.pluralize}/#{step}.html.erb" 113 | end 114 | wizard_route_content = <<-CONTENT 115 | resources :#{plural_file_name} do 116 | resources :#{file_path}_#{step_alias.pluralize}, only: [:edit, :update] 117 | end 118 | CONTENT 119 | route_file = Rails.root.join('config', 'routes.rb') 120 | routes_content = File.new(route_file).read 121 | main_route = "resources :#{plural_file_name}\n" 122 | if routes_content.include?(main_route) 123 | # replace existing route 124 | gsub_file "config/routes.rb", 125 | main_route, 126 | wizard_route_content 127 | else 128 | # avoid messing with existing route if already has a do end block open 129 | route wizard_route_content 130 | end 131 | end 132 | end 133 | end 134 | end 135 | -------------------------------------------------------------------------------- /lib/ultra_light_wizard.rb: -------------------------------------------------------------------------------- 1 | module UltraLightWizard 2 | end 3 | -------------------------------------------------------------------------------- /ruby187.Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | group :development do 4 | gem 'jeweler' 5 | end 6 | 7 | group :test do 8 | gem 'rspec' 9 | end 10 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | !/log/.keep 17 | /tmp 18 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | 4 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5 | gem 'rails', '4.2.9' 6 | # Use sqlite3 as the database for Active Record 7 | gem 'sqlite3' 8 | # Use SCSS for stylesheets 9 | gem 'sass-rails', '~> 5.0' 10 | # Use Uglifier as compressor for JavaScript assets 11 | gem 'uglifier', '>= 1.3.0' 12 | # Use CoffeeScript for .coffee assets and views 13 | gem 'coffee-rails', '~> 4.1.0' 14 | # See https://github.com/rails/execjs#readme for more supported runtimes 15 | # gem 'therubyracer', platforms: :ruby 16 | 17 | # Use jquery as the JavaScript library 18 | gem 'jquery-rails' 19 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 20 | gem 'turbolinks' 21 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 22 | gem 'jbuilder', '~> 2.0' 23 | # bundle exec rake doc:rails generates the API under doc/api. 24 | gem 'sdoc', '~> 0.4.0', group: :doc 25 | 26 | gem 'ultra_light_wizard', path: '../../..' #used in specs 27 | 28 | # Use ActiveModel has_secure_password 29 | # gem 'bcrypt', '~> 3.1.7' 30 | 31 | # Use Unicorn as the app server 32 | # gem 'unicorn' 33 | 34 | # Use Capistrano for deployment 35 | # gem 'capistrano-rails', group: :development 36 | 37 | group :development, :test do 38 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console 39 | gem 'byebug' 40 | gem 'rspec-rails', '~> 3.6.0' 41 | gem 'capybara' 42 | gem 'launchy' 43 | end 44 | 45 | group :development do 46 | # Access an IRB console on exception pages or by using <%= console %> in views 47 | gem 'web-console', '~> 2.0' 48 | 49 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 50 | gem 'spring' 51 | end 52 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: ../../.. 3 | specs: 4 | ultra_light_wizard (0.1.4) 5 | 6 | GEM 7 | remote: https://rubygems.org/ 8 | specs: 9 | actionmailer (4.2.9) 10 | actionpack (= 4.2.9) 11 | actionview (= 4.2.9) 12 | activejob (= 4.2.9) 13 | mail (~> 2.5, >= 2.5.4) 14 | rails-dom-testing (~> 1.0, >= 1.0.5) 15 | actionpack (4.2.9) 16 | actionview (= 4.2.9) 17 | activesupport (= 4.2.9) 18 | rack (~> 1.6) 19 | rack-test (~> 0.6.2) 20 | rails-dom-testing (~> 1.0, >= 1.0.5) 21 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 22 | actionview (4.2.9) 23 | activesupport (= 4.2.9) 24 | builder (~> 3.1) 25 | erubis (~> 2.7.0) 26 | rails-dom-testing (~> 1.0, >= 1.0.5) 27 | rails-html-sanitizer (~> 1.0, >= 1.0.3) 28 | activejob (4.2.9) 29 | activesupport (= 4.2.9) 30 | globalid (>= 0.3.0) 31 | activemodel (4.2.9) 32 | activesupport (= 4.2.9) 33 | builder (~> 3.1) 34 | activerecord (4.2.9) 35 | activemodel (= 4.2.9) 36 | activesupport (= 4.2.9) 37 | arel (~> 6.0) 38 | activesupport (4.2.9) 39 | i18n (~> 0.7) 40 | minitest (~> 5.1) 41 | thread_safe (~> 0.3, >= 0.3.4) 42 | tzinfo (~> 1.1) 43 | addressable (2.5.1) 44 | public_suffix (~> 2.0, >= 2.0.2) 45 | arel (6.0.4) 46 | binding_of_caller (0.7.2) 47 | debug_inspector (>= 0.0.1) 48 | builder (3.2.3) 49 | byebug (9.0.6) 50 | capybara (2.14.4) 51 | addressable 52 | mime-types (>= 1.16) 53 | nokogiri (>= 1.3.3) 54 | rack (>= 1.0.0) 55 | rack-test (>= 0.5.4) 56 | xpath (~> 2.0) 57 | coffee-rails (4.1.1) 58 | coffee-script (>= 2.2.0) 59 | railties (>= 4.0.0, < 5.1.x) 60 | coffee-script (2.4.1) 61 | coffee-script-source 62 | execjs 63 | coffee-script-source (1.12.2) 64 | concurrent-ruby (1.0.5) 65 | debug_inspector (0.0.3) 66 | diff-lcs (1.3) 67 | erubis (2.7.0) 68 | execjs (2.7.0) 69 | ffi (1.9.18) 70 | globalid (0.4.0) 71 | activesupport (>= 4.2.0) 72 | i18n (0.8.6) 73 | jbuilder (2.7.0) 74 | activesupport (>= 4.2.0) 75 | multi_json (>= 1.2) 76 | jquery-rails (4.3.1) 77 | rails-dom-testing (>= 1, < 3) 78 | railties (>= 4.2.0) 79 | thor (>= 0.14, < 2.0) 80 | json (1.8.6) 81 | launchy (2.4.3) 82 | addressable (~> 2.3) 83 | loofah (2.0.3) 84 | nokogiri (>= 1.5.9) 85 | mail (2.6.6) 86 | mime-types (>= 1.16, < 4) 87 | mime-types (3.1) 88 | mime-types-data (~> 3.2015) 89 | mime-types-data (3.2016.0521) 90 | mini_portile2 (2.2.0) 91 | minitest (5.10.3) 92 | multi_json (1.12.1) 93 | nokogiri (1.8.0) 94 | mini_portile2 (~> 2.2.0) 95 | public_suffix (2.0.5) 96 | rack (1.6.8) 97 | rack-test (0.6.3) 98 | rack (>= 1.0) 99 | rails (4.2.9) 100 | actionmailer (= 4.2.9) 101 | actionpack (= 4.2.9) 102 | actionview (= 4.2.9) 103 | activejob (= 4.2.9) 104 | activemodel (= 4.2.9) 105 | activerecord (= 4.2.9) 106 | activesupport (= 4.2.9) 107 | bundler (>= 1.3.0, < 2.0) 108 | railties (= 4.2.9) 109 | sprockets-rails 110 | rails-deprecated_sanitizer (1.0.3) 111 | activesupport (>= 4.2.0.alpha) 112 | rails-dom-testing (1.0.8) 113 | activesupport (>= 4.2.0.beta, < 5.0) 114 | nokogiri (~> 1.6) 115 | rails-deprecated_sanitizer (>= 1.0.1) 116 | rails-html-sanitizer (1.0.3) 117 | loofah (~> 2.0) 118 | railties (4.2.9) 119 | actionpack (= 4.2.9) 120 | activesupport (= 4.2.9) 121 | rake (>= 0.8.7) 122 | thor (>= 0.18.1, < 2.0) 123 | rake (12.0.0) 124 | rb-fsevent (0.10.2) 125 | rb-inotify (0.9.10) 126 | ffi (>= 0.5.0, < 2) 127 | rdoc (4.3.0) 128 | rspec-core (3.6.0) 129 | rspec-support (~> 3.6.0) 130 | rspec-expectations (3.6.0) 131 | diff-lcs (>= 1.2.0, < 2.0) 132 | rspec-support (~> 3.6.0) 133 | rspec-mocks (3.6.0) 134 | diff-lcs (>= 1.2.0, < 2.0) 135 | rspec-support (~> 3.6.0) 136 | rspec-rails (3.6.0) 137 | actionpack (>= 3.0) 138 | activesupport (>= 3.0) 139 | railties (>= 3.0) 140 | rspec-core (~> 3.6.0) 141 | rspec-expectations (~> 3.6.0) 142 | rspec-mocks (~> 3.6.0) 143 | rspec-support (~> 3.6.0) 144 | rspec-support (3.6.0) 145 | sass (3.5.1) 146 | sass-listen (~> 4.0.0) 147 | sass-listen (4.0.0) 148 | rb-fsevent (~> 0.9, >= 0.9.4) 149 | rb-inotify (~> 0.9, >= 0.9.7) 150 | sass-rails (5.0.6) 151 | railties (>= 4.0.0, < 6) 152 | sass (~> 3.1) 153 | sprockets (>= 2.8, < 4.0) 154 | sprockets-rails (>= 2.0, < 4.0) 155 | tilt (>= 1.1, < 3) 156 | sdoc (0.4.2) 157 | json (~> 1.7, >= 1.7.7) 158 | rdoc (~> 4.0) 159 | spring (2.0.2) 160 | activesupport (>= 4.2) 161 | sprockets (3.7.1) 162 | concurrent-ruby (~> 1.0) 163 | rack (> 1, < 3) 164 | sprockets-rails (3.2.0) 165 | actionpack (>= 4.0) 166 | activesupport (>= 4.0) 167 | sprockets (>= 3.0.0) 168 | sqlite3 (1.3.13) 169 | thor (0.19.4) 170 | thread_safe (0.3.6) 171 | tilt (2.0.8) 172 | turbolinks (5.0.1) 173 | turbolinks-source (~> 5) 174 | turbolinks-source (5.0.3) 175 | tzinfo (1.2.3) 176 | thread_safe (~> 0.1) 177 | uglifier (3.2.0) 178 | execjs (>= 0.3.0, < 3) 179 | web-console (2.3.0) 180 | activemodel (>= 4.0) 181 | binding_of_caller (>= 0.7.2) 182 | railties (>= 4.0) 183 | sprockets-rails (>= 2.0, < 4.0) 184 | xpath (2.1.0) 185 | nokogiri (~> 1.3) 186 | 187 | PLATFORMS 188 | ruby 189 | 190 | DEPENDENCIES 191 | byebug 192 | capybara 193 | coffee-rails (~> 4.1.0) 194 | jbuilder (~> 2.0) 195 | jquery-rails 196 | launchy 197 | rails (= 4.2.9) 198 | rspec-rails (~> 3.6.0) 199 | sass-rails (~> 5.0) 200 | sdoc (~> 0.4.0) 201 | spring 202 | sqlite3 203 | turbolinks 204 | uglifier (>= 1.3.0) 205 | ultra_light_wizard! 206 | web-console (~> 2.0) 207 | 208 | BUNDLED WITH 209 | 1.15.3 210 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/app/assets/images/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //~ require jquery //disabled 14 | //~ require jquery_ujs //disabled 15 | //~ require turbolinks //disabled 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/app/mailers/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/app/models/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/app/models/concerns/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RefRailsApp 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../../config/application', __FILE__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | 4 | # path to your application root. 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 | 7 | Dir.chdir APP_ROOT do 8 | # This script is a starting point to setup your application. 9 | # Add necessary setup steps to this file: 10 | 11 | puts "== Installing dependencies ==" 12 | system "gem install bundler --conservative" 13 | system "bundle check || bundle install" 14 | 15 | # puts "\n== Copying sample files ==" 16 | # unless File.exist?("config/database.yml") 17 | # system "cp config/database.yml.sample config/database.yml" 18 | # end 19 | 20 | puts "\n== Preparing database ==" 21 | system "bin/rake db:setup" 22 | 23 | puts "\n== Removing old logs and tempfiles ==" 24 | system "rm -f log/*" 25 | system "rm -rf tmp/cache" 26 | 27 | puts "\n== Restarting application server ==" 28 | system "touch tmp/restart.txt" 29 | end 30 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module RefRailsApp 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | 19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 21 | # config.i18n.default_locale = :de 22 | 23 | # Do not swallow errors in after_commit/after_rollback callbacks. 24 | config.active_record.raise_in_transactional_callbacks = true 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 31 | # yet still be able to expire them through the digest params. 32 | config.assets.digest = true 33 | 34 | # Adds additional error checking when serving assets at runtime. 35 | # Checks for improperly declared sprockets dependencies. 36 | # Raises helpful error messages. 37 | config.assets.raise_runtime_errors = true 38 | 39 | # Raises error for missing translations 40 | # config.action_view.raise_on_missing_translations = true 41 | end 42 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like 20 | # NGINX, varnish or squid. 21 | # config.action_dispatch.rack_cache = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? 26 | 27 | # Compress JavaScripts and CSS. 28 | config.assets.js_compressor = :uglifier 29 | # config.assets.css_compressor = :sass 30 | 31 | # Do not fallback to assets pipeline if a precompiled asset is missed. 32 | config.assets.compile = false 33 | 34 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 35 | # yet still be able to expire them through the digest params. 36 | config.assets.digest = true 37 | 38 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 39 | 40 | # Specifies the header that your server uses for sending files. 41 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 42 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 43 | 44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 45 | # config.force_ssl = true 46 | 47 | # Use the lowest log level to ensure availability of diagnostic information 48 | # when problems arise. 49 | config.log_level = :debug 50 | 51 | # Prepend all log lines with the following tags. 52 | # config.log_tags = [ :subdomain, :uuid ] 53 | 54 | # Use a different logger for distributed setups. 55 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 56 | 57 | # Use a different cache store in production. 58 | # config.cache_store = :mem_cache_store 59 | 60 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 61 | # config.action_controller.asset_host = 'http://assets.example.com' 62 | 63 | # Ignore bad email addresses and do not raise email delivery errors. 64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 65 | # config.action_mailer.raise_delivery_errors = false 66 | 67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 68 | # the I18n.default_locale when a translation cannot be found). 69 | config.i18n.fallbacks = true 70 | 71 | # Send deprecation notices to registered listeners. 72 | config.active_support.deprecation = :notify 73 | 74 | # Use default logging formatter so that PID and timestamp are not suppressed. 75 | config.log_formatter = ::Logger::Formatter.new 76 | 77 | # Do not dump schema after migrations. 78 | config.active_record.dump_schema_after_migration = false 79 | end 80 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static file server for tests with Cache-Control for performance. 16 | config.serve_static_files = true 17 | config.static_cache_control = 'public, max-age=3600' 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Randomize the order test cases are executed. 35 | config.active_support.test_order = :random 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json 4 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_ref_rails_app_session' 4 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/to_time_preserves_timezone.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Preserve the timezone of the receiver when calling to `to_time`. 4 | # Ruby 2.4 will change the behavior of `to_time` to preserve the timezone 5 | # when converting to an instance of `Time` instead of the previous behavior 6 | # of converting to the local system timezone. 7 | # 8 | # Rails 5.0 introduced this config option so that apps made with earlier 9 | # versions of Rails are not affected when upgrading. 10 | ActiveSupport.to_time_preserves_timezone = true 11 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | # The priority is based upon order of creation: first created -> highest priority. 3 | # See how all your routes lay out with "rake routes". 4 | 5 | # You can have the root of your site routed with "root" 6 | # root 'welcome#index' 7 | 8 | # Example of regular route: 9 | # get 'products/:id' => 'catalog#view' 10 | 11 | # Example of named route that can be invoked with purchase_url(id: product.id) 12 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 13 | 14 | # Example resource route (maps HTTP verbs to controller actions automatically): 15 | # resources :products 16 | 17 | # Example resource route with options: 18 | # resources :products do 19 | # member do 20 | # get 'short' 21 | # post 'toggle' 22 | # end 23 | # 24 | # collection do 25 | # get 'sold' 26 | # end 27 | # end 28 | 29 | # Example resource route with sub-resources: 30 | # resources :products do 31 | # resources :comments, :sales 32 | # resource :seller 33 | # end 34 | 35 | # Example resource route with more complex sub-resources: 36 | # resources :products do 37 | # resources :comments 38 | # resources :sales do 39 | # get 'recent', on: :collection 40 | # end 41 | # end 42 | 43 | # Example resource route with concerns: 44 | # concern :toggleable do 45 | # post 'toggle' 46 | # end 47 | # resources :posts, concerns: :toggleable 48 | # resources :photos, concerns: :toggleable 49 | 50 | # Example resource route within a namespace: 51 | # namespace :admin do 52 | # # Directs /admin/products/* to Admin::ProductsController 53 | # # (app/controllers/admin/products_controller.rb) 54 | # resources :products 55 | # end 56 | end 57 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 9005137096d90c14c94aed5accc13d66bdf114e3dc8a33ebf1e8ec77b7a5e7246062e406065d3eb388d6d5a96eaadf6064e2ce9062926b9aa36056f7ac5c2fde 15 | 16 | test: 17 | secret_key_base: 40ae2e0affd5c1c81c29d5baa11e4ca252464fcc149a10a482d185618b41c97d3db2c6664e3f18162a43ee225a77d7d6ce64ff80b53eabe7bef707b6c282c225 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 0) do 15 | 16 | end 17 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/lib/assets/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/lib/tasks/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/log/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/public/favicon.ico -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/spec/features/ultra_light_wizard_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative '../rails_helper' 2 | 3 | RSpec.feature "Ultra Light Wizard", type: :feature do 4 | def create_project 5 | visit '/projects' 6 | click_link 'New Project' 7 | end 8 | def fill_in_project_fields 9 | fill_in 'project_name', with: 'Project 1' 10 | fill_in 'project_description', with: 'Description 1' 11 | select (DateTime.current.year + 1).to_s, from: 'project_start_date_1i' 12 | select (DateTime.current.year + 2).to_s, from: 'project_delivery_date_1i' 13 | end 14 | def submit_project_basic_info 15 | fill_in_project_fields 16 | find('input[type=submit]').click 17 | end 18 | alias submit_project_detail submit_project_basic_info 19 | alias submit_project_file_upload submit_project_basic_info 20 | alias submit_project_preview submit_project_basic_info 21 | def verify_step(step_class) 22 | step_name = step_class.name.sub('Project::','').underscore 23 | expect(page).to have_text(step_name.humanize) 24 | expect(page).to have_css("form#edit_project[action=\"/projects/#{Project.last.id}/project_steps/#{step_name}\"][method=post]") 25 | end 26 | def verify_previous_step_navigatability(step_name) 27 | expect(page).to have_css("a[href=\"/projects/#{Project.last.id}/project_steps/#{step_name}/edit\"]") 28 | end 29 | def verify_project_fields 30 | expect(page).to have_text("Project 1") 31 | expect(page).to have_text("Description 1") 32 | expect(page).to have_text((DateTime.current.year + 1).to_s) 33 | expect(page).to have_text((DateTime.current.year + 2).to_s) 34 | end 35 | scenario 'can start wizard' do 36 | create_project 37 | 38 | verify_step(Project::BasicInfo) 39 | end 40 | scenario 'can input all 4 fields and go to step 2 in wizard' do 41 | create_project 42 | submit_project_basic_info 43 | 44 | verify_step(Project::Detail) 45 | verify_previous_step_navigatability('basic_info') 46 | end 47 | scenario 'can input all 4 fields and go to step 3 in wizard' do 48 | create_project 49 | submit_project_basic_info 50 | submit_project_detail 51 | 52 | verify_step(Project::FileUpload) 53 | verify_previous_step_navigatability('detail') 54 | end 55 | scenario 'can input all 4 fields and go to step 4 in wizard' do 56 | create_project 57 | submit_project_basic_info 58 | submit_project_detail 59 | submit_project_file_upload 60 | 61 | verify_step(Project::Preview) 62 | verify_previous_step_navigatability('file_upload') 63 | end 64 | scenario 'can finish wizard and land on show page of model' do 65 | create_project 66 | submit_project_basic_info 67 | submit_project_detail 68 | submit_project_file_upload 69 | submit_project_preview 70 | 71 | expect(page).to have_current_path(project_path(Project.last)) 72 | verify_project_fields 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/spec/rails_helper.rb: -------------------------------------------------------------------------------- 1 | # This file is copied to spec/ when you run 'rails generate rspec:install' 2 | require 'spec_helper' 3 | ENV['RAILS_ENV'] ||= 'test' 4 | require File.expand_path('../../config/environment', __FILE__) 5 | # Prevent database truncation if the environment is production 6 | abort("The Rails environment is running in production mode!") if Rails.env.production? 7 | require 'rspec/rails' 8 | require 'capybara/rails' 9 | # Add additional requires below this line. Rails is not loaded until this point! 10 | 11 | # Requires supporting ruby files with custom matchers and macros, etc, in 12 | # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are 13 | # run as spec files by default. This means that files in spec/support that end 14 | # in _spec.rb will both be required and run as specs, causing the specs to be 15 | # run twice. It is recommended that you do not name files matching this glob to 16 | # end with _spec.rb. You can configure this pattern with the --pattern 17 | # option on the command line or in ~/.rspec, .rspec or `.rspec-local`. 18 | # 19 | # The following line is provided for convenience purposes. It has the downside 20 | # of increasing the boot-up time by auto-requiring all files in the support 21 | # directory. Alternatively, in the individual `*_spec.rb` files, manually 22 | # require only the support files necessary. 23 | # 24 | # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } 25 | 26 | # Checks for pending migration and applies them before tests are run. 27 | # If you are not using ActiveRecord, you can remove this line. 28 | ActiveRecord::Migration.maintain_test_schema! 29 | 30 | RSpec.configure do |config| 31 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures 32 | config.fixture_path = "#{::Rails.root}/spec/fixtures" 33 | 34 | # If you're not using ActiveRecord, or you'd prefer not to run each of your 35 | # examples within a transaction, remove the following line or assign false 36 | # instead of true. 37 | config.use_transactional_fixtures = true 38 | 39 | # RSpec Rails can automatically mix in different behaviours to your tests 40 | # based on their file location, for example enabling you to call `get` and 41 | # `post` in specs under `spec/controllers`. 42 | # 43 | # You can disable this behaviour by removing the line below, and instead 44 | # explicitly tag your specs with their type, e.g.: 45 | # 46 | # RSpec.describe UsersController, :type => :controller do 47 | # # ... 48 | # end 49 | # 50 | # The different available types are documented in the features, such as in 51 | # https://relishapp.com/rspec/rspec-rails/docs 52 | config.infer_spec_type_from_file_location! 53 | 54 | # Filter lines from Rails gems in backtraces. 55 | config.filter_rails_from_backtrace! 56 | # arbitrary gems may also be filtered via: 57 | # config.filter_gems_from_backtrace("gem name") 58 | end 59 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all 2 | # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. 3 | # The generated `.rspec` file contains `--require spec_helper` which will cause 4 | # this file to always be loaded, without a need to explicitly require it in any 5 | # files. 6 | # 7 | # Given that it is always loaded, you are encouraged to keep this file as 8 | # light-weight as possible. Requiring heavyweight dependencies from this file 9 | # will add to the boot time of your test suite on EVERY test run, even for an 10 | # individual file that may not need all of that loaded. Instead, consider making 11 | # a separate helper file that requires the additional dependencies and performs 12 | # the additional setup, and require it from the spec files that actually need 13 | # it. 14 | # 15 | # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration 16 | RSpec.configure do |config| 17 | # rspec-expectations config goes here. You can use an alternate 18 | # assertion/expectation library such as wrong or the stdlib/minitest 19 | # assertions if you prefer. 20 | config.expect_with :rspec do |expectations| 21 | # This option will default to `true` in RSpec 4. It makes the `description` 22 | # and `failure_message` of custom matchers include text for helper methods 23 | # defined using `chain`, e.g.: 24 | # be_bigger_than(2).and_smaller_than(4).description 25 | # # => "be bigger than 2 and smaller than 4" 26 | # ...rather than: 27 | # # => "be bigger than 2" 28 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 29 | end 30 | 31 | # rspec-mocks config goes here. You can use an alternate test double 32 | # library (such as bogus or mocha) by changing the `mock_with` option here. 33 | config.mock_with :rspec do |mocks| 34 | # Prevents you from mocking or stubbing a method that does not exist on 35 | # a real object. This is generally recommended, and will default to 36 | # `true` in RSpec 4. 37 | mocks.verify_partial_doubles = true 38 | end 39 | 40 | # This option will default to `:apply_to_host_groups` in RSpec 4 (and will 41 | # have no way to turn it off -- the option exists only for backwards 42 | # compatibility in RSpec 3). It causes shared context metadata to be 43 | # inherited by the metadata hash of host groups and examples, rather than 44 | # triggering implicit auto-inclusion in groups with matching metadata. 45 | config.shared_context_metadata_behavior = :apply_to_host_groups 46 | 47 | # The settings below are suggested to provide a good initial experience 48 | # with RSpec, but feel free to customize to your heart's content. 49 | =begin 50 | # This allows you to limit a spec run to individual examples or groups 51 | # you care about by tagging them with `:focus` metadata. When nothing 52 | # is tagged with `:focus`, all examples get run. RSpec also provides 53 | # aliases for `it`, `describe`, and `context` that include `:focus` 54 | # metadata: `fit`, `fdescribe` and `fcontext`, respectively. 55 | config.filter_run_when_matching :focus 56 | 57 | # Allows RSpec to persist some state between runs in order to support 58 | # the `--only-failures` and `--next-failure` CLI options. We recommend 59 | # you configure your source control system to ignore this file. 60 | config.example_status_persistence_file_path = "spec/examples.txt" 61 | 62 | # Limits the available syntax to the non-monkey patched syntax that is 63 | # recommended. For more details, see: 64 | # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ 65 | # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ 66 | # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode 67 | config.disable_monkey_patching! 68 | 69 | # Many RSpec users commonly either run the entire suite or an individual 70 | # file, and it's useful to allow more verbose output when running an 71 | # individual spec file. 72 | if config.files_to_run.one? 73 | # Use the documentation formatter for detailed output, 74 | # unless a formatter has already been configured 75 | # (e.g. via a command-line flag). 76 | config.default_formatter = "doc" 77 | end 78 | 79 | # Print the 10 slowest examples and example groups at the 80 | # end of the spec run, to help surface which specs are running 81 | # particularly slow. 82 | config.profile_examples = 10 83 | 84 | # Run specs in random order to surface order dependencies. If you find an 85 | # order dependency and want to debug it, you can fix the order by providing 86 | # the seed, which is printed after each run. 87 | # --seed 1234 88 | config.order = :random 89 | 90 | # Seed global randomization in this process using the `--seed` CLI option. 91 | # Setting this allows you to use `--seed` to deterministically reproduce 92 | # test failures related to randomization by passing the same `--seed` value 93 | # as the one that triggered the failure. 94 | Kernel.srand config.seed 95 | =end 96 | end 97 | -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /spec/fixtures/ref_rails_app/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/spec/fixtures/ref_rails_app/vendor/assets/stylesheets/.keep -------------------------------------------------------------------------------- /spec/lib/ultra_light_wizard/ultra_light_wizard_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | require 'fileutils' 3 | 4 | describe UltraLightWizard do 5 | let(:app_rails_ref) {File.expand_path(File.join(__FILE__, '..', '..', '..', 'fixtures', 'ref_rails_app'))} 6 | let(:app_rails_copy) {app_rails_ref.sub('ref', 'copy')} 7 | before do 8 | FileUtils.rm_rf app_rails_copy 9 | FileUtils.cp_r app_rails_ref, app_rails_copy 10 | end 11 | after do 12 | FileUtils.rm_rf app_rails_copy 13 | end 14 | it 'provides a rails generator when installed in a sample Rails app' do 15 | result = system "cd #{app_rails_copy} 16 | rake db:reset 17 | rails generate ultra_light_wizard:scaffold project steps:basic_info,detail,file_upload,preview attributes:name:string,description:text,start_date:datetime,delivery_date:datetime 18 | rake db:migrate 19 | rake db:test:prepare 20 | rake" 21 | expect(result).to be_truthy 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['APP_ENV'] = 'test' 2 | require 'rubygems' 3 | require 'bundler' 4 | require 'puts_debuggerer' 5 | begin 6 | Bundler.setup(:default, :test) 7 | rescue Bundler::BundlerError => e 8 | $stderr.puts e.message 9 | $stderr.puts "Run `bundle install` to install missing gems" 10 | exit e.status_code 11 | end 12 | if RUBY_VERSION >= '1.9' 13 | begin 14 | require 'coveralls' 15 | Coveralls.wear! 16 | rescue LoadError, StandardError 17 | #no op to support Ruby 1.8.7, ree and Rubinius which do not support Coveralls 18 | end 19 | end 20 | require File.join(File.dirname(__FILE__), '..', 'lib', 'ultra_light_wizard') 21 | -------------------------------------------------------------------------------- /ultra_light_wizard.gemspec: -------------------------------------------------------------------------------- 1 | # Generated by jeweler 2 | # DO NOT EDIT THIS FILE DIRECTLY 3 | # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' 4 | # -*- encoding: utf-8 -*- 5 | # stub: ultra_light_wizard 0.1.4 ruby lib 6 | 7 | Gem::Specification.new do |s| 8 | s.name = "ultra_light_wizard".freeze 9 | s.version = "0.1.4" 10 | 11 | s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= 12 | s.require_paths = ["lib".freeze] 13 | s.authors = ["Andy Maleh".freeze] 14 | s.date = "2017-08-06" 15 | s.description = "Ultra light & maintainble wizards in Rails that honor REST, MVC, and OO with minimal writing of code involved and maximum flexibility".freeze 16 | s.email = "andy.am@gmail.com".freeze 17 | s.extra_rdoc_files = [ 18 | "LICENSE.txt", 19 | "README.md" 20 | ] 21 | s.files = [ 22 | ".ruby-gemset", 23 | ".ruby-version", 24 | "Gemfile", 25 | "Gemfile.lock", 26 | "LICENSE.txt", 27 | "README.md", 28 | "Rakefile", 29 | "VERSION", 30 | "lib/generators/templates/app/assets/stylesheets/wizard_steps.scss", 31 | "lib/generators/templates/app/controllers/wizard_steps_controller.rb.erb", 32 | "lib/generators/templates/app/helpers/wizard_steps_helper.rb.erb", 33 | "lib/generators/templates/app/models/wizard_step_model.rb.erb", 34 | "lib/generators/templates/app/views/wizard_step_breadcrumb_view.html.erb", 35 | "lib/generators/templates/app/views/wizard_step_navigation_view.html.erb", 36 | "lib/generators/templates/app/views/wizard_step_view.html.erb", 37 | "lib/generators/ultra_light_wizard/scaffold_generator.rb", 38 | "lib/ultra_light_wizard.rb", 39 | "ruby187.Gemfile", 40 | "spec/fixtures/ref_rails_app/.gitignore", 41 | "spec/fixtures/ref_rails_app/Gemfile", 42 | "spec/fixtures/ref_rails_app/Gemfile.lock", 43 | "spec/fixtures/ref_rails_app/README.rdoc", 44 | "spec/fixtures/ref_rails_app/Rakefile", 45 | "spec/fixtures/ref_rails_app/app/assets/images/.keep", 46 | "spec/fixtures/ref_rails_app/app/assets/javascripts/application.js", 47 | "spec/fixtures/ref_rails_app/app/assets/stylesheets/application.css", 48 | "spec/fixtures/ref_rails_app/app/controllers/application_controller.rb", 49 | "spec/fixtures/ref_rails_app/app/controllers/concerns/.keep", 50 | "spec/fixtures/ref_rails_app/app/helpers/application_helper.rb", 51 | "spec/fixtures/ref_rails_app/app/mailers/.keep", 52 | "spec/fixtures/ref_rails_app/app/models/.keep", 53 | "spec/fixtures/ref_rails_app/app/models/concerns/.keep", 54 | "spec/fixtures/ref_rails_app/app/views/layouts/application.html.erb", 55 | "spec/fixtures/ref_rails_app/bin/bundle", 56 | "spec/fixtures/ref_rails_app/bin/rails", 57 | "spec/fixtures/ref_rails_app/bin/rake", 58 | "spec/fixtures/ref_rails_app/bin/setup", 59 | "spec/fixtures/ref_rails_app/bin/spring", 60 | "spec/fixtures/ref_rails_app/config.ru", 61 | "spec/fixtures/ref_rails_app/config/application.rb", 62 | "spec/fixtures/ref_rails_app/config/boot.rb", 63 | "spec/fixtures/ref_rails_app/config/database.yml", 64 | "spec/fixtures/ref_rails_app/config/environment.rb", 65 | "spec/fixtures/ref_rails_app/config/environments/development.rb", 66 | "spec/fixtures/ref_rails_app/config/environments/production.rb", 67 | "spec/fixtures/ref_rails_app/config/environments/test.rb", 68 | "spec/fixtures/ref_rails_app/config/initializers/assets.rb", 69 | "spec/fixtures/ref_rails_app/config/initializers/backtrace_silencers.rb", 70 | "spec/fixtures/ref_rails_app/config/initializers/cookies_serializer.rb", 71 | "spec/fixtures/ref_rails_app/config/initializers/filter_parameter_logging.rb", 72 | "spec/fixtures/ref_rails_app/config/initializers/inflections.rb", 73 | "spec/fixtures/ref_rails_app/config/initializers/mime_types.rb", 74 | "spec/fixtures/ref_rails_app/config/initializers/session_store.rb", 75 | "spec/fixtures/ref_rails_app/config/initializers/to_time_preserves_timezone.rb", 76 | "spec/fixtures/ref_rails_app/config/initializers/wrap_parameters.rb", 77 | "spec/fixtures/ref_rails_app/config/locales/en.yml", 78 | "spec/fixtures/ref_rails_app/config/routes.rb", 79 | "spec/fixtures/ref_rails_app/config/secrets.yml", 80 | "spec/fixtures/ref_rails_app/db/schema.rb", 81 | "spec/fixtures/ref_rails_app/db/seeds.rb", 82 | "spec/fixtures/ref_rails_app/lib/assets/.keep", 83 | "spec/fixtures/ref_rails_app/lib/tasks/.keep", 84 | "spec/fixtures/ref_rails_app/log/.keep", 85 | "spec/fixtures/ref_rails_app/public/404.html", 86 | "spec/fixtures/ref_rails_app/public/422.html", 87 | "spec/fixtures/ref_rails_app/public/500.html", 88 | "spec/fixtures/ref_rails_app/public/favicon.ico", 89 | "spec/fixtures/ref_rails_app/public/robots.txt", 90 | "spec/fixtures/ref_rails_app/spec/features/ultra_light_wizard_spec.rb", 91 | "spec/fixtures/ref_rails_app/spec/rails_helper.rb", 92 | "spec/fixtures/ref_rails_app/spec/spec_helper.rb", 93 | "spec/fixtures/ref_rails_app/vendor/assets/javascripts/.keep", 94 | "spec/fixtures/ref_rails_app/vendor/assets/stylesheets/.keep", 95 | "spec/lib/ultra_light_wizard/ultra_light_wizard_spec.rb", 96 | "spec/spec_helper.rb", 97 | "ultra_light_wizard.gemspec", 98 | "ultra_light_wizard.jpg", 99 | "ultra_light_wizard_step_breadcrumb.png" 100 | ] 101 | s.homepage = "http://github.com/AndyObtiva/ultra_light_wizard".freeze 102 | s.licenses = ["MIT".freeze] 103 | s.rubygems_version = "2.6.12".freeze 104 | s.summary = "Ultra Light & Maintainable Wizards In Rails".freeze 105 | 106 | if s.respond_to? :specification_version then 107 | s.specification_version = 4 108 | 109 | if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then 110 | s.add_development_dependency(%q.freeze, ["~> 0.7.1"]) 111 | s.add_development_dependency(%q.freeze, ["~> 4.2.9"]) 112 | s.add_development_dependency(%q.freeze, ["~> 3.6.0"]) 113 | s.add_development_dependency(%q.freeze, ["~> 5.0"]) 114 | s.add_development_dependency(%q.freeze, ["~> 4.1.0"]) 115 | s.add_development_dependency(%q.freeze, ["~> 2.3.7"]) 116 | else 117 | s.add_dependency(%q.freeze, ["~> 0.7.1"]) 118 | s.add_dependency(%q.freeze, ["~> 4.2.9"]) 119 | s.add_dependency(%q.freeze, ["~> 3.6.0"]) 120 | s.add_dependency(%q.freeze, ["~> 5.0"]) 121 | s.add_dependency(%q.freeze, ["~> 4.1.0"]) 122 | s.add_dependency(%q.freeze, ["~> 2.3.7"]) 123 | end 124 | else 125 | s.add_dependency(%q.freeze, ["~> 0.7.1"]) 126 | s.add_dependency(%q.freeze, ["~> 4.2.9"]) 127 | s.add_dependency(%q.freeze, ["~> 3.6.0"]) 128 | s.add_dependency(%q.freeze, ["~> 5.0"]) 129 | s.add_dependency(%q.freeze, ["~> 4.1.0"]) 130 | s.add_dependency(%q.freeze, ["~> 2.3.7"]) 131 | end 132 | end 133 | 134 | -------------------------------------------------------------------------------- /ultra_light_wizard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/ultra_light_wizard.jpg -------------------------------------------------------------------------------- /ultra_light_wizard_step_breadcrumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndyObtiva/ultra_light_wizard/b1c5aa9e08b5e9f4725a8bbca7ffffc884d7a807/ultra_light_wizard_step_breadcrumb.png --------------------------------------------------------------------------------