End of Life Ruby 3.2 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.2.0/lib/fileutils.rb, line 2600
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 method mid accepts the given option opt, false otherwise; the arguments may be strings or symbols:
Example
FileUtils.have_option?(:chmod, :noop) # => true FileUtils.have_option?('chmod', 'secure') # => false