hot-glue 0.1.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +22 -19
- data/README.md +36 -19
- data/app/helpers/hot_glue/controller_helper.rb +1 -1
- data/lib/generators/hot_glue/install_generator.rb +0 -2
- data/lib/generators/hot_glue/markup_templates/base.rb +7 -0
- data/lib/generators/hot_glue/markup_templates/erb.rb +227 -0
- data/lib/generators/hot_glue/markup_templates/haml.rb +236 -0
- data/lib/generators/hot_glue/markup_templates/slim.rb +9 -0
- data/lib/generators/hot_glue/scaffold_generator.rb +127 -264
- data/lib/generators/hot_glue/templates/controller.rb.erb +14 -2
- data/lib/generators/hot_glue/templates/erb/_errors.erb +11 -0
- data/lib/generators/hot_glue/templates/erb/_flash_notices.erb +12 -0
- data/lib/generators/hot_glue/templates/erb/_form.erb +8 -0
- data/lib/generators/hot_glue/templates/erb/_line.erb +10 -0
- data/lib/generators/hot_glue/templates/erb/_list.erb +19 -0
- data/lib/generators/hot_glue/templates/erb/_new_button.erb +3 -0
- data/lib/generators/hot_glue/templates/erb/_new_form.erb +8 -0
- data/lib/generators/hot_glue/templates/erb/_show.erb +8 -0
- data/lib/generators/hot_glue/templates/erb/create.turbo_stream.erb +18 -0
- data/lib/generators/hot_glue/templates/erb/destroy.turbo_stream.erb +3 -0
- data/lib/generators/hot_glue/templates/erb/edit.erb +30 -0
- data/lib/generators/hot_glue/templates/erb/edit.turbo_stream.erb +3 -0
- data/lib/generators/hot_glue/templates/erb/index.erb +10 -0
- data/lib/generators/hot_glue/templates/erb/new.erb +1 -0
- data/lib/generators/hot_glue/templates/erb/update.turbo_stream.erb +10 -0
- data/lib/generators/hot_glue/templates/{_errors.haml → haml/_errors.haml} +0 -0
- data/lib/generators/hot_glue/templates/{_flash_notices.haml → haml/_flash_notices.haml} +0 -0
- data/lib/generators/hot_glue/templates/{_form.haml → haml/_form.haml} +1 -0
- data/lib/generators/hot_glue/templates/{_line.haml → haml/_line.haml} +0 -0
- data/lib/generators/hot_glue/templates/{_list.haml → haml/_list.haml} +0 -0
- data/lib/generators/hot_glue/templates/{_new_button.haml → haml/_new_button.haml} +0 -0
- data/lib/generators/hot_glue/templates/{_new_form.haml → haml/_new_form.haml} +0 -0
- data/lib/generators/hot_glue/templates/{_show.haml → haml/_show.haml} +0 -0
- data/lib/generators/hot_glue/templates/{create.turbo_stream.haml → haml/create.turbo_stream.haml} +0 -0
- data/lib/generators/hot_glue/templates/{destroy.turbo_stream.haml → haml/destroy.turbo_stream.haml} +0 -0
- data/lib/generators/hot_glue/templates/{edit.haml → haml/edit.haml} +0 -0
- data/lib/generators/hot_glue/templates/{edit.turbo_stream.haml → haml/edit.turbo_stream.haml} +0 -0
- data/lib/generators/hot_glue/templates/{index.haml → haml/index.haml} +0 -0
- data/lib/generators/hot_glue/templates/{new.haml → haml/new.haml} +0 -0
- data/lib/generators/hot_glue/templates/{update.turbo_stream.haml → haml/update.turbo_stream.haml} +0 -0
- data/lib/generators/hot_glue/templates/system_spec.rb.erb +1 -1
- data/lib/hot-glue.rb +6 -20
- data/lib/hotglue/version.rb +1 -1
- metadata +49 -24
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= all_line_fields %>
|
2
|
+
<div class="col">
|
3
|
+
<% if destroy_action %>
|
4
|
+
<\%= link_to "Delete <i class='fa fa-1x fa-remove'></i>".html_safe, <%= path_helper_singular %>(<%= path_helper_args %>), method: :delete, data: {confirm: 'Are you sure?'}, disable_with: "Loading...", class: "delete-<%= singular %>-button btn btn-primary " %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<\%= link_to "Edit <i class='fa fa-1x fa-list-alt'></i>".html_safe, edit_<%= path_helper_singular %>(<%= path_helper_args %>), <% if @big_edit %>'data-turbo' => 'false', <% end %>disable_with: "Loading...", class: "edit-<%= singular %>-button btn btn-primary " %>
|
8
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<\% if @<%= singular %>.errors.none? %>
|
2
|
+
<\%= turbo_stream.replace "<%= plural %>-list" do %>
|
3
|
+
<\%= render partial: "list", locals: {<%= plural %>: @<%= plural %>} %>
|
4
|
+
<\% end %>
|
5
|
+
<\% end %>
|
6
|
+
<\%= turbo_stream.replace "<%= singular %>-new" do %>
|
7
|
+
<\% if @<%= singular %>.errors.none? %>
|
8
|
+
<\%= render partial: "new_button" %>
|
9
|
+
<\% else %>
|
10
|
+
<\%= render partial: "new_form", locals: {<%= singular %>: @<%= singular %>} %>
|
11
|
+
<\% end %>
|
12
|
+
<\% end %>
|
13
|
+
<\%= turbo_stream.replace "flash_notices" do %>
|
14
|
+
<\%= render partial: "layouts/flash_notices" %>
|
15
|
+
<\% if @<%= singular %>.errors.any? %>
|
16
|
+
<\%= render partial: "errors", locals: {resource: @<%= singular %>} %>
|
17
|
+
<\% end %>
|
18
|
+
<\% end %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<\%= link_to "<i class='fa fa-arrow-circle-left 2x'></i> Back to list".html_safe, <%= path_helper_plural %> %>
|
2
|
+
|
3
|
+
<\%= turbo_frame_tag "<%= singular %>__#{<%= "@" + singular %>.id}" do %>
|
4
|
+
|
5
|
+
<div class="cell editable" style="position: relative;">
|
6
|
+
|
7
|
+
<\% if @<%= singular %>.errors.any? %>
|
8
|
+
<\%= render(partial: "#{controller.namespace}errors", locals: {resource: @<%= singular%> }) %>
|
9
|
+
<\% end %>
|
10
|
+
|
11
|
+
<h2>Editing</h2>
|
12
|
+
<% if eval("@" + singular).try(:to_label) %>
|
13
|
+
<%="@" + singular%>.to_label
|
14
|
+
<% elsif eval("@" + singular).try(:name) %>
|
15
|
+
<%="@" + singular%>.name %>
|
16
|
+
<% else %>
|
17
|
+
(no name)
|
18
|
+
<% end %>
|
19
|
+
<\%= form_with model: <%= "@" + singular%>, url: <%= path_helper_singular %>(<%= path_arity %>) do |f| %>
|
20
|
+
<\%= render partial: "form", locals: {:<%= singular %> => <%= "@" + singular%>, f: f} %>
|
21
|
+
<\% end %>
|
22
|
+
<i class='fa fa-times-circle fa-2x'
|
23
|
+
data-name='close-<%= singular %>__<\% <%= "@" + singular %>.id %> }'
|
24
|
+
data-row-id=<%= "@" + singular %>.id,
|
25
|
+
data-role='close-button'></i>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<\% end %>
|
29
|
+
|
30
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="container-fluid">
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-md-12">
|
4
|
+
<\%= render partial: "new_button" %>
|
5
|
+
<div class="clearfix"></div>
|
6
|
+
<\%= render partial: '<%= list_path_partial %>',
|
7
|
+
locals: {<%= plural %>: @<%= plural %>} \%>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<\%= render partial: "new_form", locals: {<%= singular %>: @<%=singular%>} %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<\%= turbo_stream.replace "<%= singular%>__#{@<%= singular %>.id}" do %>
|
2
|
+
<\%= render partial: 'line', locals: {<%= singular %>: @<%= singular %> <%= nested_assignments_with_leading_comma %> } %>
|
3
|
+
<\% end %>
|
4
|
+
|
5
|
+
<\%= turbo_stream.replace "flash_notices" do %>
|
6
|
+
<\%= render partial: "layouts/flash_notices" %>
|
7
|
+
<\% if @<%= singular %>.errors.any? %>
|
8
|
+
<\%= render partial: "errors", locals: {resource: @<%= singular %>} %>
|
9
|
+
<\% end %>
|
10
|
+
<\% end %>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/generators/hot_glue/templates/{create.turbo_stream.haml → haml/create.turbo_stream.haml}
RENAMED
File without changes
|
data/lib/generators/hot_glue/templates/{destroy.turbo_stream.haml → haml/destroy.turbo_stream.haml}
RENAMED
File without changes
|
File without changes
|
data/lib/generators/hot_glue/templates/{edit.turbo_stream.haml → haml/edit.turbo_stream.haml}
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/lib/generators/hot_glue/templates/{update.turbo_stream.haml → haml/update.turbo_stream.haml}
RENAMED
File without changes
|
@@ -98,7 +98,7 @@ describe "interaction for <%= controller_class_name %>", type: :feature do
|
|
98
98
|
visit <%= path_helper_plural %>
|
99
99
|
find("a.edit-<%= singular %>-button[href='/<%= namespace_with_slash %><%= plural %>/#{<%= singular %>1.id}/edit']").click
|
100
100
|
|
101
|
-
expect(page).to have_content("Editing #{<%= singular
|
101
|
+
expect(page).to have_content("Editing #{<%= singular %>.<%= "abc" %>}")
|
102
102
|
<%=
|
103
103
|
@columns.map { |col|
|
104
104
|
type = eval("#{singular_class}.columns_hash['#{col}']").type
|
data/lib/hot-glue.rb
CHANGED
@@ -3,26 +3,12 @@ require "hotglue/engine"
|
|
3
3
|
require 'kaminari'
|
4
4
|
require 'haml-rails'
|
5
5
|
|
6
|
-
|
7
6
|
module HotGlue
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
# params.keys.each{|k|
|
15
|
-
# if k.ends_with?("_at") || k.ends_with?("_date")
|
16
|
-
#
|
17
|
-
# begin
|
18
|
-
# params[k] = DateTime.strptime("#{params[k]} #{use_timezone}", '%Y-%m-%dT%H:%M %z')
|
19
|
-
# rescue StandardError
|
20
|
-
#
|
21
|
-
# end
|
22
|
-
# end
|
23
|
-
# }
|
24
|
-
# end
|
25
|
-
# modified_params
|
26
|
-
# end
|
27
|
-
# end
|
8
|
+
|
9
|
+
|
10
|
+
module TemplateBuilders
|
11
|
+
|
12
|
+
end
|
28
13
|
end
|
14
|
+
|
data/lib/hotglue/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hot-glue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Fleetwood-Boldt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.1'
|
20
|
+
- - "<="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 7.0.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '5.1'
|
30
|
+
- - "<="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 7.0.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: kaminari
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +102,7 @@ dependencies:
|
|
96
102
|
version: '2.16'
|
97
103
|
description: Simple, plug & play Rails scaffold building companion for Turbo-Rails
|
98
104
|
and Hotwire
|
99
|
-
email:
|
105
|
+
email: code@jasonfb.net
|
100
106
|
executables: []
|
101
107
|
extensions: []
|
102
108
|
extra_rdoc_files: []
|
@@ -121,29 +127,48 @@ files:
|
|
121
127
|
- db/migrate/20210306225506_create_xyzs.rb
|
122
128
|
- db/schema.rb
|
123
129
|
- lib/generators/hot_glue/install_generator.rb
|
130
|
+
- lib/generators/hot_glue/markup_templates/base.rb
|
131
|
+
- lib/generators/hot_glue/markup_templates/erb.rb
|
132
|
+
- lib/generators/hot_glue/markup_templates/haml.rb
|
133
|
+
- lib/generators/hot_glue/markup_templates/slim.rb
|
124
134
|
- lib/generators/hot_glue/scaffold_generator.rb
|
125
|
-
- lib/generators/hot_glue/templates/_errors.haml
|
126
|
-
- lib/generators/hot_glue/templates/_flash_notices.haml
|
127
|
-
- lib/generators/hot_glue/templates/_form.haml
|
128
|
-
- lib/generators/hot_glue/templates/_line.haml
|
129
|
-
- lib/generators/hot_glue/templates/_list.haml
|
130
|
-
- lib/generators/hot_glue/templates/_new_button.haml
|
131
|
-
- lib/generators/hot_glue/templates/_new_form.haml
|
132
|
-
- lib/generators/hot_glue/templates/_show.haml
|
133
135
|
- lib/generators/hot_glue/templates/base_controller.rb.erb
|
134
136
|
- lib/generators/hot_glue/templates/controller.rb.erb
|
135
|
-
- lib/generators/hot_glue/templates/
|
136
|
-
- lib/generators/hot_glue/templates/
|
137
|
-
- lib/generators/hot_glue/templates/
|
138
|
-
- lib/generators/hot_glue/templates/
|
139
|
-
- lib/generators/hot_glue/templates/
|
140
|
-
- lib/generators/hot_glue/templates/
|
137
|
+
- lib/generators/hot_glue/templates/erb/_errors.erb
|
138
|
+
- lib/generators/hot_glue/templates/erb/_flash_notices.erb
|
139
|
+
- lib/generators/hot_glue/templates/erb/_form.erb
|
140
|
+
- lib/generators/hot_glue/templates/erb/_line.erb
|
141
|
+
- lib/generators/hot_glue/templates/erb/_list.erb
|
142
|
+
- lib/generators/hot_glue/templates/erb/_new_button.erb
|
143
|
+
- lib/generators/hot_glue/templates/erb/_new_form.erb
|
144
|
+
- lib/generators/hot_glue/templates/erb/_show.erb
|
145
|
+
- lib/generators/hot_glue/templates/erb/create.turbo_stream.erb
|
146
|
+
- lib/generators/hot_glue/templates/erb/destroy.turbo_stream.erb
|
147
|
+
- lib/generators/hot_glue/templates/erb/edit.erb
|
148
|
+
- lib/generators/hot_glue/templates/erb/edit.turbo_stream.erb
|
149
|
+
- lib/generators/hot_glue/templates/erb/index.erb
|
150
|
+
- lib/generators/hot_glue/templates/erb/new.erb
|
151
|
+
- lib/generators/hot_glue/templates/erb/update.turbo_stream.erb
|
152
|
+
- lib/generators/hot_glue/templates/haml/_errors.haml
|
153
|
+
- lib/generators/hot_glue/templates/haml/_flash_notices.haml
|
154
|
+
- lib/generators/hot_glue/templates/haml/_form.haml
|
155
|
+
- lib/generators/hot_glue/templates/haml/_line.haml
|
156
|
+
- lib/generators/hot_glue/templates/haml/_list.haml
|
157
|
+
- lib/generators/hot_glue/templates/haml/_new_button.haml
|
158
|
+
- lib/generators/hot_glue/templates/haml/_new_form.haml
|
159
|
+
- lib/generators/hot_glue/templates/haml/_show.haml
|
160
|
+
- lib/generators/hot_glue/templates/haml/create.turbo_stream.haml
|
161
|
+
- lib/generators/hot_glue/templates/haml/destroy.turbo_stream.haml
|
162
|
+
- lib/generators/hot_glue/templates/haml/edit.haml
|
163
|
+
- lib/generators/hot_glue/templates/haml/edit.turbo_stream.haml
|
164
|
+
- lib/generators/hot_glue/templates/haml/index.haml
|
165
|
+
- lib/generators/hot_glue/templates/haml/new.haml
|
166
|
+
- lib/generators/hot_glue/templates/haml/update.turbo_stream.haml
|
141
167
|
- lib/generators/hot_glue/templates/system_spec.rb.erb
|
142
|
-
- lib/generators/hot_glue/templates/update.turbo_stream.haml
|
143
168
|
- lib/hot-glue.rb
|
144
169
|
- lib/hotglue/engine.rb
|
145
170
|
- lib/hotglue/version.rb
|
146
|
-
homepage: https://
|
171
|
+
homepage: https://jasonfleetwoodboldt.com/hot-glue/
|
147
172
|
licenses:
|
148
173
|
- Nonstandard
|
149
174
|
metadata:
|
@@ -181,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
206
|
- !ruby/object:Gem::Version
|
182
207
|
version: '0'
|
183
208
|
requirements: []
|
184
|
-
rubygems_version: 3.
|
209
|
+
rubygems_version: 3.1.4
|
185
210
|
signing_key:
|
186
211
|
specification_version: 4
|
187
212
|
summary: A gem build scaffolding.
|