hot-glue 0.5.12 → 0.5.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +74 -0
  3. data/.github/workflows/test.yml +33 -14
  4. data/.gitignore +0 -2
  5. data/.ruby-version +1 -1
  6. data/Gemfile +4 -2
  7. data/Gemfile.lock +280 -0
  8. data/README.md +73 -1
  9. data/lib/generators/hot_glue/direct_upload_install_generator.rb +1 -1
  10. data/lib/generators/hot_glue/dropzone_install_generator.rb +1 -1
  11. data/lib/generators/hot_glue/field_factory.rb +4 -1
  12. data/lib/generators/hot_glue/fields/association_field.rb +73 -6
  13. data/lib/generators/hot_glue/fields/attachment_field.rb +7 -3
  14. data/lib/generators/hot_glue/fields/boolean_field.rb +21 -0
  15. data/lib/generators/hot_glue/fields/date_field.rb +13 -0
  16. data/lib/generators/hot_glue/fields/date_time_field.rb +14 -2
  17. data/lib/generators/hot_glue/fields/enum_field.rb +40 -7
  18. data/lib/generators/hot_glue/fields/field.rb +44 -4
  19. data/lib/generators/hot_glue/fields/float_field.rb +9 -0
  20. data/lib/generators/hot_glue/fields/integer_field.rb +5 -1
  21. data/lib/generators/hot_glue/fields/string_field.rb +17 -0
  22. data/lib/generators/hot_glue/fields/text_field.rb +17 -0
  23. data/lib/generators/hot_glue/fields/time_field.rb +20 -0
  24. data/lib/generators/hot_glue/fields/uuid_field.rb +2 -3
  25. data/lib/generators/hot_glue/flash_notices_install_generator.rb +20 -0
  26. data/lib/generators/hot_glue/install_generator.rb +16 -15
  27. data/lib/generators/hot_glue/markup_templates/erb.rb +14 -279
  28. data/lib/generators/hot_glue/scaffold_generator.rb +27 -9
  29. data/lib/generators/hot_glue/templates/controller.rb.erb +5 -4
  30. data/lib/generators/hot_glue/templates/erb/_edit.erb +12 -0
  31. data/lib/generators/hot_glue/templates/erb/_flash_notices.erb +12 -8
  32. data/lib/generators/hot_glue/templates/erb/_show.erb +1 -1
  33. data/lib/generators/hot_glue/templates/erb/create.turbo_stream.erb +3 -4
  34. data/lib/generators/hot_glue/templates/erb/destroy.turbo_stream.erb +7 -1
  35. data/lib/generators/hot_glue/templates/erb/edit.erb +1 -12
  36. data/lib/generators/hot_glue/templates/erb/update.turbo_stream.erb +3 -6
  37. data/lib/generators/hot_glue/templates/system_spec.rb.erb +1 -1
  38. data/lib/hot-glue.rb +4 -1
  39. data/lib/hotglue/version.rb +1 -1
  40. data/script/test +9 -14
  41. metadata +7 -19
  42. data/lib/generators/hot_glue/templates/erb/_errors.erb +0 -11
  43. data/lib/generators/hot_glue/templates/haml/_errors.haml +0 -6
  44. data/lib/generators/hot_glue/templates/haml/_flash_notices.haml +0 -8
  45. data/lib/generators/hot_glue/templates/haml/_form.haml +0 -5
  46. data/lib/generators/hot_glue/templates/haml/_line.haml +0 -6
  47. data/lib/generators/hot_glue/templates/haml/_list.haml +0 -15
  48. data/lib/generators/hot_glue/templates/haml/_new_button.haml +0 -2
  49. data/lib/generators/hot_glue/templates/haml/_new_form.haml +0 -7
  50. data/lib/generators/hot_glue/templates/haml/_show.haml +0 -7
  51. data/lib/generators/hot_glue/templates/haml/create.turbo_stream.haml +0 -14
  52. data/lib/generators/hot_glue/templates/haml/destroy.turbo_stream.haml +0 -2
  53. data/lib/generators/hot_glue/templates/haml/edit.haml +0 -19
  54. data/lib/generators/hot_glue/templates/haml/edit.turbo_stream.haml +0 -4
  55. data/lib/generators/hot_glue/templates/haml/index.haml +0 -8
  56. data/lib/generators/hot_glue/templates/haml/new.haml +0 -1
  57. data/lib/generators/hot_glue/templates/haml/update.turbo_stream.haml +0 -9
data/script/test CHANGED
@@ -4,34 +4,31 @@ clean_generated_code() {
4
4
  ./clean_generated_code
5
5
  }
6
6
 
7
-
8
-
9
7
  script/clean_generated_code
10
8
 
11
9
  echo "Integration test suite for Hot Glue..."
12
- # note that the dummy/ is in the root of the repository
13
- # these specs generate several controllers & specs and then run the generated
14
- # specs to test the generated code
10
+ echo "these specs generate several controllers & specs in the dummy app"
11
+ echo "and then run the generated specs to test the generated code"
15
12
 
16
13
  cd dummy
17
14
 
18
15
  echo "Setting up database..."
19
16
 
20
17
  bundle install
21
- rake db:create db:reset db:test:prepare
18
+ rake db:drop db:create db:migrate db:test:prepare
22
19
 
23
20
  echo "Generating all code for testing..."
24
- rails generate hot_glue:scaffold Abc --gd
21
+ bin/rails generate hot_glue:scaffold Abc --gd
25
22
 
26
- rails generate hot_glue:scaffold Ghi --gd
23
+ bin/rails generate hot_glue:scaffold Ghi --gd
27
24
 
28
- rails generate hot_glue:scaffold Dfg --auth=current_user
25
+ bin/rails generate hot_glue:scaffold Dfg --auth=current_user
29
26
 
30
- rails generate hot_glue:scaffold Fruits::Cantelope --gd
27
+ bin/rails generate hot_glue:scaffold Fruits::Cantelope --gd
31
28
 
32
- rails generate hot_glue:scaffold Pet --gd
29
+ bin/rails generate hot_glue:scaffold Pet --gd
33
30
 
34
- rails generate hot_glue:scaffold Human --gd
31
+ bin/rails generate hot_glue:scaffold Human --gd
35
32
 
36
33
  #rails generate hot_glue:scaffold User --no-create --self-auth
37
34
  #rails generate hot_glue:scaffold Jkl --gd
@@ -43,8 +40,6 @@ rails generate hot_glue:scaffold Human --gd
43
40
  # --alt-lookup-foreign-keys
44
41
  # --factory-creation
45
42
 
46
-
47
-
48
43
  rspec || exit
49
44
 
50
45
  cd ../
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hot-glue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.12
4
+ version: 0.5.15
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: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -59,12 +59,14 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".circleci/config.yml"
62
63
  - ".github/FUNDING.yml"
63
64
  - ".github/workflows/test.yml"
64
65
  - ".gitignore"
65
66
  - ".ruby-version"
66
67
  - ".travis.yml"
67
68
  - Gemfile
69
+ - Gemfile.lock
68
70
  - LICENSE
69
71
  - README.md
70
72
  - README2.md
@@ -92,6 +94,7 @@ files:
92
94
  - lib/generators/hot_glue/fields/text_field.rb
93
95
  - lib/generators/hot_glue/fields/time_field.rb
94
96
  - lib/generators/hot_glue/fields/uuid_field.rb
97
+ - lib/generators/hot_glue/flash_notices_install_generator.rb
95
98
  - lib/generators/hot_glue/hot_glue.rb
96
99
  - lib/generators/hot_glue/install_generator.rb
97
100
  - lib/generators/hot_glue/layout/builder.rb
@@ -106,7 +109,7 @@ files:
106
109
  - lib/generators/hot_glue/templates/capybara_login.rb
107
110
  - lib/generators/hot_glue/templates/computer_code.jpg
108
111
  - lib/generators/hot_glue/templates/controller.rb.erb
109
- - lib/generators/hot_glue/templates/erb/_errors.erb
112
+ - lib/generators/hot_glue/templates/erb/_edit.erb
110
113
  - lib/generators/hot_glue/templates/erb/_flash_notices.erb
111
114
  - lib/generators/hot_glue/templates/erb/_form.erb
112
115
  - lib/generators/hot_glue/templates/erb/_line.erb
@@ -121,21 +124,6 @@ files:
121
124
  - lib/generators/hot_glue/templates/erb/index.erb
122
125
  - lib/generators/hot_glue/templates/erb/new.erb
123
126
  - lib/generators/hot_glue/templates/erb/update.turbo_stream.erb
124
- - lib/generators/hot_glue/templates/haml/_errors.haml
125
- - lib/generators/hot_glue/templates/haml/_flash_notices.haml
126
- - lib/generators/hot_glue/templates/haml/_form.haml
127
- - lib/generators/hot_glue/templates/haml/_line.haml
128
- - lib/generators/hot_glue/templates/haml/_list.haml
129
- - lib/generators/hot_glue/templates/haml/_new_button.haml
130
- - lib/generators/hot_glue/templates/haml/_new_form.haml
131
- - lib/generators/hot_glue/templates/haml/_show.haml
132
- - lib/generators/hot_glue/templates/haml/create.turbo_stream.haml
133
- - lib/generators/hot_glue/templates/haml/destroy.turbo_stream.haml
134
- - lib/generators/hot_glue/templates/haml/edit.haml
135
- - lib/generators/hot_glue/templates/haml/edit.turbo_stream.haml
136
- - lib/generators/hot_glue/templates/haml/index.haml
137
- - lib/generators/hot_glue/templates/haml/new.haml
138
- - lib/generators/hot_glue/templates/haml/update.turbo_stream.haml
139
127
  - lib/generators/hot_glue/templates/javascript/dropzone_controller.js
140
128
  - lib/generators/hot_glue/templates/system_spec.rb.erb
141
129
  - lib/generators/hot_glue/templates/themes/hotglue_scaffold_dark_knight.scss
@@ -173,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
161
  - !ruby/object:Gem::Version
174
162
  version: '0'
175
163
  requirements: []
176
- rubygems_version: 3.3.7
164
+ rubygems_version: 3.4.10
177
165
  signing_key:
178
166
  specification_version: 4
179
167
  summary: A gem to build Tubro Rails scaffolding.
@@ -1,11 +0,0 @@
1
- <\%= turbo_frame_tag "errors" do %>
2
- <\% if resource.errors.any? %>
3
- <div id="error_explanation">
4
- <\% resource.errors.full_messages.each do |message| %>
5
- <div class="alert alert-danger">
6
- <\%= message %>
7
- </div>
8
- <\% end %>
9
- </div>
10
- <\% end %>
11
- <\% end %>
@@ -1,6 +0,0 @@
1
- = turbo_frame_tag "errors" do
2
- - if resource.errors.any?
3
- #error_explanation
4
- - resource.errors.full_messages.each do |message|
5
- %div.alert.alert-danger
6
- = message
@@ -1,8 +0,0 @@
1
- = turbo_frame_tag "flash_notices" do
2
- - unless notice.nil?
3
- %div.alert.alert-notice.alert-dismissible
4
- = notice
5
-
6
- - unless alert.nil?
7
- %div.alert.alert-danger.alert-dismissible
8
- = alert
@@ -1,5 +0,0 @@
1
- .row
2
- <%= form_fields_html %>
3
- .col
4
- = link_to "Cancel", <%= path_helper_plural %>, {class: "btn btn-secondary"}
5
- = f.submit "Save", class: "btn btn-primary pull-right"
@@ -1,6 +0,0 @@
1
- = turbo_frame_tag "<%= singular %>__#{<%= singular %>.id}" do
2
- .row{'data-id': <%= singular %>.id, 'data-edit': 'false'}
3
- = render partial: "<%= show_path_partial %>", locals: {<%= singular %>: <%= singular %> <%= nest_assignments_operator(false, true) %>}
4
-
5
-
6
-
@@ -1,15 +0,0 @@
1
- = turbo_frame_tag "<%= plural %>-list" do
2
- %div{class: "<%= @container_name %> <%= singular %>-table"}
3
- .row
4
- .col-md-12
5
- <%= '= render partial: "' + (@namespace+"/" if @namespace) + plural + '/new_button", locals: {' + nested_assignments + '}' unless @no_create %>
6
-
7
- .row
8
- <%= list_column_headings %>
9
- .col
10
- %div
11
- - if <%= plural %>.empty?
12
- None
13
- - <%= plural %>.each do |<%= singular %>|
14
- = render partial: '<%= line_path_partial %>', locals: {<%= singular %>: <%= singular %><%= nested_assignments_with_leading_comma if @nest %> }
15
- <%= @no_paginate ? "" : paginate %>
@@ -1,2 +0,0 @@
1
- = turbo_frame_tag "<%= singular %>-new" do
2
- = link_to "New <%= singular.titlecase %>", <%= new_path_name %>, disable_with: "Loading...", class: "new-<%= singular %>-button btn btn-primary pull-right"
@@ -1,7 +0,0 @@
1
- = turbo_frame_tag "<%= singular %>-new" do
2
- %h3
3
- New <%= singular.titlecase %>
4
-
5
- = form_with model: <%= singular %>, url: <%= path_helper_plural %>(<%= nested_objects_arity %>), method: "post" do |f|
6
- = render partial: "<%=namespace_with_slash%><%= @plural %>/form", locals: {<%= singular %>: <%= singular %>, f: f}
7
-
@@ -1,7 +0,0 @@
1
- <%= all_line_fields %>
2
- .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
- &nbsp;
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 "
@@ -1,14 +0,0 @@
1
- - if @<%= singular %>.errors.none?
2
- = turbo_stream.replace "<%= plural %>-list" do
3
- = render partial: "list", locals: {<%= plural %>: @<%= plural %> <%= nest_assignments_operator(true, true) %>}
4
-
5
- = turbo_stream.replace "<%= singular %>-new" do
6
- - if @<%= singular %>.errors.none?
7
- = render partial: "new_button", locals: {<%= nest_assignments_operator(true, false) %> }
8
- - else
9
- = render partial: "new_form", locals: {<%= singular %>: @<%= singular %> <%= nest_assignments_operator(true, true) %>}
10
-
11
- = turbo_stream.replace "flash_notices" do
12
- = render partial: "layouts/flash_notices"
13
- - if @<%= singular %>.errors.any?
14
- = render partial: "errors", locals: {resource: @<%= singular %>}
@@ -1,2 +0,0 @@
1
- = turbo_stream.replace "<%=plural%>-list" do
2
- = render partial: "list", locals: {<%=plural%>: @<%=plural%> <%= nest_assignments_operator(true, true) %>}
@@ -1,19 +0,0 @@
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
- .cell.editable{style: "position: relative;"}
5
- - if <%="@" + singular%>.errors.any?
6
- = render(partial: "#{controller.namespace}errors", locals: {resource: <%="@" + singular%>})
7
-
8
-
9
- Editing
10
- - if <%="@" + singular%>.try(:to_label)
11
- = <%="@" + singular%>.to_label
12
- - elsif <%="@" + singular%>.try(:name)
13
- = <%="@" + singular%>.name
14
- - else
15
- (no name)
16
-
17
- = form_with model: <%= "@" + singular%>, url: <%= path_helper_singular %>(<%= path_arity %>) do |f|
18
- = render partial: "form", locals: {:<%= singular %> => <%= "@" + singular%>, f: f}
19
-
@@ -1,4 +0,0 @@
1
-
2
- = turbo_stream.replace "<%= singular%>__#{@<%= singular %>.id}" do
3
- = render 'edit'
4
-
@@ -1,8 +0,0 @@
1
- %div{class: "#{@container_name }"}
2
- .row
3
- .col-md-12
4
- .clearfix
5
- = render partial: "<%= list_path_partial %>", locals: {<%= plural %>: @<%= plural %> <%= nest_assignments_operator(true, true) %>}
6
-
7
-
8
-
@@ -1 +0,0 @@
1
- = render partial: "new_form", locals: {<%=singular%>: @<%=singular%>}
@@ -1,9 +0,0 @@
1
-
2
- = turbo_stream.replace "<%= singular%>__#{@<%= singular %>.id}" do
3
- = render partial: 'line', locals: {<%= singular %>: @<%= singular %> <%= nested_assignments_with_leading_comma %> }
4
-
5
-
6
- = turbo_stream.replace "flash_notices" do
7
- = render partial: "layouts/flash_notices"
8
- - if @<%= singular %>.errors.any?
9
- = render partial: "errors", locals: {resource: @<%= singular %>}