No commit activity in last 3 years
No release in over 3 years
Live reloading for Roda
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.0.0
< 5.0, >= 2.0
 Project Readme

Roda Live Reload

A very primitive live-reload mechanism for Roda.

Installation

Add this line to your application's Gemfile:

gem "roda-live_reload"

And then execute:

$ bundle

Or install it yourself as:

$ gem install roda-live_reload

Usage

After enabling the plugin, simply call r.live_reload inside your routing tree. You'll likely want to only enable it during development.

class App < Roda
  development = ENV.fetch("RACK_ENV", "development") == "development"

  plugin :live_reload if development

  route do |r|
    r.live_reload if development

    r.root { "Root" }
  end
end

Caveats

Live Reloading mechanism may not work with Webrick. Tested with Puma.

A new SIGINT trap is set per request, possibly bulldozing any previously set SIGINT. This may not be an issue for most, but it's something to be aware of.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/adam12/roda-live_reload.

I love pull requests! If you fork this project and modify it, please ping me to see if your changes can be incorporated back into this project.

That said, if your feature idea is nontrivial, you should probably open an issue to discuss it before attempting a pull request.

License

The gem is available as open source under the terms of the MIT License.