Sha256: 13dcd24fad6b485ac36c8825241807f6e34d4b5e862279528fa9ecf447429846

Contents?: true

Size: 441 Bytes

Versions: 62

Compression:

Stored size: 441 Bytes

Contents

module ActionView
  class PathResolver
    def find_template_paths(query)
      prefilter(query).reject do |filename|
        File.directory?(filename) ||
          !File.fnmatch(query, filename, File::FNM_EXTGLOB)
      end
    end

    def prefilter(query)
      path = query.split('{')[0]
      # sort by + sign to make sure that variant matches get priority
      Dir[path + '*'].uniq.sort_by { |i| i =~ /\+/ ? 0 : 1 }
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.26 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.45 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.25 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.23 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.44 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.22 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.43 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.21 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.42 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.20 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.41 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.19 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.40 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.18 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.39 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.17 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.38 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.5.16 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb
workarea-core-3.4.37 lib/workarea/ext/freedom_patches/action_view_path_resolver.rb