Sha256: ab5a954b3508c204e0fd7681b4ebf2b873779d608490efbf34d35c1dfa4735e2

Contents?: true

Size: 309 Bytes

Versions: 1

Compression:

Stored size: 309 Bytes

Contents

# frozen_string_literal: true

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

1 entries across 1 versions & 1 rubygems

Version Path
vernacular-1.0.0 lib/vernacular/modifiers/uri_sigil.rb