rails_live_reload
rails_live_reload copied to clipboard
Support manually triggering a page reload from an external process
I am running guard on my laptop. It is monitoring changes to the files underneath config/
& lib/
, and causes the whole server to restart.
I'd like to have the page reload after the server is restarted, but I'm not sure how to trigger that from something outside the rails process. Here was my first attempt at it:
require "socket"
require "json"
command = {
"event" => "reload",
"files" => ["app/assets/builds/application.js"]
}
socket = UNIXSocket.new("tmp/sockets/rails_live_reload.sock")
socket.puts command.to_json
Hello @nogweii, sorry for taking a lot of time to reply.
I don't think it is possible to do at the moment, for this, Unix server has to be updated here so that it will be able to receive commands from connections, as right now it can only "transmit" commands.