Class: Guard::RSpectacle::Reloader
- Inherits:
-
Object
- Object
- Guard::RSpectacle::Reloader
- Defined in:
- lib/guard/rspectacle/reloader.rb
Overview
The reloader class handles reloading of changed files.
Class Method Summary collapse
-
.reload_file(file) ⇒ Boolean
Reloads the given file.
Class Method Details
.reload_file(file) ⇒ Boolean
Reloads the given file.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/guard/rspectacle/reloader.rb', line 16 def reload_file(file) return false unless file =~ /\.rb$/ if File.exists?(file) Formatter.info "Reload #{ file }" load file else false end rescue Exception => e Formatter.error "Error reloading file #{ file }: #{ e. }" throw :task_has_failed end |