Class: Reloaders

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/jruby-rspec/reloaders.rb

Instance Method Summary collapse

Constructor Details

#initializeReloaders

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(options = {}, &block)
  if options[: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