Skip to content

Kemal plugin to watch files and live-reload the browser

License

Notifications You must be signed in to change notification settings

faustinoaq/kemal-watcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

da1db2c · Jun 17, 2018

History

50 Commits
Dec 8, 2017
Jun 17, 2018
Mar 29, 2017
Mar 29, 2017
Mar 29, 2017
Apr 8, 2017
Jun 17, 2018

Repository files navigation

kemal-watcher

Build Status

Kemal plugin to watch files like client stuff.

Installation

Add this to your application's shard.yml:

dependencies:
  kemal-watcher:
    github: faustinoaq/kemal-watcher

Usage

Add Kemal.watch to your Kemal app to watch files.

require "kemal"
require "kemal-watcher"

get "/" do
  File.read "src/views/index.html"
end

files = [
  "public/*.js",
  "public/*.html"
]

Kemal.watch(files)
Kemal.run

How does it works?

Kemal.watch uses watcher to watch files and add a new handler to Kemal that inject a script in the response. When a change is detected an event handler is executed and then send a reload signal to the clients.

Contributing

  1. Fork it ( https://github.com/faustinoaq/kemal-watcher/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Disclaimer

Kemal.watch is intended for use in a development environment.

Contributors

  • faustinoaq Faustino Aguilar - creator, maintainer

About

Kemal plugin to watch files and live-reload the browser

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published