Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing more pathnameisms

  • Loading branch information...
commit 4001835db00ce44cb75bca33ec02cd76b8ccc790 1 parent 4e5175e
Aaron Patterson tenderlove authored
Showing with 4 additions and 6 deletions.
  1. +3 −3 railties/lib/rails/engine.rb
  2. +1 −3 railties/lib/rails/paths.rb
6 railties/lib/rails/engine.rb
View
@@ -416,9 +416,9 @@ def isolate_namespace(mod)
# 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 @@ def find_root_with_flag(flag, default=nil)
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
4 railties/lib/rails/paths.rb
View
@@ -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 @@ def paths
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

3 comments on commit 4001835

Philip Arndt

Is Rails.root no longer reliably a Pathname?

Aaron Patterson
Owner

It should return one. If it's not, let me know and I'll fix it! :-)

Philip Arndt

Don't worry bro already sorted in #6471

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