Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Extract asset paths uri regexp to a constant

Avoid compiling the regexp all the time.
  • Loading branch information...
commit 8fdc052a6752baa0101be208bb0296fe6350c024 1 parent 9c993cb
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/action_view/asset_paths.rb
View
4 actionpack/lib/action_view/asset_paths.rb
@@ -4,6 +4,8 @@
module ActionView
class AssetPaths #:nodoc:
+ URI_REGEXP = %r{^[-a-z]+://|^cid:|^//}
+
attr_reader :config, :controller
def initialize(config, controller = nil)
@@ -37,7 +39,7 @@ def compute_source_path(source, dir, ext)
end
def is_uri?(path)
- path =~ %r{^[-a-z]+://|^cid:|^//}
+ path =~ URI_REGEXP
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.