From: "jeremyevans0 (Jeremy Evans)" Date: 2022-09-28T15:03:51+00:00 Subject: [ruby-core:110129] [Ruby master Bug#19026] Add `Coverage.supported?(x)` to detect support for `eval` coverage flag. Issue #19026 has been updated by jeremyevans0 (Jeremy Evans). mame (Yusuke Endoh) wrote in #note-1: > Note: This API does determine if the mode is *available*, not *enabled*. So `Coverage.supported?(:eval)` will always returns `true` in Ruby 3.2 regardless of whether `Coverage.start(eval: true)` is called. > > In my first impression, it is okay, but I'd like to hear opinions. @jeremyevans0 Do you have any opinion? I think having `Coverage.supported?` return true when it is supported is fine. However, it would be useful to have an API such as `Coverage.activated?` that only returns true when the specific coverage feature is currently enabled. ---------------------------------------- Bug #19026: Add `Coverage.supported?(x)` to detect support for `eval` coverage flag. https://bugs.ruby-lang.org/issues/19026#change-99387 * Author: ioquatix (Samuel Williams) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Introduce the following interface: ``` Coverage.supported?(eval) -> true/false ``` We can also check `lines` `branches` and `methods`? -- https://bugs.ruby-lang.org/ Unsubscribe: