turbo-rails 0.7.14 → 0.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/turbo.js +6 -1
- data/lib/install/turbo_needs_redis.rb +11 -1
- data/lib/tasks/turbo_tasks.rake +2 -2
- data/lib/turbo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab24210e4f0dd28243c220d5b586b69705e2b18b50251daa22e8cd6d861fc9f5
|
4
|
+
data.tar.gz: 7379f1f27936571fe482807459f18f773c041d36ae539cd0e1750dd5ade8489b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa92baea7d57b563f9c802e3a595a870f5c3fe38402c49720cd34908a6c396a3fcdb503fc8be035407ff3c8bdad8bcb81294fa83d81dc2e53d676de49da5cd50
|
7
|
+
data.tar.gz: b3a8d8bd0ff379e6dd40c8a41e53aa413c914c04cdf9cc2408fc1c670b3bafde13881bd4fc2a9b106e77c09ee770e61061cce8c8ddf69d0160b759995a93883e
|
@@ -247,7 +247,11 @@ function dispatch(eventName, {target: target, cancelable: cancelable, detail: de
|
|
247
247
|
bubbles: true,
|
248
248
|
detail: detail
|
249
249
|
});
|
250
|
-
|
250
|
+
if (target && target.isConnected) {
|
251
|
+
target.dispatchEvent(event);
|
252
|
+
} else {
|
253
|
+
document.documentElement.dispatchEvent(event);
|
254
|
+
}
|
251
255
|
return event;
|
252
256
|
}
|
253
257
|
|
@@ -2556,6 +2560,7 @@ class Session {
|
|
2556
2560
|
const form = document.createElement("form");
|
2557
2561
|
form.method = linkMethod;
|
2558
2562
|
form.action = link.getAttribute("href") || "undefined";
|
2563
|
+
form.hidden = true;
|
2559
2564
|
(_a = link.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(form, link);
|
2560
2565
|
return dispatch("submit", {
|
2561
2566
|
cancelable: true,
|
@@ -1,6 +1,16 @@
|
|
1
1
|
if (cable_config_path = Rails.root.join("config/cable.yml")).exist?
|
2
2
|
say "Enable redis in bundle"
|
3
|
-
|
3
|
+
|
4
|
+
gemfile_content = File.read(Rails.root.join("Gemfile"))
|
5
|
+
pattern = /gem ['"]redis['"]/
|
6
|
+
|
7
|
+
if gemfile_content.match?(pattern)
|
8
|
+
uncomment_lines "Gemfile", pattern
|
9
|
+
else
|
10
|
+
gem 'redis', '~> 4.0', comment: "Use Redis as Action Cable adapter instead of default Async. The Async adapter\ndoes not support Turbo Stream broadcasting."
|
11
|
+
end
|
12
|
+
|
13
|
+
run_bundle
|
4
14
|
|
5
15
|
say "Switch development cable to use redis"
|
6
16
|
gsub_file cable_config_path.to_s, /development:\n\s+adapter: async/, "development:\n adapter: redis\n url: redis://localhost:6379/1"
|
data/lib/tasks/turbo_tasks.rake
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
def run_turbo_install_template(path)
|
2
|
-
system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/#{path}.rb",
|
2
|
+
system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/#{path}.rb", __dir__)}"
|
3
3
|
end
|
4
4
|
|
5
5
|
def redis_installed?
|
6
|
-
system('which redis-server')
|
6
|
+
system('which redis-server > /dev/null')
|
7
7
|
end
|
8
8
|
|
9
9
|
def switch_on_redis_if_available
|
data/lib/turbo/version.rb
CHANGED
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.7.
|
4
|
+
version: 0.7.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-09-
|
13
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|