Method: Rake::FileUtilsExt#rake_check_options

Defined in:
lib/rake/file_utils_ext.rb

#rake_check_options(options, *optdecl) ⇒ Object

Check that the options do not contain options not listed in optdecl. An ArgumentError exception is thrown if non-declared options are found.

Raises:

  • (ArgumentError)


123
124
125
126
127
128
129
130
# File 'lib/rake/file_utils_ext.rb', line 123

def rake_check_options(options, *optdecl)
  h = options.dup
  optdecl.each do |name|
    h.delete name
  end
  raise ArgumentError, "no such option: #{h.keys.join(' ')}" unless
    h.empty?
end