hot-glue 0.5.2 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f420219d9ff451f6fa20c743bef94003726a86c452fba51c8487f4d537d3c258
4
- data.tar.gz: c031f7ffe2fb832a17ce13bd78051296baec30ed279de3d6b7b73c04dfdfd3c3
3
+ metadata.gz: 4770a6dafa96c7d17e2104d7349caf126a7922c660b3055b29c6a7eab6e7d851
4
+ data.tar.gz: cd730bb99e9d9dad8ca5ee22a504a9e91ace01123ce900e11c7ccffae3e26630
5
5
  SHA512:
6
- metadata.gz: f72f3d5376e8b2ca6c50e3a7c8044b83ed6b62b550a91d1c2e76cf6a4b33eeab882ea760f67ee744e6d8e5c844ba1019a51368325eab5d5f4de56bd2edcbd768
7
- data.tar.gz: 3299ae7f5aff59f94b65b7fae3af98f31dc935e7aa3c3b132e41c05057ae790c1ee10e8888ef34ebe9d6e8ddf221f5dac7a3d1ce4a8261968bca2b5b59761739
6
+ metadata.gz: 5f59544515a51f85e494bd7a1ec7ee4586ab761919554f53ad751b845906e412a5cd80f65e1447183d79246e295abbb1fe468814ef572cd93888970603aafb7a
7
+ data.tar.gz: 045115777e9399ddffd06f9b400d44cc1d5e230579ea9d2017213cf74ae786efe2ae42d52639dbc60b496d0628f8a955c0d03807cd7262203de1961e0ecf87c8
@@ -0,0 +1,15 @@
1
+ name: Test
2
+ on: [ push, pull_request ]
3
+
4
+ jobs:
5
+ build:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v3
9
+ - name: Set up Ruby
10
+ uses: ruby/setup-ruby@v1
11
+ with:
12
+ # Not needed with a .ruby-version file
13
+ # runs 'bundle install' and caches installed gems automatically
14
+ bundler-cache: true
15
+ - run: script/test
data/.gitignore CHANGED
@@ -12,6 +12,8 @@ dump.rdb
12
12
  tmp/
13
13
 
14
14
 
15
+ Gemfile.lock
16
+
15
17
  db/*.sqlite3
16
18
 
17
19
  spec/dummy/app/views/
@@ -21,4 +23,4 @@ spec/dummy/specs/
21
23
  spec/dummy/node_modules/
22
24
  spec/dummy/log/
23
25
 
24
- coverage/
26
+ coverage/
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.2
data/.travis.yml CHANGED
@@ -9,7 +9,7 @@ branches:
9
9
  - main
10
10
 
11
11
 
12
- script: "rake spec"
12
+ script: "script/test"
13
13
 
14
14
  rvm:
15
- - 2.7.2
15
+ - 3.1.2
data/Gemfile CHANGED
@@ -8,14 +8,24 @@ gemspec
8
8
  # not required for your app
9
9
  gem 'sqlite3'
10
10
  gem 'byebug'
11
- gem 'rails'
12
- gem 'devise', require: true
13
11
  # gem 'progress_formatter'
14
12
 
15
13
  # for testing
16
- gem "rails-controller-testing", group: [:test]
17
- gem "database_cleaner", group: [:test]
18
- gem "rspec-rails", group: [:test]
19
- gem "rspec_junit_formatter", group: [:test]
20
- gem "factory_bot", group: [:test]
21
14
  gem 'simplecov-rcov'
15
+ gem 'rake'
16
+ gem "rspec-rails"
17
+ gem "factory_bot_rails"
18
+ gem "ffaker"
19
+ gem "capybara"
20
+ gem "selenium-webdriver"
21
+ gem "webdrivers"
22
+
23
+ gem "sprockets-rails"
24
+ gem "importmap-rails"
25
+ gem "stimulus-rails"
26
+ gem "turbo-rails"
27
+
28
+
29
+ gem "puma", "~> 5.0"
30
+
31
+ gem "devise"
data/LICENSE CHANGED
@@ -3,22 +3,8 @@ This software is 'fauxpen source,' which means you can think of it like 'free' a
3
3
 
4
4
  It is definitely 'free' as in Britney.
5
5
 
6
- FOR HOBBYISTS/STUDENTS/TEACHERS/INDIVIDUALS/NON-PROFITS:
7
-
8
- Permission is hereby granted to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
-
10
- Any users of this software agree to work to
11
- 1) dismantle systemic racism
12
- 2) seek justice for black, brown, transgender people, women, and
13
- 3) work towards LGBTQIAA+ representation and inclusion
14
- Organizations using this software agree to center the narratives of black, brown, transgender, and non-advantaged people in the world.
15
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
-
18
- Just sign the pledge at https://heliosdev.shop/hot-glue-license and your email will be granted lifetime usage access.
19
-
20
6
  TO PURCHASE A COMMERCIAL USAGE LICENSE PLEASE VISIT
21
7
  https://heliosdev.shop/hot-glue-license
22
8
 
23
- OR JUST BUY THE TUTORIAL (all purchases come with lifetime license)
24
- https://jfb.teachable.com/p/hot-glue-in-depth-tutorial
9
+ OR PURCHASE THE TUTORIAL (all purchases come with lifetime license)
10
+ https://jfbcodes.com/p/hot-glue-in-depth-tutorial
data/README.md CHANGED
@@ -1,13 +1,11 @@
1
1
 
2
- [![Hot Glue](https://circleci.com/gh/jasonfb/hot-glue.svg?style=shield)](https://circleci.com/gh/jasonfb/hot-glue)
2
+ ![Integrated Logo design-639x264](https://user-images.githubusercontent.com/59002/189544688-c1a8226f-9dbd-4758-bc0c-712fc2754cbd.png)
3
3
 
4
4
  Hot Glue is a Rails scaffold builder for the Turbo era. It is an evolution of the admin-interface style scaffolding systems of the 2010s ([activeadmin](https://github.com/activeadmin/activeadmin), [rails_admin](https://github.com/sferik/rails_admin), and [active_scaffold](https://github.com/activescaffold/active_scaffold)).
5
5
 
6
6
  Using Turbo-Rails and Hotwire (default in Rails 7) you get a lightning-fast out-of-the-box CRUD-building experience.
7
7
 
8
- Every page displays only a list view: new and edit operations happen as 'edit-in-place,' so the user never leaves the page.
9
-
10
- Because all page navigation is Turbo's responsibility, everything plugs & plays nicely into a Turbo-backed Rails app.
8
+ Every page displays only a list view: new and edit operations happen as 'edit-in-place,' so the user never leaves the page. Because all page navigation is Turbo's responsibility, everything plugs & plays nicely into a Turbo-backed Rails app.
11
9
 
12
10
  Alternatively, you can use this tool to create a Turbo-backed *section* of your Rails app -- such as an admin interface -- while still treating the rest of the Rails app as an API or building out other features by hand.
13
11
 
@@ -27,30 +25,26 @@ Hot Glue generates functionality that is quick and dirty. It lets you be crafty.
27
25
  * Nest your routes model-by-model for built-in poor man's authentication.
28
26
  * Throw the scaffolding away when your app is ready to graduate to its next phase.
29
27
 
28
+ How is it different than Rails scaffolding?
30
29
 
31
- # Get Hot Glue
32
- ## [Licence Only Option Now Available](https://heliosdev.shop/p/hot-glue/?utm_source=github.com&utm_campaign=github_hot_glue_readme_page) **only $50 USD!**
33
- ## [GET THE COURSE TODAY (includes Licence)](https://jfbcodes.com/courses/hot-glue-in-depth-tutorial/?utm_source=github.com&utm_campaign=github_hot_glue_readme_page) **only $60 USD!**
34
-
35
- | | |
36
- | ------------- | ------------- |
37
- | ![Teachable-225x225](https://user-images.githubusercontent.com/59002/147857335-a919e095-e6de-4718-8513-736d1f283a0b.png) | Now avaiale on [Teachable](https://jfbcodes.com/courses/hot-glue-in-depth-tutorial/?utm_source=github.com&utm_campaign=github_hot_glue_readme_page) |
30
+ Although inspired by the Rails scaffold generators (built-in to Rails), Hot Glue does something similiar but has made opinionated decisions that deviate from the normal Rails scaffold:
38
31
 
32
+ 1. The Hot Glue scaffolds are complete packages and pre-optimized for 'edit-in-place.' (the Rails scaffolds still generate views that make you flip between pages to do create/update operations)
33
+ 2. Hot Glue does not create your models along with your scaffolding. Instead, create them first using `rails model new`
34
+ 3. Hot Glue *reads* the fields on your database and the relationships defined on your models, so unlike the Rails scaffolding you must do that step before building your scaffolding.
35
+ 4. Hot Glue has many more features for building layouts quickly, like choosing which fields to include or exclude and how to lay them out on the page, for stiching together related objects (nesting and child portals), and more.
39
36
 
40
- ---
41
-
37
+ Other than the opinionated differences and additional features, Hot Glue produces code that is fundamentally very similiar and works consistent with the Rails 7 ways of working.
42
38
 
43
- ## NEW GETTING STARTED VIDEO
44
- The getting started video is newly updated with an explanation of the options for **`jsbundling-rails`/`cssbudling-rails`** when creating a new Rails 7 app.
39
+ # Get Hot Glue
45
40
 
46
- Check it out on Youtube at https://www.youtube.com/watch?v=bKjKHMTvzZc
41
+ ## [GET THE COURSE TODAY](https://jfbcodes.com/courses/hot-glue-in-depth-tutorial/?utm_source=github.com&utm_campaign=github_hot_glue_readme_page) **only $60 USD!**
47
42
 
48
- While you're over there could you give my Youtube channel a 'Subscribe'? (look for the RED SUBSCRIBE BUTTON) Thanks so much!
49
43
 
44
+ [![Hot Glue Course](https://user-images.githubusercontent.com/59002/189544503-6edbcd40-1728-4b13-ac9a-c7772ccb8284.jpg)](https://jfbcodes.com/courses/hot-glue-in-depth-tutorial/?utm_source=github.com&utm_campaign=github_hot_glue_readme_page)
50
45
 
51
46
  ---
52
-
53
-
47
+ ---
54
48
  ## HOW EASY?
55
49
 
56
50
  ```
@@ -71,43 +65,129 @@ _If you are on Rails 6, see [LEGACY SETUP FOR RAILS 6](https://github.com/jasonf
71
65
 
72
66
  ## 1. Rails 7 New App
73
67
 
74
- There are two ways to create new apps on Rails 7: With or Without ImportMap. These instructions prefer the **without Importmap** method using ESBuild as the bundler, but to help you choose [see this post](https://jasonfleetwoodboldt.com/courses/stepping-up-rails/rails-7-do-i-need-importmap-rails/)
68
+ To run Turbo (which Hot Glue requires), you must either (1) be running an ImportMap-Rails app, or (2) be running a Node-compiled app using any of JSBundling, Shakapacker, or its alternatives.
75
69
 
76
- `rails new --css=bootstrap --javascript=esbuild --database=postgresql`
70
+ For reference, see https://jasonfleetwoodboldt.com/courses/stepping-up-rails/rails-7-do-i-need-importmap-rails/
77
71
 
78
- **If using JSBundling, make sure to use the new `./bin/dev` to start your server instead of the old `rails server` or else your Turbo interactions will not work correctly.**
72
+ Once you create the new Rails app, you can skip to the 'Super-Quick Setup' below.
79
73
 
80
- Confirm that both Stimulus and Turbo are working.
74
+ (1) To use ImportMap Rails, start with
75
+ `rails new`
81
76
 
82
- For the quick step-by-step guide to help you confirm that both Stimulus and Turbo are working for your new JSBundling-Rails/CSSBunlding-Rails setup [see this post](https://jasonfleetwoodboldt.com/courses/stepping-up-rails/rails-7-new-app-with-js-bundling-css-bundling/).
77
+ (For full instructions to install Bootstrap with Importmap, check out [these instructions](https://jasonfleetwoodboldt.com/courses/stepping-up-rails/importmap-rails-with-bootstrap-sprockets-stimulus-and-turbo-long-tutorial/))
83
78
 
84
- (Note that Bootstrap is optional for Hot Glue. Here, I am just showing you the default installation for simplicity.)
79
+ (2) To use JSBundling, start with
80
+ `rails new --javascript=jsbundling`
85
81
 
86
- For the old method of installing Bootstrap [see this post](https://jasonfleetwoodboldt.com/courses/stepping-up-rails/rails-7-bootstrap/)
87
82
 
88
- Remember, for Rails 6 you must go through the [LEGACY SETUP FOR RAILS 6](https://github.com/jasonfb/hot-glue/README2.md) before continuing.
83
+ **If using JSBundling, make sure to use the new `./bin/dev` to start your server instead of the old `rails server` or else your Turbo interactions will not work correctly.**
84
+ (If you want Bootstrap for a JSBundling app, install it following [these instructions](https://jasonfleetwoodboldt.com/courses/stepping-up-rails/rails-7-up-running-with-jsbundling-esbuild-stimulus-turbo-bootstrap-circleci/))
85
+
86
+ (3) To use Shakapacker, start with `rails new --skip-javascript` and [see this post](https://jasonfleetwoodboldt.com/courses/react-heart-rails/rails-7-shakapacker-and-reactonrails-quick-setup-part-1/)
87
+
88
+ (For the old method of installing Bootstrap [see this post](https://jasonfleetwoodboldt.com/courses/stepping-up-rails/rails-7-bootstrap/))
89
+
90
+ (Remember, for Rails 6 you must go through the [LEGACY SETUP FOR RAILS 6](https://github.com/jasonfb/hot-glue/blob/main/README2.md) before continuing.)
91
+
92
+ If you doing the 'Super-Quick Setup', you can skip the additional blog posts linked above because the steps in them are covered in the shell script(s) below.
93
+
94
+ ## The Super-Quick Setup
95
+
96
+ Be sure to do `git add .` and `git commit -m "initial commit"` after creating your new Rails 7 app.
97
+
98
+ ```
99
+ bundle add rspec-rails factory_bot_rails ffaker --group "development, test" &&
100
+ git add . && git commit -m "adds gems" &&
101
+ rails generate rspec:install &&
102
+ git add . && git commit -m "adds rspec" &&
103
+ rm app/assets/stylesheets/application.css &&
104
+ echo "" > app/assets/stylesheets/application.scss &&
105
+ sed -i '' -e 's/# gem "sassc-rails"//g' Gemfile && sed -i '' -e 's/# Use Sass to process CSS//g' Gemfile &&
106
+ bundle install && bundle add sassc-rails && git add . && git commit -m "adds sassc-rails" &&
107
+ rm -rf test/ && git add . && git commit -m "removes minitest" &&
108
+ bundle add hot-glue && git add . && git commit -m "adds hot-glue" &&
109
+ rails generate hot_glue:install --layout=bootstrap &&
110
+ git add . && git commit -m "hot glue setup" &&
111
+ bundle add bootstrap &&
112
+ echo "\n@import 'bootstrap';\n" >> app/assets/stylesheets/application.scss
113
+ sed -i '' -e 's/# Rails.application.config.assets.precompile += %w( admin.js admin.css )/Rails.application.config.assets.precompile += %w( application.scss )/g' config/initializers/assets.rb &&
114
+ sed -i '' -e 's/Rails.application.configure do/Rails.application.configure do\n config.sass.inline_source_maps = true/g' config/environments/development.rb
115
+ git add . && git commit -m "bootstrap install" &&
116
+ bundle add font_awesome5_rails &&
117
+ echo "\n@import 'font_awesome5_webfont';\n" >> app/assets/stylesheets/application.scss
118
+ git add . && git commit -m "adds fontawesome" &&
119
+ bundle add kaminari &&
120
+ rails generate kaminari:views bootstrap4 &&
121
+ git add . && git commit -m "adding kaminari and views" &&
122
+ bundle add devise && bundle install &&
123
+ git add . && git commit -m "adding devise gem" &&
124
+ rails generate devise:install &&
125
+ rails g devise:views &&
126
+ sed -i '' -e 's/Rails.application.configure do/Rails.application.configure do\n config.action_mailer.default_url_options = { host: "localhost", port: 3000 }/g' config/environments/development.rb &&
127
+ sed -i '' -e 's/# root "articles#index"//g' config/routes.rb &&
128
+ sed -i '' -e 's/Rails.application.routes.draw do/Rails.application.routes.draw do\n root to: "welcome#index"/g' config/routes.rb &&
129
+ git add . && git commit -m 'devise view fixes' &&
130
+ rails generate controller Welcome &&
131
+ sed -i '' -e 's/class WelcomeController < ApplicationController/class WelcomeController < ApplicationController\n def index\n\n end/g' app/controllers/welcome_controller.rb &&
132
+ echo "hello world" > app/views/welcome/index.erb &&
133
+ git add . && git commit -m "generates Welcome controller" &&
134
+ sed -i '' -e 's/html: { method: :post }/html: { method: :post, 'data-turbo': false}/g' app/views/devise/confirmations/new.html.erb &&
135
+ sed -i '' -e 's/ url: session_path(resource_name))/ url: session_path(resource_name), html: {"data-turbo": false})/g' app/views/devise/sessions/new.html.erb &&
136
+ sed -i '' -e 's/ url: registration_path(resource_name))/ url: registration_path(resource_name), html: {"data-turbo": false})/g' app/views/devise/registrations/new.html.erb &&
137
+ sed -i '' -e 's/, html: { method: :post })/, html: { method: :post, "data-turbo": false })/g' app/views/devise/passwords/new.html.erb &&
138
+ git add . && git commit -m 'devise view fixes' &&
139
+ rails generate model User name:string &&
140
+ rails generate devise User && git add . && git commit -m "adds Users model with devise" &&
141
+ rails db:migrate &&
142
+ git add . && git commit -m "schema file"
143
+ ```
89
144
 
90
- ## 2. ADD RSPEC, FACTORY-BOT, AND FFAKER
91
145
 
92
- add these 3 gems to your gemfile **inside a group for both :development and :test*. Do not add these gems to only the :test group or else your will have problems with the generators.
146
+ For Importmap apps:
93
147
  ```
94
- gem 'rspec-rails'
95
- gem 'factory_bot_rails'
96
- gem 'ffaker'
148
+ ./bin/importmap pin "bootstrap@5.1.3" &&
149
+ ./bin/importmap pin "@popperjs/core@2.11.2" &&
150
+ git add . && git commit -m "pinning boostrap and popper js for bootstrap"
97
151
  ```
98
152
 
153
+ For JSBundling & Shakapacker:
154
+ ```
155
+ echo "\ncss: yarn build:css --watch\n" >> Procfile.dev &&
156
+ yarn add @popperjs/core bootstrap bootstrap-icons sass &&
157
+ sed -i '' -e 's/\/\/= link_directory ..\/stylesheets .css//g' app/assets/config/manifest.js &&
158
+ sed -i '' -e 's/ "scripts": {/ "scripts": {\n "build:css": "sass .\/app\/assets\/stylesheets\/application.scss:.\/app\/assets\/builds\/application.css --no-source-map --load-path=node_modules",/g' package.json &&
159
+ yarn install &&
160
+ git add . && git commit -m "adding bootstrap packages"
161
+ ```
162
+
163
+
164
+ ## Step-By-Step Setup
165
+
166
+ ### 2. ADD RSPEC, FACTORY-BOT, AND FFAKER
167
+
168
+ add these 3 gems to your gemfile **inside a group for both :development and :test*.
169
+ Do not add these gems to *only* the :test group or else your Rspec installer and generators will not work correctly.
170
+ ```
171
+ group :development, :test do
172
+ gem 'rspec-rails'
173
+ gem 'factory_bot_rails'
174
+ gem 'ffaker'
175
+ end
176
+ ```
177
+
178
+ #### Rspec Installer
99
179
  - run `rails generate rspec:install`
100
180
 
181
+ - Because you are not using Minitest, you can delete the `test/` folder at the root of your repository.
101
182
 
102
183
 
103
- ## 3. HOTGLUE INSTALLER
104
- Add `gem 'hot-glue'` to your Gemfile & `bundle install`
105
184
 
106
- Purchase a license at https://heliosdev.shop/p/hot-glue
185
+ ### 3. HOTGLUE INSTALLER
186
+ Add `gem 'hot-glue'` to your Gemfile & `bundle install`
107
187
 
108
188
  During in installation, you MUST supply a `--layout` flag.
109
189
 
110
- ### `--layout` flag (only two options: `hotglue` or `bootstrap`; default is `bootstrap`)
190
+ #### `--layout` flag (only two options: `hotglue` or `bootstrap`; default is `bootstrap`)
111
191
  Here you will set up and install Hot Glue for the first time.
112
192
 
113
193
  It will install a config file that will save two preferences: layout (`hotglue` or `bootstrap`)
@@ -115,7 +195,7 @@ It will install a config file that will save two preferences: layout (`hotglue`
115
195
  The installer will create `config/hot_glue.yml`.
116
196
 
117
197
 
118
- ### `--theme` flag
198
+ #### `--theme` flag
119
199
  During the installation, **if** your `--layout` flag is set to `hotglue` you must also pass `--theme` flag.
120
200
 
121
201
  the themes are:
@@ -126,21 +206,21 @@ the themes are:
126
206
  • like_cupertino (modern Apple-UX inspired)
127
207
 
128
208
 
129
- ### `--markup` flag (NOTE: haml and slim are no longer supported at this time)
209
+ #### `--markup` flag (NOTE: haml and slim are no longer supported at this time)
130
210
 
131
211
  default is `erb`. IMPORTANT: As of right now, HAML and SLIM are not currently supported so the only option is also the default `erb`.
132
212
 
133
213
 
134
- ### example installing ERB using Bootstrap layout:
214
+ #### example installing ERB using Bootstrap layout:
135
215
  `rails generate hot_glue:install --markup=erb --layout=bootstrap`
136
216
 
137
- ### Example installing using Hot Glue layout and the 'like_mountain_view' (Gmail-inspired) theme:
217
+ #### Example installing using Hot Glue layout and the 'like_mountain_view' (Gmail-inspired) theme:
138
218
  `rails generate hot_glue:install --markup=erb --layout=hotglue --theme=like_mountain_view`
139
219
 
140
220
  The Hot Glue installer did several things for you in this step. Examine the git diffs or see 'Hot Glue Installer Notes' below.
141
221
 
142
222
 
143
- ## 4. install font-awesome (optional)
223
+ ### 4. Font-awesome (optional)
144
224
 
145
225
  I recommend
146
226
  https://github.com/tomkra/font_awesome5_rails
@@ -148,14 +228,9 @@ or
148
228
  https://github.com/FortAwesome/font-awesome-sass
149
229
 
150
230
 
151
- ## 5. Devise
152
- !!! Warning: as of 2022-03-22, Devise is still not compatible out-of-the-box with Rails 7.
153
-
154
- please see https://github.com/heartcombo/devise/issues/5478 or check this README for updated information.
155
-
156
-
231
+ ### 5. Devise
157
232
  (If you are on Rails 6, you must do ALL of the steps in the Legacy Setup steps. Be sure not to skip **Legacy Step #5** below)
158
-
233
+ https://github.com/jasonfb/hot-glue/blob/main/README2.md
159
234
 
160
235
  You MUST run the installer FIRST or else you will put your app into a non-workable state:
161
236
  ```
@@ -183,13 +258,26 @@ Those features come by default with Devise, and you'll find the fields for them
183
258
  In this example above, you are creating all of those fields along with a simple 'name' (string) field for your User table.
184
259
 
185
260
 
261
+ !!! Warning: as of 2022-09-19, Devise is still not compatible out-of-the-box with Rails Turbo.
262
+
263
+ To fix this, run
264
+ `rails generate devise:views`
265
+
186
266
 
267
+ Then manually add `html: {'data-turbo' => "false"}` to all of the Devise forms. You will need to edit the following forms:
268
+ `views/devise/sessions/new.html.erb`, `views/devise/registrations/edit.html.erb`,
269
+ `views/devise/registrations/new.html.erb`, and
187
270
 
188
- ### Hot Glue Installer Notes
271
+ Add the data-turbo false option in the html key of the form, shown in bold here:
272
+
273
+ form_for(resource, as: resource_name, **html: {'data-turbo' => "false"},** url: session_path(resource_name) ) do |f|
274
+
275
+
276
+ #### Hot Glue Installer Notes
189
277
 
190
278
  These things were **done for you** in Step #3 (above). You don't need to think about them but if you are familiar with Capybara and/or adding Hot Glue to an existing app, you may want to:
191
279
 
192
- #### Hot Glue modified `application.html.erb`
280
+ ##### Hot Glue modified `application.html.erb`
193
281
  Note: if you have some kind of non-standard application layout, like one at a different file
194
282
  or if you have modified your opening <body> tag, this may not have been automatically applied by the installer.
195
283
 
@@ -198,7 +286,7 @@ or if you have modified your opening <body> tag, this may not have been automati
198
286
  <%= render partial: 'layouts/flash_notices' %>
199
287
  ```
200
288
 
201
- #### Hot Glue modified `rails_helper.rb`
289
+ ##### Hot Glue modified `rails_helper.rb`
202
290
  Note: if you have some kind of non-standard rails_helper.rb, like one that does not use the standard ` do |config|` syntax after your `RSpec.configure`
203
291
  this may not have been automatically applied by the installer.
204
292
 
@@ -211,7 +299,7 @@ this may not have been automatically applied by the installer.
211
299
  ```
212
300
 
213
301
 
214
- #### Hot Glue switched Capybara from RACK-TEST to HEADLESS CHROME
302
+ ##### Hot Glue switched Capybara from RACK-TEST to HEADLESS CHROME
215
303
 
216
304
  - By default Capybara is installed with :rack_test as its driver.
217
305
  - This does not support Javascript. Hot Glue is not targeted for fallback browsers.
@@ -251,7 +339,7 @@ Alternatively, you can define your own driver like so:
251
339
 
252
340
  ```
253
341
 
254
- #### Hot Glue Added a Quick (Old-School) Capybara Login For Devise
342
+ ##### Hot Glue Added a Quick (Old-School) Capybara Login For Devise
255
343
 
256
344
  - for a quick Capybara login, create a support helper in `spec/support/` and log-in as your user
257
345
  - in the default code, the devise login would be for an object called account and lives at the route `/accounts/sign_in`
@@ -269,7 +357,7 @@ Alternatively, you can define your own driver like so:
269
357
 
270
358
  ---
271
359
  ---
272
-
360
+ ---
273
361
 
274
362
  # HOT GLUE DOCS
275
363
 
@@ -278,6 +366,9 @@ Alternatively, you can define your own driver like so:
278
366
 
279
367
  TitleCase class name of the thing you want to build a scaffoling for.
280
368
 
369
+ rails generate hot_glue:scaffold Thing
370
+
371
+ (note: Your Thing object must belong_to an authenticated User or alternatively you must create a Gd controller, see below.)
281
372
 
282
373
  ## Options With Arguments
283
374
 
@@ -502,14 +593,12 @@ An better alternative is to define the non-standard plurlizations globally in yo
502
593
  Make a file at `config/initializers/inflections.rb`
503
594
 
504
595
  # Add new inflection rules using the following format
596
+ ```
505
597
  ActiveSupport::Inflector.inflections do |inflect|
506
598
  inflect.irregular 'clothing', 'clothes'
507
599
  inflect.irregular 'human', 'humans'
508
-
509
-
510
- # the standard pluralization is pretty sexist and will pluralize `human` to `humen`
511
600
  end
512
-
601
+ ```
513
602
 
514
603
  ### `--form-labels-position` (default: `after`; options are **before**, **after**, and **omit**)
515
604
  By default form labels appear after the form inputs. To make them appear before or omit them, use this flag.
@@ -528,8 +617,6 @@ If you specify any exclude list, those excluded **and** the default exclude list
528
617
 
529
618
  `rails generate hot_glue:scaffold Account --exclude=password`
530
619
 
531
- (The default excluded list is: If you want to edit any fields with the same name, you must use the include flag instead.)
532
-
533
620
 
534
621
  ### `--include=`
535
622
  Separate field names by COMMA
@@ -766,8 +853,19 @@ Sometimes you might want to redisplay the entire list after you make an update (
766
853
 
767
854
  To do this, use flag `--display-list-after-update`. The update will behave like delete and re-fetch all the records in the result and tell Turbo to swap out the entire list.
768
855
 
856
+ ### `--with-turbo-streams`
857
+
858
+ If and only if you specify `--with-turbo-streams`, your views will contain `turbo_stream_from` directives. Whereas your views will always contain `turbo_frame_tags` (wether or not this flag is specified) and will use the Turbo stream replacement mechanism for non-idempotent actions (create & update). This flag just brings the magic of live-reload to the scaffold interfaces themselves.
769
859
 
860
+ **_To test_**: Open the same interface in two separate browser windows. Make an edit in one window and watch your edit appear in the other window instantly.
770
861
 
862
+ This happens using two interconnected mechanisms:
863
+
864
+ 1) by default, all Hot Glue scaffold is wrapped in `turbo_frame_tag`s. The id of these tags is your namespace + the Rails dom_id(...). That means all Hot Glue scaffold is namespaced to the namespaces you use and won't collide with other turbo_frame_tag you might be using elsewhere
865
+
866
+ 2) by appending **model callbacks**, we can automatically broadcast updates to the users who are using the Hot Glue scaffold. The model callbacks (after_update_commit and after_destroy_commit) get appended automatically to the top of your model file. Each model callback targets the scaffold being built (so just this scaffold), using its namespace, and renders the line partial (or destroys the content in the case of delete) from the scaffolding.
867
+
868
+ please note that *creating* and *deleting* do not yet have a full & complete implementation: Your pages won't re-render the pages being viewed cross-peer (that is, between two users using the app at the same time) if the insertion or deletion causes the pagination to be off for another user.
771
869
 
772
870
 
773
871
  ## Automatic Base Controller
@@ -807,12 +905,26 @@ Child portals have the headings omitted automatically (there is a heading identi
807
905
 
808
906
  # VERSION HISTORY
809
907
 
810
- #### ???? - v0.5.2 - Hawked Foreign Keys
908
+ #### 2022-11-27 - v0.5.4 - new flag --with-turbo-streams will append callbacks after_update_commit and after_destroy_commit to the MODEL you are building with to use turbo to target the scaffolding being built and programmatically update it
909
+
910
+ Adds `--with-turbo-streams`. Use `--with-turbo-streams` to create hot (live reload) interfaces. See docs above.
811
911
 
812
912
 
913
+ #### 2022-11-24 - v0.5.3 - New testing paradigm & removes license requirements
813
914
 
915
+ New testing paradigm
916
+ Code cleanup
917
+ Testing on CircleCI
918
+ License check has been removed (Hot Glue is now free to use for hobbyists and individuals. Business licenses are still available at https://heliosdev.shop/hot-glue-license)
814
919
 
815
920
 
921
+ #### 2022-03-23 - v0.5.2 - Hawked Foreign Keys
922
+
923
+ - You can now protect your foreign keys from malicious input and also restrict the scope of drop downs to show only records with the specified access control restriction.
924
+ - [Example #3](https://jfb.teachable.com/courses/hot-glue-in-depth-tutorial/lectures/38584014) in the Hot Glue Tutorial shows you how to use the hawk to limit the scope to the logged in user.
925
+ - [Example #4](https://jfb.teachable.com/courses/hot-glue-in-depth-tutorial/lectures/38787505) in the Hot Glue Tutorial shows how to hawk to a non-usual scope, the inverse of the current user's belongs_to (that is, hawk the scope to X where current_user `belongs_to :x`)
926
+
927
+
816
928
  #### 2022-03-12 - v0.5.1 - Inline List Labels
817
929
 
818
930
  `--inline-list-labels` (default: `after`; options are **before**, **after**, and **omit**)
@@ -872,8 +984,6 @@ Omits the list heading. Note that the listing heading is omitted:
872
984
  3) if the model has `@@table_label_plural = nil`, or
873
985
  4) if you are constructing a nested child portal with only non-optionalized parents.
874
986
 
875
-
876
-
877
987
  #### 2022-02-09 - v0.4.8.1 - Issue with Installer for v0.4.8
878
988
  - There was an issue for the installer for v0.4.8. This new version v0.4.8.1 correts it.
879
989
 
@@ -958,47 +1068,33 @@ Omits the list heading. Note that the listing heading is omitted:
958
1068
  #### 2021-02-24 - v0.0.1 - first proof of concept release -- basic CRUD works
959
1069
 
960
1070
 
961
-
962
1071
  # HOW THIS GEM IS TESTED
963
1072
 
964
- SETUP:
965
- • Run bundle install
966
- • if you can't get through see https://stackoverflow.com/questions/68050807/gem-install-mimemagic-v-0-3-10-fails-to-install-on-big-sur/68170982#68170982
967
-
968
-
969
- The dummy sandbox is found at `spec/dummy`
970
-
971
- The dummy sandbox lives as mostly checked- into the repository, **except** the folders where the generated code goes (`spec/dummy/app/views/`, `spec/dummy/app/controllers/`, `spec/dummy/specs/` are excluded from Git)
1073
+ The gem is tested against both generated specs and internal specs. The generated specs are regenerated with the test run, whereas the internal specs live as artifacts in the codebase as you would normally expected specs would.
972
1074
 
973
- When you run the **internal specs**, which you can do **at the root of this repo** using the command `rspec`, a set of specs will run to assert the generators are erroring when they are supposed to and producing code when they are supposed to.
974
-
975
- The DUMMY testing DOES NOT test the actual functionality of the output code (it just tests the functionality of the generation process).
1075
+ The generated specs are created with a small set of 'starter seeds' that exercise the gem's featureset. You can examine the setup easily by looking at the contents of `script/test`
976
1076
 
1077
+ • To setup for testing, start with
1078
+ ```
1079
+ sudo gem install rails
1080
+ sudo gem install rspec
1081
+ ```
977
1082
 
978
- # DATABASE
979
- being able to run `rake spec` at the root of this repo is achieved using
980
1083
  ```
981
- ln -s spec/dummy/db/schema.rb db/schema.rb
1084
+ sudo gem install minitest -v 5.1.0
982
1085
  ```
983
1086
 
984
-
1087
+ Unfortunately because of the wrapped nature of the specs, these must be run from globally installed Rubies.
985
1088
 
986
- Run rspec as
987
- ```
988
- rake spec
989
- ```
990
- Or with test coverage report:
1089
+ Once you've done the above, run `script/test`
991
1090
 
992
- ```
993
- COVERGE=on rake spec
1091
+ This runs both the **generated specs** and also the **internal specs**. Examine this file for details.
994
1092
 
995
- ```
1093
+ To run only the internal specs, use
996
1094
 
997
- --
998
- --
999
-
1000
- Test coverage as of 2022-02-14 (v0.4.9)
1095
+ `COVERGE=on rspec spec`
1001
1096
 
1002
- ![Screen Shot 2022-02-14 at 8 33 29 PM](https://user-images.githubusercontent.com/59002/153975911-30fa9c84-c8d8-49e7-bd5c-e2b958d6f10e.png)
1097
+ Internal Test coverage as of 2022-03-23 (v0.5.2)
1003
1098
 
1099
+ ![HG 84 89 coverage report](https://user-images.githubusercontent.com/59002/159719583-a956cfb3-1797-4186-b32c-237ed19e8e2b.png)
1004
1100
 
data/README2.md CHANGED
@@ -71,9 +71,7 @@ Edit `devise/registrations/new`, `devise/sessions/new`, `devise/passwords/new` a
71
71
  form_for(resource, as: resource_name, url: session_path(resource_name) ) do |f|
72
72
 
73
73
  add the data-turbo false option in the html key:
74
- ```bigquery
75
74
 
76
- ```
77
75
  form_for(resource, as: resource_name, **html: {'data-turbo' => "false"},** url: session_path(resource_name) ) do |f|
78
76
 
79
77
  This tells Devise to fall back to non-Turbo interaction for the log-in and registration. For the rest of the app, we will use Turbo Rails interactions.
data/config/database.yml CHANGED
@@ -1,11 +1,25 @@
1
- development:
2
- adapter: postgresql
3
- database: dummy_dev
4
- pool: 5
1
+ # SQLite. Versions 3.8.0 and up are supported.
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: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
5
10
  timeout: 5000
6
11
 
12
+ development:
13
+ <<: *default
14
+ database: dummy/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.
7
19
  test:
8
- adapter: postgresql
9
- database: dummy_test
10
- pool: 5
11
- timeout: 5000
20
+ <<: *default
21
+ database: dummy/db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: dummy/db/production.sqlite3