sanitize_path(path)
public
Removes directories from path that are outside the current
directory
# File lib/rdoc/options.rb, line 1140
def sanitize_path path
require 'pathname'
dot = Pathname.new('.').expand_path
path.reject do |item|
path = Pathname.new(item).expand_path
relative = path.relative_path_from(dot).to_s
relative.start_with? '..'
end
end