Flowdock
method

build_regex

Importance_0
v6.1.7.7 - 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 395
      def build_regex(path, details)
        query = Regexp.escape(File.join(@path, path))
        exts = EXTENSIONS.map do |ext, prefix|
          match =
            if ext == :variants && details[ext] == :any
              ".*?"
            else
              arr = details[ext].compact
              arr.uniq!
              arr.map! { |e| Regexp.escape(e) }
              arr.join("|")
            end
          prefix = Regexp.escape(prefix)
          "(#{prefix}(?<#{ext}>#{match}))?"
        end.join

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