Skip to content

Instantly share code, notes, and snippets.

@chrisnicola
Created July 20, 2016 19:24
Show Gist options
  • Save chrisnicola/f34a7cd80bfd3aa9b3d696bcd9b35d03 to your computer and use it in GitHub Desktop.
Save chrisnicola/f34a7cd80bfd3aa9b3d696bcd9b35d03 to your computer and use it in GitHub Desktop.
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