lib/tmc_dir_utils.rb
# frozen_string_literal: true
require 'pathname'
require 'find'
module TmcDirUtils
extend TmcDirUtils
def find_dir_containing(root, to_find)
Pathname(root).find do |path|
next unless path.directory?
next unless (path + to_find).directory?
return path
end
nil
end
end