Skip to content

Support manually triggering a page reload from an external process #29

@nogweii

Description

@nogweii

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions