Sha256: 05b3ed6a63f517c7d8c565011a6096fe830c63b6e4477e4427c9fed3ecdd6077
Contents?: true
Size: 540 Bytes
Versions: 7
Compression:
Stored size: 540 Bytes
Contents
require 'mustermann/ast/pattern' module Mustermann # Rails style pattern implementation. # # @example # Mustermann.new('/:foo', type: :rails) === '/bar' # => true # # @see Mustermann::Pattern # @see file:README.md#rails Syntax description in the README class Rails < AST::Pattern on(nil, ?)) { |c| unexpected(c) } on(?*) { |c| node(:named_splat) { scan(/\w+/) } } on(?() { |c| node(:optional, node(:group) { read unless scan(?)) }) } on(?:) { |c| node(:capture) { scan(/\w+/) } } end end
Version data entries
7 entries across 7 versions & 2 rubygems