Module: RailsDevelopmentBoost::Reloader

Extended by:
Reloader
Included in:
Reloader
Defined in:
lib/rails_development_boost/reloader.rb

Overview

replacement for the Rails’ post fa1d9a file_update_checker

Instance Method Summary collapse

Instance Method Details

#executeObject Also known as: updated?



10
11
12
13
# File 'lib/rails_development_boost/reloader.rb', line 10

def execute
  init unless @inited
  @last_run_result = ActiveSupport::Dependencies.unload_modified_files!
end

#execute_if_updatedObject



15
16
17
18
19
# File 'lib/rails_development_boost/reloader.rb', line 15

def execute_if_updated
  @last_run_result.nil? ? execute : @last_run_result
ensure
  @last_run_result = nil
end

#hook_in!Object



5
6
7
8
# File 'lib/rails_development_boost/reloader.rb', line 5

def hook_in!
  Rails.application.reloaders.unshift(self)
  ActionDispatch::Reloader.to_prepare(:prepend => true) { RailsDevelopmentBoost::Reloader.execute_if_updated }
end