basics/warn/uplevel_paths_parens.rb

tests/_examples/basics/warn/uplevel_paths_parens.rb in the metorex repository.

# A warning with `uplevel:` names the file the way it was given to ruby.
$stderr = $stdout

def caution
  warn("from the caller", uplevel: 1)
end

caution
warn("from here", uplevel: 0)

Output:

tests/_examples/basics/warn/uplevel_paths_parens.rb:8: warning: from the caller
tests/_examples/basics/warn/uplevel_paths_parens.rb:9: warning: from here