Sha256: b1f8cfb8273865ed33a87d02efe170e45b8d3b4bacbb56d137595b59cff8c540

Contents?: true

Size: 681 Bytes

Versions: 16

Compression:

Stored size: 681 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

16 entries across 16 versions & 7 rubygems

Version Path
eric-adhearsion-0.7.999 lib/adhearsion/voip/conveniences.rb
eric-adhearsion-0.8.0 lib/adhearsion/voip/conveniences.rb
jicksta-adhearsion-0.7.999 lib/adhearsion/voip/conveniences.rb
jicksta-adhearsion-0.8.0 lib/adhearsion/voip/conveniences.rb
jicksta-adhearsion-0.8.2 lib/adhearsion/voip/conveniences.rb
jicksta-adhearsion-0.8.3 lib/adhearsion/voip/conveniences.rb
kenwiesner-adhearsioncw-0.8.3 lib/adhearsion/voip/conveniences.rb
mtrudel-adhearsion-0.8.3 lib/adhearsion/voip/conveniences.rb
sant0sk1-adhearsion-0.7.999 lib/adhearsion/voip/conveniences.rb
sevenscale-adhearsion-0.7.1000 lib/adhearsion/voip/conveniences.rb
sevenscale-adhearsion-0.7.1003 lib/adhearsion/voip/conveniences.rb
sevenscale-adhearsion-0.8.0 lib/adhearsion/voip/conveniences.rb
adhearsion-0.8.3 lib/adhearsion/voip/conveniences.rb
adhearsion-0.8.1 lib/adhearsion/voip/conveniences.rb
adhearsion-0.8.2 lib/adhearsion/voip/conveniences.rb
adhearsion-0.8.0 lib/adhearsion/voip/conveniences.rb