lib/spiderfw/controller/dispatcher.rb in spiderfw-0.5.9 vs lib/spiderfw/controller/dispatcher.rb in spiderfw-0.5.10
- old
+ new
@@ -236,9 +236,11 @@
checks.each do |check|
if check.is_a?(String)
return true if (action == check || (action[-1].chr == '/' && action[0..-2] == check))
elsif check.is_a?(Regexp)
return true if action =~ check
+ elsif check.is_a?(Proc)
+ return true if check.call(action)
elsif (check.is_a?(Symbol))
first, rest = action.split('/', 2)
return true if first && first.to_sym == check
end
end