You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
405 B

module RailsLiveReload
# MonkeyPath Watcher
class Watcher
ENV_FILE = Rails.root.join('.env').to_s
def reload_all
data = {
event: RailsLiveReload::INTERNAL[:socket_events][:reload],
files:
}.to_json
LiveConstants.reload! if files.find { |change| change[0] == ENV_FILE }
@sockets.each do |socket, _|
socket.puts data
end
end
end
end