From: "Dan0042 (Daniel DeLorme)" Date: 2022-09-28T19:43:29+00:00 Subject: [ruby-core:110140] [Ruby master Bug#19026] Add `Coverage.supported?(x)` to detect support for `eval` coverage flag. Issue #19026 has been updated by Dan0042 (Daniel DeLorme). > > Isn't there a general mechanism for feature support? Like `RbConfig.support?(:eval_coverage)` or something? > > I don't think it makes sense because this doesn't change depending on the ruby config. I didn't mean RbConfig per se, just any kind of general mechanism. It seems there isn't. Eregon (Benoit Daloze) wrote in #note-7: > +1 for `Coverage.supported?(:eval)`. But then to use this API you need to do `Coverage.respond_to?(:supported?) && Coverage.supported?(:eval)` or shorten it to just `Coverage.respond_to?(:supported?)` ---------------------------------------- Bug #19026: Add `Coverage.supported?(x)` to detect support for `eval` coverage flag. https://bugs.ruby-lang.org/issues/19026#change-99398 * 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: