def glob(*pattern, **options, &block)
      raise ArgumentError, "no pattern given" if pattern.empty?
      pattern, glob_pattern = pattern_with_glob_pattern(*pattern, **options)
      results               = [] unless block
      Dir.glob(glob_pattern) do |result|
        next unless params = pattern.params(result)
        block ? block[result, params] : results << result
      end
      results
    end
def glob(*pattern, **options, &block)
      raise ArgumentError, "no pattern given" if pattern.empty?
      pattern, glob_pattern = pattern_with_glob_pattern(*pattern, **options)
      results               = [] unless block
      Dir.glob(glob_pattern) do |result|
        next unless params = pattern.params(result)
        block ? block[result, params] : results << result
      end
      results
    end
Uses the given pattern(s) to search for files and directories.

 @example
   require 'mustermann/file_utils'
   Mustermann::FileUtils.glob(':base.:ext') # => ['example.txt']

   Mustermann::FileUtils.glob(':base.:ext') do |file, params|
     file   # => "example.txt"
     params # => {"base"=>"example", "ext"=>"txt"}
   end