Skip to content

Commit 7821ed4

Browse files
committed
Use &block instead of Proc.new
Using Proc.new to implicitly capture a passed block was removed from Ruby 3.0.
1 parent 61f6a48 commit 7821ed4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/serviceworker/router.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ def self.default
1010

1111
attr_reader :routes
1212

13-
def initialize
13+
def initialize(&block)
1414
@routes = []
1515

16-
draw(&Proc.new) if block_given?
16+
draw(&block)
1717
end
1818

1919
def draw(&block)

0 commit comments

Comments
 (0)