Returns the root of the Rails engine or app running the command.
# File railties/lib/rails/command.rb, line 83
def root
if defined?(ENGINE_ROOT)
Pathname.new(ENGINE_ROOT)
elsif defined?(APP_PATH)
Pathname.new(File.expand_path("../..", APP_PATH))
end
end