Sha256: ce2b4db5af13491fcf739041b3a3574890a52ce9b5ec2814c5ac7c34ee13a561

Contents?: true

Size: 278 Bytes

Versions: 5

Compression:

Stored size: 278 Bytes

Contents

module Vernacular
  module Modifiers
    # Extends Ruby syntax to allow URI sigils, or ~u(...). The expression
    # inside contains a valid URL.
    class URISigil < RegexModifier
      def initialize
        super(/~u\((.+?)\)/, 'URI.parse("\1")')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vernacular-0.1.2 lib/vernacular/modifiers/uri_sigil.rb
vernacular-0.1.1 lib/vernacular/modifiers/uri_sigil.rb
vernacular-0.1.0 lib/vernacular/modifiers/uri_sigil.rb
vernacular-0.0.2 lib/vernacular/modifiers/uri_sigil.rb
vernacular-0.0.1 lib/vernacular/modifiers/uri_sigil.rb