Class: Reloaders
- Inherits:
-
Object
- Object
- Reloaders
- Defined in:
- lib/guard/jruby-rspec/reloaders.rb
Instance Method Summary collapse
-
#initialize ⇒ Reloaders
constructor
A new instance of Reloaders.
-
#register(options = {}, &block) ⇒ Object
Add a reloader to be called on reload.
- #reload(paths = []) ⇒ Object
Constructor Details
#initialize ⇒ Reloaders
Returns a new instance of Reloaders.
2 3 4 |
# File 'lib/guard/jruby-rspec/reloaders.rb', line 2 def initialize @reloaders = [] end |
Instance Method Details
#register(options = {}, &block) ⇒ Object
Add a reloader to be called on reload
7 8 9 10 11 12 13 |
# File 'lib/guard/jruby-rspec/reloaders.rb', line 7 def register( = {}, &block) if [:prepend] @reloaders.unshift block else @reloaders << block end end |
#reload(paths = []) ⇒ Object
15 16 17 18 19 |
# File 'lib/guard/jruby-rspec/reloaders.rb', line 15 def reload(paths = []) @reloaders.each do |reloader| reloader.call(paths) end end |