Created
July 20, 2016 19:24
-
-
Save chrisnicola/f34a7cd80bfd3aa9b3d696bcd9b35d03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'auto_reloader' | |
module RailsAutoReloader | |
def self.activate | |
AutoReloader.activate reloadable_paths: ['lib'] | |
end | |
class Middleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
AutoReloader.reload! do | |
@app.call(env) | |
end | |
end | |
end | |
module Console | |
def ar!(print=true) | |
puts "Reloading AutoReloader..." if print | |
AutoReloader.reload!(onchange: false) | |
reload!(print) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment