ultra_light_wizard 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +28 -2
- data/README.md +7 -3
- data/VERSION +1 -1
- data/lib/generators/templates/app/assets/stylesheets/wizard_steps.scss +34 -0
- data/lib/generators/templates/app/views/wizard_step_breadcrumb_view.html.erb +8 -0
- data/lib/generators/templates/app/views/wizard_step_view.html.erb +1 -0
- data/lib/generators/ultra_light_wizard/scaffold_generator.rb +2 -0
- data/spec/fixtures/ref_rails_app/Gemfile.lock +1 -1
- data/spec/lib/ultra_light_wizard/ultra_light_wizard_spec.rb +2 -0
- data/ultra_light_wizard.gemspec +16 -4
- data/ultra_light_wizard_step_breadcrumb.png +0 -0
- metadata +47 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6a96700db67fbed453457fcaab3f00c4ec9460c
|
4
|
+
data.tar.gz: f31af75b766dd6992606733e3d12d5aac8f80c7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bd4ea67d2b9ad39258afe5085ab8ab2d0e8698a47a47dbbe14d4e2d5ca0769561c2c8cb32f8bb38c59310278d20cf0ca68f5639375b910734a07731b079f1dd
|
7
|
+
data.tar.gz: 50dbda3e031a8897978e1b7d1dfd400894f558cbb2de8956748395bcaff38c07516114a83aefbb25b0f60af9add31dbfeab66f32e49467ecddb79ab8b6c29f92
|
data/Gemfile
CHANGED
@@ -3,6 +3,9 @@ source 'http://rubygems.org'
|
|
3
3
|
group :development, :test do
|
4
4
|
gem 'puts_debuggerer', '~> 0.7.1'
|
5
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'
|
6
9
|
end
|
7
10
|
|
8
11
|
group :development do
|
@@ -10,7 +13,6 @@ group :development do
|
|
10
13
|
end
|
11
14
|
|
12
15
|
group :test do
|
13
|
-
gem 'rspec-rails'
|
14
16
|
gem 'capybara'
|
15
17
|
gem 'coveralls'
|
16
18
|
gem 'ultra_light_wizard', path: '.' #used in specs
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ultra_light_wizard (0.1.
|
4
|
+
ultra_light_wizard (0.1.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
@@ -51,6 +51,13 @@ GEM
|
|
51
51
|
rack (>= 1.0.0)
|
52
52
|
rack-test (>= 0.5.4)
|
53
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)
|
54
61
|
concurrent-ruby (1.0.5)
|
55
62
|
coveralls (0.8.21)
|
56
63
|
json (>= 1.8, < 3)
|
@@ -63,8 +70,10 @@ GEM
|
|
63
70
|
diff-lcs (1.3)
|
64
71
|
docile (1.1.5)
|
65
72
|
erubis (2.7.0)
|
73
|
+
execjs (2.7.0)
|
66
74
|
faraday (0.9.2)
|
67
75
|
multipart-post (>= 1.2, < 3)
|
76
|
+
ffi (1.9.18)
|
68
77
|
git (1.3.0)
|
69
78
|
github_api (0.16.0)
|
70
79
|
addressable (~> 2.4.0)
|
@@ -142,6 +151,9 @@ GEM
|
|
142
151
|
rake (>= 0.8.7)
|
143
152
|
thor (>= 0.18.1, < 2.0)
|
144
153
|
rake (12.0.0)
|
154
|
+
rb-fsevent (0.10.2)
|
155
|
+
rb-inotify (0.9.10)
|
156
|
+
ffi (>= 0.5.0, < 2)
|
145
157
|
rdoc (5.1.0)
|
146
158
|
rspec-core (3.6.0)
|
147
159
|
rspec-support (~> 3.6.0)
|
@@ -160,6 +172,17 @@ GEM
|
|
160
172
|
rspec-mocks (~> 3.6.0)
|
161
173
|
rspec-support (~> 3.6.0)
|
162
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)
|
163
186
|
semver2 (3.4.2)
|
164
187
|
simplecov (0.14.1)
|
165
188
|
docile (~> 1.1.0)
|
@@ -178,6 +201,7 @@ GEM
|
|
178
201
|
tins (~> 1.0)
|
179
202
|
thor (0.19.4)
|
180
203
|
thread_safe (0.3.6)
|
204
|
+
tilt (2.0.8)
|
181
205
|
tins (1.15.0)
|
182
206
|
tzinfo (1.2.3)
|
183
207
|
thread_safe (~> 0.1)
|
@@ -189,12 +213,14 @@ PLATFORMS
|
|
189
213
|
|
190
214
|
DEPENDENCIES
|
191
215
|
capybara
|
216
|
+
coffee-rails (~> 4.1.0)
|
192
217
|
coveralls
|
193
218
|
jeweler (~> 2.3.7)
|
194
219
|
launchy
|
195
220
|
puts_debuggerer (~> 0.7.1)
|
196
221
|
rails (~> 4.2.9)
|
197
|
-
rspec-rails
|
222
|
+
rspec-rails (~> 3.6.0)
|
223
|
+
sass-rails (~> 5.0)
|
198
224
|
sqlite3
|
199
225
|
ultra_light_wizard!
|
200
226
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Ultra Light Wizard v0.1.
|
1
|
+
Ultra Light Wizard v0.1.4 (beta)
|
2
2
|
================================
|
3
3
|
|
4
4
|
No time to manage a wizard state machine, session variables, or complicated controllers? Use Ultra Light Wizard!! A RESTful session-less validation-friendly simple wizard architectural pattern in Rails.
|
@@ -29,13 +29,16 @@ To learn more about the Ultra Light Wizard architectural pattern philosophy and
|
|
29
29
|
|
30
30
|
**Note**: Since Ultra Light Wizard is an architectural pattern that can be applied whether using this library or not, it is more important to understand it well first through watching the video and reading the article provided above. Afterward, you may use the library to get started quickly via Rails scaffolding for new project models or otherwise avoid by applying pattern manually for existing project models.
|
31
31
|
|
32
|
+
![Ultra Light Wizard Step Breadcrumb](https://cdn.rawgit.com/AndyObtiva/ultra_light_wizard/master/ultra_light_wizard_step_breadcrumb.png)
|
33
|
+
|
34
|
+
|
32
35
|
Instructions
|
33
36
|
============
|
34
37
|
|
35
38
|
Add the following to your Rails project ```Gemfile```:
|
36
39
|
|
37
40
|
```
|
38
|
-
gem 'ultra_light_wizard', '~> 0.1.
|
41
|
+
gem 'ultra_light_wizard', '~> 0.1.4'
|
39
42
|
```
|
40
43
|
|
41
44
|
Run the command:
|
@@ -209,8 +212,8 @@ Features
|
|
209
212
|
+ Support for attributes
|
210
213
|
+ Form fields
|
211
214
|
+ Custom name conventions
|
215
|
+
+ Wizard step breadcrumb with easily stylable semantic markup
|
212
216
|
- [UPCOMING] JS Ajax support
|
213
|
-
- [UPCOMING] Basic styling and easily stylable markup
|
214
217
|
|
215
218
|
Enhancements
|
216
219
|
============
|
@@ -220,6 +223,7 @@ If you are interested in having enhancements implemented, please report via a Gi
|
|
220
223
|
History
|
221
224
|
=======
|
222
225
|
|
226
|
+
v0.1.4 Step breadcrumb, having easily customizable semantic markup
|
223
227
|
v0.1.3 test coverage with feature specs / fixed issue 4 Generate routes in the right order
|
224
228
|
v0.1.2 ensure resource creation redirects to first step / include step helper in resource controller
|
225
229
|
v0.1.1 includes permitted params and edit/update actions
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -0,0 +1,34 @@
|
|
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
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="step_breadcrumbs">
|
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
|
+
<div class="step_number"><%%= step_number = index + 1 %></div>
|
5
|
+
<div class="step_name"><%%= breadcrumb_step.humanize %></div>
|
6
|
+
<%% end %>
|
7
|
+
<%% end %>
|
8
|
+
</div>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<h1><%= file_path.humanize %> wizard</h1>
|
2
|
+
<%%= render '<%= step_alias %>_breadcrumb' %>
|
2
3
|
<h2><%= step_alias.titleize %>: <%= @wizard_step.humanize %></h2>
|
3
4
|
<%%= form_for <%= file_path %>_<%= step_alias %>_model, :url => current_<%= step_alias %>_path, :as => :<%= file_path %> do |f| %>
|
4
5
|
<%%# TODO limit to fields of this particular step %>
|
@@ -104,6 +104,8 @@ class #{controller_class_name} < ApplicationController
|
|
104
104
|
template "app/controllers/wizard_steps_controller.rb.erb", "app/controllers/#{file_path}_#{step_alias.pluralize}_controller.rb"
|
105
105
|
template "app/helpers/wizard_steps_helper.rb.erb", "app/helpers/#{file_path}_#{step_alias.pluralize}_helper.rb"
|
106
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"
|
107
109
|
steps.each do |step|
|
108
110
|
@wizard_step = step
|
109
111
|
template "app/models/wizard_step_model.rb.erb", "app/models/#{file_path}/#{step}.rb"
|
@@ -13,8 +13,10 @@ describe UltraLightWizard do
|
|
13
13
|
end
|
14
14
|
it 'provides a rails generator when installed in a sample Rails app' do
|
15
15
|
result = system "cd #{app_rails_copy}
|
16
|
+
rake db:reset
|
16
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
|
17
18
|
rake db:migrate
|
19
|
+
rake db:test:prepare
|
18
20
|
rake"
|
19
21
|
expect(result).to be_truthy
|
20
22
|
end
|
data/ultra_light_wizard.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: ultra_light_wizard 0.1.
|
5
|
+
# stub: ultra_light_wizard 0.1.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "ultra_light_wizard".freeze
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Andy Maleh".freeze]
|
14
|
-
s.date = "2017-
|
14
|
+
s.date = "2017-08-06"
|
15
15
|
s.description = "Ultra light & maintainble wizards in Rails that honor REST, MVC, and OO with minimal writing of code involved and maximum flexibility".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -27,9 +27,11 @@ Gem::Specification.new do |s|
|
|
27
27
|
"README.md",
|
28
28
|
"Rakefile",
|
29
29
|
"VERSION",
|
30
|
+
"lib/generators/templates/app/assets/stylesheets/wizard_steps.scss",
|
30
31
|
"lib/generators/templates/app/controllers/wizard_steps_controller.rb.erb",
|
31
32
|
"lib/generators/templates/app/helpers/wizard_steps_helper.rb.erb",
|
32
33
|
"lib/generators/templates/app/models/wizard_step_model.rb.erb",
|
34
|
+
"lib/generators/templates/app/views/wizard_step_breadcrumb_view.html.erb",
|
33
35
|
"lib/generators/templates/app/views/wizard_step_navigation_view.html.erb",
|
34
36
|
"lib/generators/templates/app/views/wizard_step_view.html.erb",
|
35
37
|
"lib/generators/ultra_light_wizard/scaffold_generator.rb",
|
@@ -93,7 +95,8 @@ Gem::Specification.new do |s|
|
|
93
95
|
"spec/lib/ultra_light_wizard/ultra_light_wizard_spec.rb",
|
94
96
|
"spec/spec_helper.rb",
|
95
97
|
"ultra_light_wizard.gemspec",
|
96
|
-
"ultra_light_wizard.jpg"
|
98
|
+
"ultra_light_wizard.jpg",
|
99
|
+
"ultra_light_wizard_step_breadcrumb.png"
|
97
100
|
]
|
98
101
|
s.homepage = "http://github.com/AndyObtiva/ultra_light_wizard".freeze
|
99
102
|
s.licenses = ["MIT".freeze]
|
@@ -106,15 +109,24 @@ Gem::Specification.new do |s|
|
|
106
109
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
107
110
|
s.add_development_dependency(%q<puts_debuggerer>.freeze, ["~> 0.7.1"])
|
108
111
|
s.add_development_dependency(%q<rails>.freeze, ["~> 4.2.9"])
|
112
|
+
s.add_development_dependency(%q<rspec-rails>.freeze, ["~> 3.6.0"])
|
113
|
+
s.add_development_dependency(%q<sass-rails>.freeze, ["~> 5.0"])
|
114
|
+
s.add_development_dependency(%q<coffee-rails>.freeze, ["~> 4.1.0"])
|
109
115
|
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.7"])
|
110
116
|
else
|
111
117
|
s.add_dependency(%q<puts_debuggerer>.freeze, ["~> 0.7.1"])
|
112
118
|
s.add_dependency(%q<rails>.freeze, ["~> 4.2.9"])
|
119
|
+
s.add_dependency(%q<rspec-rails>.freeze, ["~> 3.6.0"])
|
120
|
+
s.add_dependency(%q<sass-rails>.freeze, ["~> 5.0"])
|
121
|
+
s.add_dependency(%q<coffee-rails>.freeze, ["~> 4.1.0"])
|
113
122
|
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.7"])
|
114
123
|
end
|
115
124
|
else
|
116
125
|
s.add_dependency(%q<puts_debuggerer>.freeze, ["~> 0.7.1"])
|
117
126
|
s.add_dependency(%q<rails>.freeze, ["~> 4.2.9"])
|
127
|
+
s.add_dependency(%q<rspec-rails>.freeze, ["~> 3.6.0"])
|
128
|
+
s.add_dependency(%q<sass-rails>.freeze, ["~> 5.0"])
|
129
|
+
s.add_dependency(%q<coffee-rails>.freeze, ["~> 4.1.0"])
|
118
130
|
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.7"])
|
119
131
|
end
|
120
132
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultra_light_wizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puts_debuggerer
|
@@ -38,6 +38,48 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.2.9
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.6.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.6.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sass-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coffee-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 4.1.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 4.1.0
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: jeweler
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,9 +111,11 @@ files:
|
|
69
111
|
- README.md
|
70
112
|
- Rakefile
|
71
113
|
- VERSION
|
114
|
+
- lib/generators/templates/app/assets/stylesheets/wizard_steps.scss
|
72
115
|
- lib/generators/templates/app/controllers/wizard_steps_controller.rb.erb
|
73
116
|
- lib/generators/templates/app/helpers/wizard_steps_helper.rb.erb
|
74
117
|
- lib/generators/templates/app/models/wizard_step_model.rb.erb
|
118
|
+
- lib/generators/templates/app/views/wizard_step_breadcrumb_view.html.erb
|
75
119
|
- lib/generators/templates/app/views/wizard_step_navigation_view.html.erb
|
76
120
|
- lib/generators/templates/app/views/wizard_step_view.html.erb
|
77
121
|
- lib/generators/ultra_light_wizard/scaffold_generator.rb
|
@@ -136,6 +180,7 @@ files:
|
|
136
180
|
- spec/spec_helper.rb
|
137
181
|
- ultra_light_wizard.gemspec
|
138
182
|
- ultra_light_wizard.jpg
|
183
|
+
- ultra_light_wizard_step_breadcrumb.png
|
139
184
|
homepage: http://github.com/AndyObtiva/ultra_light_wizard
|
140
185
|
licenses:
|
141
186
|
- MIT
|