Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
MakeMakefile#egrep_cpp
egrep_cpp(pat, src, opt = "", &b)
lib/mkmf.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/mkmf.rb, line 927
def egrep_cpp(pat, src, opt = "", &b)
src = create_tmpsrc(src, &b)
xpopen(cpp_command('', opt)) do |f|
if Regexp === pat
puts(" ruby -ne 'print if #{pat.inspect}'")
!f.grep(pat) {|l|
puts "#{f.lineno}: #{l}"
}.empty?
else
puts(" egrep '#{pat}'")
system("egrep", pat, in: f)
end
end
ensure
MakeMakefile.rm_f "#{CONFTEST}*"
log_src(src)
end
Returns whether or not the src can be preprocessed with the C preprocessor and matches with pat.
If a block given, it is called with the source before compilation. You can modify the source in the block.
NOTE: When pat is a Regexp the matching will be checked in process, otherwise egrep(1) will be invoked to check it.