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