End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
FileUtils.have_option?
have_option?(mid, opt)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/fileutils.rb, line 1669
def self.have_option?(mid, opt)
li = OPT_TABLE[mid.to_s] or raise ArgumentError, "no such method: #{mid}"
li.include?(opt)
end
Returns true if the method mid have an option opt.
Example
p FileUtils.have_option?(:cp, :noop) #=> true p FileUtils.have_option?(:rm, :force) #=> true p FileUtils.have_option?(:rm, :preserve) #=> false