turbo-rails 0.7.9 → 0.7.10

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: 55602f24631c11bc8034e778f706fe6866caca4ff1907b7217c7d4150cf26acd
4
- data.tar.gz: bfe2afe2a79b5659a66e44bf43d959ee17cc091e18c925207c56a3a7beb71443
3
+ metadata.gz: 41cfe42f850783258d151d4d6ed872633cbb2a7f2ba3c20ad434af326c65dd15
4
+ data.tar.gz: cff176c51977f6c1ba19c31eb36d97ea1958394e7fcde6a489f0d53ec9a74b3b
5
5
  SHA512:
6
- metadata.gz: 2049be5687158e196102d4a89f1ca1f1e4a5c6f90987b8bc6884f5e8689ef7725853f9d562bc066e4267c06bd7b82c885494d9c35184aca752036377bcdb7fbf
7
- data.tar.gz: 384956d8e415c8461021b9ef5d4fbec379f81f3b5e6964c08a9b502c8141060187e9838bf1e6aabe973fff1419968ea234534752373c698446da272b28e57ed8
6
+ metadata.gz: 6a8c79d8a32ce7a36aa3f289cd222600d3040bdd5cebaca4836c2fb659ac6e6d847ab02299290429b434a530b7397d9580628edaaba13b088e59c641174ab994
7
+ data.tar.gz: 58eea1099a495e6987a8197630b9c9e6386af8e2016d0cceb92555ca2ce5fba19e6f32eba2244a14751ef9879b92c6793fdc1e1dd6e0b639678ed4c757680a47
@@ -16,5 +16,3 @@ else
16
16
  Example: pin "@hotwired/turbo-rails", to: "turbo.js"
17
17
  INSTRUCTIONS
18
18
  end
19
-
20
- say "Run turbo:install:redis to switch on Redis and use it in development for turbo streams", :red
@@ -3,5 +3,3 @@ append_to_file "#{Webpacker.config.source_entry_path}/application.js", %(\nimpor
3
3
 
4
4
  say "Install Turbo"
5
5
  run "yarn add @hotwired/turbo-rails"
6
-
7
- say "Run turbo:install:redis to switch on Redis and use it in development for turbo streams"
@@ -1,4 +1,18 @@
1
- def run_turbo_install_template(path) system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/#{path}.rb", __dir__)}" end
1
+ def run_turbo_install_template(path)
2
+ system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/#{path}.rb", __dir__)}"
3
+ end
4
+
5
+ def redis_installed?
6
+ system('which redis-server')
7
+ end
8
+
9
+ def switch_on_redis_if_available
10
+ if redis_installed?
11
+ Rake::Task["turbo:install:redis"].invoke
12
+ else
13
+ puts "Run turbo:install:redis to switch on Redis and use it in development for turbo streams"
14
+ end
15
+ end
2
16
 
3
17
  namespace :turbo do
4
18
  desc "Install Turbo into the app"
@@ -14,11 +28,13 @@ namespace :turbo do
14
28
  desc "Install Turbo into the app with asset pipeline"
15
29
  task :asset_pipeline do
16
30
  run_turbo_install_template "turbo_with_asset_pipeline"
31
+ switch_on_redis_if_available
17
32
  end
18
33
 
19
34
  desc "Install Turbo into the app with webpacker"
20
35
  task :webpacker do
21
36
  run_turbo_install_template "turbo_with_webpacker"
37
+ switch_on_redis_if_available
22
38
  end
23
39
 
24
40
  desc "Switch on Redis and use it in development"
data/lib/turbo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Turbo
2
- VERSION = "0.7.9"
2
+ VERSION = "0.7.10"
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.7.9
4
+ version: 0.7.10
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-08-31 00:00:00.000000000 Z
13
+ date: 2021-09-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails