From: "Dan0042 (Daniel DeLorme)" <noreply@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:110140] [Ruby master Bug#19026] Add `Coverage.supported?(x)` to detect support for `eval` coverage flag.
Date: Wed, 28 Sep 2022 19:43:29 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-99398.20220928194328.3344@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-19026.20220928105240.3344@ruby-lang.org
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/
next prev parent reply other threads:[~2022-09-28 19:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-28 10:52 [ruby-core:110119] [Ruby master Bug#19026] Add `Coverage.supported?(x)` to detect support for `eval` coverage flag ioquatix (Samuel Williams)
2022-09-28 11:01 ` [ruby-core:110120] " mame (Yusuke Endoh)
2022-09-28 11:09 ` [ruby-core:110121] " ioquatix (Samuel Williams)
2022-09-28 14:18 ` [ruby-core:110124] " mame (Yusuke Endoh)
2022-09-28 14:55 ` [ruby-core:110128] " Dan0042 (Daniel DeLorme)
2022-09-28 15:03 ` [ruby-core:110129] " jeremyevans0 (Jeremy Evans)
2022-09-28 18:06 ` [ruby-core:110135] " mame (Yusuke Endoh)
2022-09-28 19:22 ` [ruby-core:110139] " Eregon (Benoit Daloze)
2022-09-28 19:43 ` Dan0042 (Daniel DeLorme) [this message]
2022-09-28 20:46 ` [ruby-core:110141] " ioquatix (Samuel Williams)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-99398.20220928194328.3344@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).