Sha256: 7fd39892750af168ea55af3a02de8fd5326f49eb18eb8bb25c33217f09ebfe02

Contents?: true

Size: 677 Bytes

Versions: 19

Compression:

Stored size: 677 Bytes

Contents

module Adhearsion
  module VoIP
    module Conveniences

      # Compiles the provided Asterisk dialplan pattern into a Ruby regular
      # expression. For more usage of Asterisk's pattern syntax, see
      # http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns
      def _(pattern)
        # Uncomment the following code fragment for complete compatibility.
        # The fragment handles the seldom-used hyphen number spacer with no
        # meaning.
      	Regexp.new '^' << pattern.# gsub(/(?!\[[\w+-]+)-(?![\w-]+\])/,'').
      	  gsub('X', '[0-9]').gsub('Z', '[1-9]').gsub('N','[2-9]').
      	  gsub('.','.+').gsub('!','.*') << '$'
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
adhearsion-1.2.6 lib/adhearsion/voip/conveniences.rb
adhearsion-1.2.5 lib/adhearsion/voip/conveniences.rb
adhearsion-1.2.4 lib/adhearsion/voip/conveniences.rb
adhearsion-1.2.3 lib/adhearsion/voip/conveniences.rb
adhearsion-1.2.1 lib/adhearsion/voip/conveniences.rb
adhearsion-1.2.0 lib/adhearsion/voip/conveniences.rb
adhearsion-1.1.1 lib/adhearsion/voip/conveniences.rb
adhearsion-1.1.0 lib/adhearsion/voip/conveniences.rb
adhearsion-1.0.3 lib/adhearsion/voip/conveniences.rb
adhearsion-1.0.2 lib/adhearsion/voip/conveniences.rb
adhearsion-cw-1.0.2.3 lib/adhearsion/voip/conveniences.rb
adhearsion-cw-1.0.2.2 lib/adhearsion/voip/conveniences.rb
adhearsion-cw-1.0.2.1 lib/adhearsion/voip/conveniences.rb
adhearsion-1.0.1 lib/adhearsion/voip/conveniences.rb
adhearsion-1.0.0 lib/adhearsion/voip/conveniences.rb
rene-adhearsion-0.8.6 lib/adhearsion/voip/conveniences.rb
adhearsion-0.8.6 lib/adhearsion/voip/conveniences.rb
adhearsion-0.8.5 lib/adhearsion/voip/conveniences.rb
adhearsion-0.8.4 lib/adhearsion/voip/conveniences.rb