# File lib/backports/tools.rb, line 148
  def self.convert_all_arguments_to_path(mod, skip, *methods)
    methods.each do |selector|
      unless mod.method_defined? selector
        warn "#{mod}##{selector} is not defined, so arguments can't converted to path"
        next
      end
      first_args = (1..skip).map{|i| "arg_#{i}"}.join(",") + (skip > 0 ? "," : "")
      alias_method_chain(mod, selector, :potential_path_arguments) do |aliased_target, punctuation|
        mod.module_eval "def \#{aliased_target}_with_potential_path_arguments\#{punctuation}(\#{first_args}*files, &block)\nfiles = files.map{|f| Backports.convert_to_path f}\n\#{aliased_target}_without_potential_path_arguments\#{punctuation}(\#{first_args}*files, &block)\nend\n"
      end
    end
  end