Skip to content

Instantly share code, notes, and snippets.

@aereal
Created May 24, 2023 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aereal/493f994c04b0351cc5d85d8fbf10fe09 to your computer and use it in GitHub Desktop.
Save aereal/493f994c04b0351cc5d85d8fbf10fe09 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def scope_while
while true
x = 1
break
end
if x == 1
# noop
end
end
def scope_begin
begin
x = 1
ensure
# noop
end
if x == 1
# noop
end
end
def scope_loop
loop do
x = 1
break
end
if x == 1
# noop
end
end
begin
scope_while
rescue NameError
puts :ng_while
end
begin
scope_begin
rescue NameError
puts :ng_begin
end
begin
scope_loop
rescue NameError
puts :ng_loop
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment