Skip to content
This repository
Browse code

Refactored watchable_args and build_original_fullpath methods in rail…

…ties/lib/rails/application.rb
  • Loading branch information...
commit 516f102e5f8e481c31aebdcc562d98e87fd0c5ed 1 parent 3d25fa0
Nathan Broadbent authored January 15, 2012

Showing 1 changed file with 2 additions and 13 deletions. Show diff stats Hide diff stats

  1. 15  railties/lib/rails/application.rb
15  railties/lib/rails/application.rb
@@ -114,11 +114,8 @@ def routes_reloader #:nodoc:
114 114
     # Returns an array of file paths appended with a hash of directories-extensions
115 115
     # suitable for ActiveSupport::FileUpdateChecker API.
116 116
     def watchable_args
117  
-      files = []
118  
-      files.concat config.watchable_files
  117
+      files, dirs = config.watchable_files.dup, config.watchable_dirs.dup
119 118
 
120  
-      dirs = {}
121  
-      dirs.merge! config.watchable_dirs
122 119
       ActiveSupport::Dependencies.autoload_paths.each do |path|
123 120
         dirs[path.to_s] = [:rb]
124 121
       end
@@ -293,15 +290,7 @@ def initialize_console #:nodoc:
293 290
     end
294 291
 
295 292
     def build_original_fullpath(env)
296  
-      path_info    = env["PATH_INFO"]
297  
-      query_string = env["QUERY_STRING"]
298  
-      script_name  = env["SCRIPT_NAME"]
299  
-
300  
-      if query_string.present?
301  
-        "#{script_name}#{path_info}?#{query_string}"
302  
-      else
303  
-        "#{script_name}#{path_info}"
304  
-      end
  293
+      ["#{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}", env["QUERY_STRING"]].reject(&:blank?).join("?")
305 294
     end
306 295
   end
307 296
 end

0 notes on commit 516f102

Please sign in to comment.
Something went wrong with that request. Please try again.