lib/serviceworker/router.rb in serviceworker-rails-0.3.1 vs lib/serviceworker/router.rb in serviceworker-rails-0.4.0
- old
+ new
@@ -17,11 +17,11 @@
def draw(&block)
return self unless block_given?
if block.arity == 1
- block.call(self)
+ yield(self)
else
instance_eval(&block)
end
self
@@ -49,12 +49,10 @@
end
def match_route(env)
path = env[PATH_INFO]
@routes.each do |route|
- if match = route.match(path)
- return match
- end
+ match = route.match(path) and return match
end
nil
end
end
end