From: "jeremyevans0 (Jeremy Evans)" Date: 2022-09-17T20:40:04+00:00 Subject: [ruby-core:109940] [Ruby master Feature#19008] Introduce coverage support for `eval`. Issue #19008 has been updated by jeremyevans0 (Jeremy Evans). In terms of ERB template coverage, I recently added support to Tilt for it. Tilt is the library used by Sinatra, Roda, Hanami, dry-view and most non-Rails web frameworks to render templates. Since `eval` doesn't support coverage, the approach taken is to write a file with the compiled ERB code, and then use `load` (https://github.com/rtomayko/tilt/commit/384553f256cb5b37ef3f63979432edd55e4264eb). I'm not against `eval` supporting coverage, but as @mame indicates, there are numerous issues. Therefore, I think coverage support for `eval` should be opt-in, ideally on a per-`eval` basis (e.g. `coverage: true` keyword argument). ---------------------------------------- Feature #19008: Introduce coverage support for `eval`. https://bugs.ruby-lang.org/issues/19008#change-99187 * Author: ioquatix (Samuel Williams) * Status: Open * Priority: Normal ---------------------------------------- I'd like to introduce coverage support for `eval`. I mostly only care about the case where an explicit path is given, and I'd even be okay to only handle the case where the line number is the default (0). https://github.com/ruby/ruby/pull/6396 This is an incredibly useful feature for computing coverage of ERB templates and other similar things. -- https://bugs.ruby-lang.org/ Unsubscribe: