Skip to content

Commit

Permalink
allow passing multiple values to dont_reload and also_reload to ensur…
Browse files Browse the repository at this point in the history
…e compatibilty with older sinatra-reloader releases
  • Loading branch information
rkh committed Oct 1, 2011
1 parent 35a92b6 commit 5e7aeb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/sinatra/reloader.rb
Expand Up @@ -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
Expand Down

0 comments on commit 5e7aeb5

Please sign in to comment.