aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-12 19:51:54 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-12 19:51:54 -0200
commit8fdc052a6752baa0101be208bb0296fe6350c024 (patch)
treef8d5cfe3fa438f6cdd29550a7c5ada12ceb370d0 /actionpack/lib
parent9c993cb348a37563c0ab7c12ded9c21938cc6781 (diff)
downloadrails-8fdc052a6752baa0101be208bb0296fe6350c024.tar.gz
rails-8fdc052a6752baa0101be208bb0296fe6350c024.tar.bz2
rails-8fdc052a6752baa0101be208bb0296fe6350c024.zip
Extract asset paths uri regexp to a constant
Avoid compiling the regexp all the time.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/asset_paths.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb
index aa5db0d7bc..2a28e780bf 100644
--- a/actionpack/lib/action_view/asset_paths.rb
+++ b/actionpack/lib/action_view/asset_paths.rb
@@ -4,6 +4,8 @@ require 'action_controller/metal/exceptions'
module ActionView
class AssetPaths #:nodoc:
+ URI_REGEXP = %r{^[-a-z]+://|^cid:|^//}
+
attr_reader :config, :controller
def initialize(config, controller = nil)
@@ -37,7 +39,7 @@ module ActionView
end
def is_uri?(path)
- path =~ %r{^[-a-z]+://|^cid:|^//}
+ path =~ URI_REGEXP
end
private