hot-glue 0.5.3 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +0 -1
- data/.gitignore +12 -5
- data/README.md +162 -42
- data/lib/generators/hot_glue/install_generator.rb +13 -13
- data/lib/generators/hot_glue/layout/builder.rb +11 -8
- data/lib/generators/hot_glue/layout_strategy/base.rb +31 -0
- data/lib/generators/hot_glue/layout_strategy/bootstrap.rb +41 -0
- data/lib/generators/hot_glue/layout_strategy/hot_glue.rb +82 -0
- data/lib/generators/hot_glue/layout_strategy/tailwind.rb +28 -0
- data/lib/generators/hot_glue/markup_templates/base.rb +3 -3
- data/lib/generators/hot_glue/markup_templates/erb.rb +90 -80
- data/lib/generators/hot_glue/scaffold_generator.rb +103 -110
- data/lib/generators/hot_glue/templates/controller.rb.erb +14 -40
- data/lib/generators/hot_glue/templates/erb/_form.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/_line.erb +3 -3
- data/lib/generators/hot_glue/templates/erb/_list.erb +6 -11
- data/lib/generators/hot_glue/templates/erb/_new_button.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/_new_form.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/_show.erb +3 -3
- data/lib/generators/hot_glue/templates/erb/create.turbo_stream.erb +2 -2
- data/lib/generators/hot_glue/templates/erb/destroy.turbo_stream.erb +2 -2
- data/lib/generators/hot_glue/templates/erb/edit.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/edit.turbo_stream.erb +1 -1
- data/lib/generators/hot_glue/templates/erb/index.erb +3 -6
- data/lib/generators/hot_glue/templates/erb/update.turbo_stream.erb +1 -1
- data/lib/generators/hot_glue/templates/system_spec.rb.erb +3 -1
- data/lib/hot-glue.rb +0 -4
- data/lib/hotglue/engine.rb +1 -1
- data/lib/hotglue/version.rb +1 -1
- metadata +6 -3
- data/lib/generators/hot_glue/helpers.rb +0 -13
@@ -1,14 +1,11 @@
|
|
1
1
|
<% if @menu_file_exists %><\%= render partial: "<%= namespace_with_trailing_dash %>menu", locals: {active: '<%= plural %>'} %><% end %>
|
2
2
|
|
3
3
|
<div class="<%= @container_name %>">
|
4
|
-
|
5
|
-
<%
|
6
|
-
<div class=' scaffold-index-<%= plural %>'>
|
7
|
-
<% end %>
|
4
|
+
<%= @layout_strategy.page_begin %>
|
5
|
+
<% if include_nav_template %><\%= render partial: "<%= nav_template %>", locals: {nav: "<%= @plural %>"} %><% end %>
|
8
6
|
|
9
|
-
<div class="clearfix"></div>
|
10
7
|
<\%= render partial: '<%= list_path_partial %>',
|
11
8
|
locals: {<%= plural %>: @<%= plural %>}<%= @nested_set.collect{|arg| ".merge(@" + arg[:singular] + " ? {nested_for: \"" + arg[:singular] + "-\#{@" + arg[:singular] + ".id}\"" + ", " + arg[:singular] + ": @" + arg[:singular] + "} : {})"}.join() %> \%>
|
12
9
|
|
13
|
-
|
10
|
+
<%= @layout_strategy.page_end %>
|
14
11
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% if !@display_list_after_update %><\%= turbo_stream.replace "<%=
|
1
|
+
<% if !@display_list_after_update %><\%= turbo_stream.replace "<%= namespace %>__#{dom_id(@<%= singular %>)}" do %>
|
2
2
|
<\%= render partial: 'line', locals: {<%= singular %>: @<%= singular %> }<%= @nested_set.collect{|arg| ".merge(@#{arg[:singular]} ? {#{arg[:singular]}: @#{arg[:singular]}} : {})" }.join %> \%>
|
3
3
|
<\% end %><% else %><\%= turbo_stream.replace "<%= plural %>-list" do %>
|
4
4
|
<\%= render partial: '<%= list_path_partial %>', locals: {<%= plural %>: @<%= plural %>}<%= @nested_set.collect{|arg| ".merge(@#{arg[:singular]} ? {#{arg[:singular]}: @#{arg[:singular]}} : {})" }.join %> \%>
|
@@ -2,6 +2,8 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
describe "interaction for <%= controller_class_name %>", type: :feature do
|
4
4
|
include HotGlue::ControllerHelper
|
5
|
+
include ActionView::RecordIdentifier
|
6
|
+
|
5
7
|
<%= @existing_content %>
|
6
8
|
<% unless @god %>let(:<%= @auth %>) {create(:<%= @auth.gsub('current_', '') %>)}<%end%>
|
7
9
|
<%= (@columns - @show_only).map { |col|
|
@@ -118,7 +120,7 @@ describe "interaction for <%= controller_class_name %>", type: :feature do
|
|
118
120
|
expect(page).to have_content("Editing #{<%= singular %>1.<%= @display_class %>.squish || "(no name)"}")
|
119
121
|
<%= test_capybara_block %>
|
120
122
|
click_button "Save"
|
121
|
-
within("turbo-frame#<%=
|
123
|
+
within("turbo-frame#<%= @namespace %>__#{dom_id(<%= singular %>1)} ") do
|
122
124
|
<%=
|
123
125
|
(@columns - @show_only).map { |col|
|
124
126
|
type = eval("#{singular_class}.columns_hash['#{col}']").type
|
data/lib/hot-glue.rb
CHANGED
data/lib/hotglue/engine.rb
CHANGED
data/lib/hotglue/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.5
|
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: 2022-
|
11
|
+
date: 2022-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -75,9 +75,12 @@ files:
|
|
75
75
|
- config/database.yml
|
76
76
|
- config/hot_glue.yml
|
77
77
|
- db/schema.rb
|
78
|
-
- lib/generators/hot_glue/helpers.rb
|
79
78
|
- lib/generators/hot_glue/install_generator.rb
|
80
79
|
- lib/generators/hot_glue/layout/builder.rb
|
80
|
+
- lib/generators/hot_glue/layout_strategy/base.rb
|
81
|
+
- lib/generators/hot_glue/layout_strategy/bootstrap.rb
|
82
|
+
- lib/generators/hot_glue/layout_strategy/hot_glue.rb
|
83
|
+
- lib/generators/hot_glue/layout_strategy/tailwind.rb
|
81
84
|
- lib/generators/hot_glue/markup_templates/base.rb
|
82
85
|
- lib/generators/hot_glue/markup_templates/erb.rb
|
83
86
|
- lib/generators/hot_glue/scaffold_generator.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class HotGlue::Helpers
|
2
|
-
|
3
|
-
|
4
|
-
def self.open_page( link)
|
5
|
-
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
6
|
-
system "start #{link}"
|
7
|
-
elsif RbConfig::CONFIG['host_os'] =~ /darwin/
|
8
|
-
system "open #{link}"
|
9
|
-
elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/
|
10
|
-
system "xdg-open #{link}"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|