Flowdock
method

build_regex

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: OptimizedFileSystemResolver
build_regex(path, details) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionview/lib/action_view/template/resolver.rb, line 360
      def build_regex(path, details)
        query = escape_entry(File.join(@path, path))
        exts = EXTENSIONS.map do |ext, prefix|
          match =
            if ext == :variants && details[ext] == :any
              ".*?"
            else
              details[ext].compact.uniq.map { |e| Regexp.escape(e) }.join("|")
            end
          prefix = Regexp.escape(prefix)
          "(#{prefix}(?<#{ext}>#{match}))?"
        end.join

        %{\A#{query}#{exts}\z}
      end
Register or log in to add new notes.