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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94c9c9d12f7b7318bb4e2eede2cb11e8c7f8ca2eb623d21d7c71c27005422f7a
4
- data.tar.gz: e2df4c5dc7d36d4c960dfeff36318e1ed36f0b94e386ce151bda33ecf8826131
3
+ metadata.gz: 46e3c3f3a3e5ca9ce8fa61f1dc4736a049d042f2f88ca05a1dd2214be41dc787
4
+ data.tar.gz: c8f12c5aa54df4f9bedb6e61105db5f4505e1ac233530c8438c38440ccc09664
5
5
  SHA512:
6
- metadata.gz: 40dac08e7447ab44a6d6924d60e8bc8c6d5fff7f88bc8f7ba00c54f957b9559e0d0202cb5ece9165fa571c81b9edd49cd83afc0d75f274c16fb44b193ade9578
7
- data.tar.gz: bf61cb90835e8aee3aca8c13728a91b488dae4cb903f3bede52f5991279c3587f9c3dd1eee8b04b450721d65f37d9687e69ad07a690a28d0e5d412932095ccbd
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>/
@@ -1,3 +1,3 @@
1
1
  module Turbo
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson