Skip to content

Instantly share code, notes, and snippets.

@enebo
Created November 17, 2021 15:55
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 enebo/9d4cc40dd0d0856c6a12a568f3c93746 to your computer and use it in GitHub Desktop.
Save enebo/9d4cc40dd0d0856c6a12a568f3c93746 to your computer and use it in GitHub Desktop.
ENV["a"] = "a"
def foo
a = ENV["a"]
ENV["a"] = "b"
yield
ensure
ENV["a"] = a
end
foo { java.util.ArrayList.new().get(10) }
p ENV["a"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment