diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-28 18:03:06 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-28 18:03:06 -0800 |
commit | f279422e3346314ebec6b2156534c0fa5ebd5a98 (patch) | |
tree | 6240f7ee25b472c85c6e60b22cc7c7bcebad7ef2 | |
parent | 2dbb73bdda3b81947fd112486ac4285fb1a6e3a9 (diff) | |
download | rails-f279422e3346314ebec6b2156534c0fa5ebd5a98.tar.gz rails-f279422e3346314ebec6b2156534c0fa5ebd5a98.tar.bz2 rails-f279422e3346314ebec6b2156534c0fa5ebd5a98.zip |
no need to pass a regex to Regexp.compile
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/static.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index 40c85d420a..c5598f3e56 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -5,10 +5,10 @@ module ActionDispatch attr_reader :ext def initialize(at, root) - @at, @root = at.chomp('/'), root.chomp('/') - @compiled_at = (Regexp.compile(/^#{Regexp.escape(at)}/) unless @at.blank?) - @compiled_root = Regexp.compile(/^#{Regexp.escape(root)}/) - @file_server = ::Rack::File.new(@root) + @at, @root = at.chomp('/'), root.chomp('/') + @compiled_at = /^#{Regexp.escape(at)}/ unless @at.blank? + @compiled_root = /^#{Regexp.escape(root)}/ + @file_server = ::Rack::File.new(@root) ext = ::ActionController::Base.page_cache_extension @ext = "{,#{ext},/index#{ext}}" |