LivereloadRails::Rails
Installation
gem "livereload_rails", group: :development
That's it. Your CSS now livereloads. A few notes that could be of interest:
- requires a threaded webserver, so puma is a runtime dependency for ease of installation.
- adds middleware
Rack:LiveReload
which automatically includeslivereload.js
- adds middleware
LivereloadRails::Middleware
which acts as websocket/livereload server
Development
If you wish to contribute to this gem, here are some notes I hope will help you:
-
bin/setup
: run to install development dependencies. -
bin/console
: run to start an interactive console to experiment with the code. -
rake
: run the automated test suite.
Implementation Notes
LivereloadRails::Rails consists of the following parts:
- Watcher - responsible for watching the asset paths for file changes.
- WebSocket - websocket server handler for rack.
- Client - livereload server handler.
- Middleware - rack middleware to accept websocket connections.
- Railtie - rails engine to automatically hook rails up with livereload.
Contributing
Contributions are very welcome! Follow these steps:
- Fork the code: https://help.github.com/articles/fork-a-repo/
- Create a new pull request with your changes: https://help.github.com/articles/using-pull-requests/
It's perfectly fine to create a pull request with your code and continue a discussion from your changes from there.