Skip to content

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)

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
See also .getwd .identical? .cp_r .install also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1