lib/sinatra/assetpack/options.rb
def glob(match, options={})

        match = [*match]  # Force array-ness

        paths = match.map { |spec|
          if options[:preserve] && !spec.include?('*')
            spec
          else
            files.keys.select { |f| File.fnmatch?(spec, f) }.sort
          end
        }.flatten

        paths  = paths.uniq
        tuples = paths.map { |key| [key, files[key]] }

        HashArray[*tuples.flatten]
      end
# Returns an array of URI paths of those matching given globs.
#
#     glob('spec')
#     glob(['spec1', 'spec2' ...])
#     glob('spec', preserve: true)
#
# If `preserve` is set to true, it will preserve any specs that are not
# wildcards that don't match anything.
#
Returns an array of URI paths of those matching given globs.

If `preserve` is set to true, it will preserve any specs that are not
wildcards that don't match anything.
Returns an array of URI paths of those matching given globs . If ` preserve ` is set to true it will preserve any specs that are not wildcards that don ' t match anything .
def glob(match, options={})
        match = [*match]  
        paths = match.map { |spec|
          if options[:preserve] && !spec.include?('*')
            spec
          else
            files.keys.select { |f| File.fnmatch?(spec, f) }.sort
          end
        }.flatten
        paths  = paths.uniq
        tuples = paths.map { |key| [key, files[key]] }
        HashArray[*tuples.flatten]
      end
def glob ( match , options = { } ) match = [ * match ] paths = match . map { | spec | if options [ :preserve ] && ! spec . include? ( '*' ) spec else files . keys . select { | f | File . fnmatch? ( spec , f ) } . sort end } . flatten paths = paths . uniq tuples = paths . map { | key | [ key , files [ key ] ] } HashArray [ * tuples . flatten ] end
Returns an array of URI paths of those matching given globs.
Returns an array of URI paths of those matching given globs .
# Force array-ness
match
options