-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rake tasks for livereload enabling/disabling
- Loading branch information
1 parent
eca549e
commit 76212b3
Showing
5 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
|
||
module Hotwire | ||
module Livereload | ||
DISABLE_FILE = "tmp/livereload-disabled.txt" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace :livereload do | ||
desc "Install Hotwire::Livereload into the app" | ||
task :install do | ||
system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/install.rb", __dir__)}" | ||
end | ||
|
||
desc "Disable Hotwire::Livereload" | ||
task :disable do | ||
FileUtils.mkdir_p("tmp") | ||
FileUtils.touch Hotwire::Livereload::DISABLE_FILE | ||
puts "Livereload disabled." | ||
end | ||
|
||
desc "Enable Hotwire::Livereload" | ||
task :enable do | ||
if File.exist?(Hotwire::Livereload::DISABLE_FILE) | ||
File.delete Hotwire::Livereload::DISABLE_FILE | ||
end | ||
puts "Livereload enabled." | ||
end | ||
end |