turbo-rails 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/install/turbo_with_asset_pipeline.rb +6 -0
- data/lib/turbo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46e3c3f3a3e5ca9ce8fa61f1dc4736a049d042f2f88ca05a1dd2214be41dc787
|
4
|
+
data.tar.gz: c8f12c5aa54df4f9bedb6e61105db5f4505e1ac233530c8438c38440ccc09664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d6f250e4f2cb9da7ce3aaba9f4635eb559759ea3bcb7da736190c916a8d62dd31d0e55f226890a7239f6ae25b1274a92e7e03cae3e34c9198e2ef1cd8c4d2ed
|
7
|
+
data.tar.gz: c329e9503d82ec135ca670addadbaae27f491bb9629cf3df35325bf4e27be2ea95cd8bb981314ab6a6f0f152d53338da25743af00afb7971cb0d79214acb257d
|
@@ -1,4 +1,5 @@
|
|
1
1
|
APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
|
2
|
+
IMPORTMAP_PATH = Rails.root.join("app/assets/javascripts/importmap.json.erb")
|
2
3
|
|
3
4
|
if APPLICATION_LAYOUT_PATH.exist?
|
4
5
|
say "Yield head in application layout for cache helper"
|
@@ -7,6 +8,11 @@ if APPLICATION_LAYOUT_PATH.exist?
|
|
7
8
|
if APPLICATION_LAYOUT_PATH.read =~ /stimulus/
|
8
9
|
say "Add Turbo include tags in application layout"
|
9
10
|
insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(\n <%= javascript_include_tag "turbo", type: "module-shim" %>), after: /<%= stimulus_include_tags %>/
|
11
|
+
|
12
|
+
if IMPORTMAP_PATH.exist?
|
13
|
+
say "Add Turbo to importmap"
|
14
|
+
insert_into_file IMPORTMAP_PATH, %( "turbo": "<%= asset_path "turbo" %>",\n), after: / "imports": {\n/
|
15
|
+
end
|
10
16
|
else
|
11
17
|
say "Add Turbo include tags in application layout"
|
12
18
|
insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(\n <%= javascript_include_tag "turbo", type: "module" %>), before: /\s*<\/head>/
|
data/lib/turbo/version.rb
CHANGED