pre-compile and cache URI regexp
This commit is contained in:
parent
11794e6f4f
commit
d3b12631dd
|
@ -60,8 +60,10 @@ class URIChunk < Chunk::Abstract
|
||||||
"(?:\\#(#{FRAGMENT}))?" # Optional #fragment (\7)
|
"(?:\\#(#{FRAGMENT}))?" # Optional #fragment (\7)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.pattern()
|
URI_PATTERN_REGEXP = Regexp.new(URI_PATTERN, Regexp::EXTENDED, 'N')
|
||||||
Regexp.new(URI_PATTERN, Regexp::EXTENDED, 'N')
|
|
||||||
|
def self.pattern
|
||||||
|
URI_PATTERN_REGEXP
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :uri, :scheme, :user, :host, :port, :path, :query, :fragment, :link_text
|
attr_reader :uri, :scheme, :user, :host, :port, :path, :query, :fragment, :link_text
|
||||||
|
|
Loading…
Reference in a new issue