aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/application.rb2
-rw-r--r--railties/lib/rails/commands/server.rb2
-rw-r--r--railties/lib/rails/engine.rb6
-rw-r--r--railties/lib/rails/paths.rb4
4 files changed, 6 insertions, 8 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 5c52235318..d44465e547 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -97,7 +97,7 @@ module Rails
# Rails application, you will need to add lib to $LOAD_PATH on your own in case
# you need to load files in lib/ during the application configuration as well.
def add_lib_to_load_path! #:nodoc:
- path = config.root.join('lib').to_s
+ path = File.join config.root, 'lib'
$LOAD_PATH.unshift(path) if File.exists?(path)
end
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb
index 4c4caad69f..e68d2e05c5 100644
--- a/railties/lib/rails/commands/server.rb
+++ b/railties/lib/rails/commands/server.rb
@@ -69,7 +69,7 @@ module Rails
#Create required tmp directories if not found
%w(cache pids sessions sockets).each do |dir_to_make|
- FileUtils.mkdir_p(Rails.root.join('tmp', dir_to_make))
+ FileUtils.mkdir_p(File.join(Rails.root, 'tmp', dir_to_make))
end
unless options[:daemonize]
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index e0950c6929..619c76206d 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -416,9 +416,9 @@ module Rails
# Finds engine with given path
def find(path)
- expanded_path = File.expand_path path.to_s
+ expanded_path = File.expand_path path
Rails::Engine::Railties.engines.find { |engine|
- File.expand_path(engine.root.to_s) == expanded_path
+ File.expand_path(engine.root) == expanded_path
}
end
end
@@ -652,7 +652,7 @@ module Rails
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
raise "Could not find root path for #{self}" unless root
- Pathname.new File.realpath root
+ File.realpath root
end
def default_middleware_stack
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb
index b787d91821..6cd9c7bc95 100644
--- a/railties/lib/rails/paths.rb
+++ b/railties/lib/rails/paths.rb
@@ -1,5 +1,3 @@
-require "pathname"
-
module Rails
module Paths
# This object is an extended hash that behaves as root of the <tt>Rails::Paths</tt> system.
@@ -186,7 +184,7 @@ module Rails
raise "You need to set a path root" unless @root.path
map do |p|
- Pathname.new(@root.path).join(p)
+ File.join @root.path, p
end
end