Flowdock
method

build_path_regex

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: PathParser
build_path_regex() public

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 18
      def build_path_regex
        handlers = Regexp.union(Template::Handlers.extensions.map(&:to_s))
        formats = Regexp.union(Template::Types.symbols.map(&:to_s))
        available_locales = I18n.available_locales.map(&:to_s)
        regular_locales = [/[a-z]{2}(?:[-_][A-Z]{2})?/]
        locales = Regexp.union(available_locales + regular_locales)
        variants = "[^.]*"

        %{
          \A
          (?:(?<prefix>.*)/)?
          (?<partial>_)?
          (?<action>.*?)
          (?:\.(?<locale>#{locales}))??
          (?:\.(?<format>#{formats}))??
          (?:\+(?<variant>#{variants}))??
          (?:\.(?<handler>#{handlers}))?
          \z
        }
      end
Register or log in to add new notes.