From 5e7aeb51b1095cb2fab4c204d08ba627f180d0cc Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Sat, 1 Oct 2011 14:59:27 -0500 Subject: [PATCH] allow passing multiple values to dont_reload and also_reload to ensure compatibilty with older sinatra-reloader releases --- lib/sinatra/reloader.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sinatra/reloader.rb b/lib/sinatra/reloader.rb index 5020b3d..da40fb3 100644 --- a/lib/sinatra/reloader.rb +++ b/lib/sinatra/reloader.rb @@ -333,14 +333,14 @@ def deactivate(element) # Indicates with a +glob+ which files should be reloaded if they # have been modified. It can be called several times. - def also_reload(glob) - Dir[glob].each { |path| Watcher::List.for(self).watch_file(path) } + def also_reload(*glob) + Dir[*glob].each { |path| Watcher::List.for(self).watch_file(path) } end # Indicates with a +glob+ which files should not be reloaded even if # they have been modified. It can be called several times. - def dont_reload(glob) - Dir[glob].each { |path| Watcher::List.for(self).ignore(path) } + def dont_reload(*glob) + Dir[*glob].each { |path| Watcher::List.for(self).ignore(path) } end private