module

Freshen::Script

Helper module for synthesizing and injecting the client-side live reload JavaScript snippet.

Class methods

generate(endpoint : String = "/_freshen/reload", script_id : String = "freshen-live-reload", nonce : String | Nil = nil, css_hot_reload : Bool = true) : String

Generates the client-side JavaScript live-reload snippet.

Source
inject(html : String, require_body_tag : Bool = false, endpoint : String = "/_freshen/reload", script_id : String = "freshen-live-reload", nonce : String | Nil = nil, css_hot_reload : Bool = true) : String

Injects the live reload JavaScript client snippet before </body> or appends it. Idempotent: skips injection if a script with script_id is already present.

Source