Class: ViewSpec::Reloader
- Inherits:
-
Object
- Object
- ViewSpec::Reloader
- Defined in:
- lib/view_spec/reloader.rb
Instance Method Summary collapse
-
#initialize(files = [], paths = [], &callback) ⇒ Reloader
constructor
A new instance of Reloader.
- #updated? ⇒ Boolean
Constructor Details
#initialize(files = [], paths = [], &callback) ⇒ Reloader
Returns a new instance of Reloader.
5 6 7 8 9 |
# File 'lib/view_spec/reloader.rb', line 5 def initialize(files = [], paths = [], &callback) paths_hash = paths.map { [_1, ["rb"]] }.to_h @file_watcher = ActiveSupport::FileUpdateChecker.new(files, paths_hash, &callback) end |
Instance Method Details
#updated? ⇒ Boolean
11 12 13 |
# File 'lib/view_spec/reloader.rb', line 11 def updated? @file_watcher.execute_if_updated end |