diff options
author | Nathan Broadbent <nathan.f77@gmail.com> | 2012-01-15 10:34:51 +0800 |
---|---|---|
committer | Nathan Broadbent <nathan.f77@gmail.com> | 2012-01-15 10:41:11 +0800 |
commit | 516f102e5f8e481c31aebdcc562d98e87fd0c5ed (patch) | |
tree | fd9032d9ccdc79e1ed5fe79b1e994702a91d7745 /railties | |
parent | 3d25fa042f8534bac7d8c195e88fa3a892eeac91 (diff) | |
download | rails-516f102e5f8e481c31aebdcc562d98e87fd0c5ed.tar.gz rails-516f102e5f8e481c31aebdcc562d98e87fd0c5ed.tar.bz2 rails-516f102e5f8e481c31aebdcc562d98e87fd0c5ed.zip |
Refactored watchable_args and build_original_fullpath methods in railties/lib/rails/application.rb
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 1314966044..2778dce331 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -114,11 +114,8 @@ module Rails # Returns an array of file paths appended with a hash of directories-extensions # suitable for ActiveSupport::FileUpdateChecker API. def watchable_args - files = [] - files.concat config.watchable_files + files, dirs = config.watchable_files.dup, config.watchable_dirs.dup - dirs = {} - dirs.merge! config.watchable_dirs ActiveSupport::Dependencies.autoload_paths.each do |path| dirs[path.to_s] = [:rb] end @@ -293,15 +290,7 @@ module Rails end def build_original_fullpath(env) - path_info = env["PATH_INFO"] - query_string = env["QUERY_STRING"] - script_name = env["SCRIPT_NAME"] - - if query_string.present? - "#{script_name}#{path_info}?#{query_string}" - else - "#{script_name}#{path_info}" - end + ["#{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}", env["QUERY_STRING"]].reject(&:blank?).join("?") end end end |