lib/rails/application.rb in railties-4.1.0.rc2 vs lib/rails/application.rb in railties-4.1.0
- old
+ new
@@ -85,11 +85,11 @@
autoload :RoutesReloader, 'rails/application/routes_reloader'
class << self
def inherited(base)
super
- Rails.application ||= base.instance
+ base.instance
end
# Makes the +new+ method public.
#
# Note that Rails::Application inherits from Rails::Engine, which
@@ -115,10 +115,12 @@
@app_env_config = nil
@ordered_railties = nil
@railties = nil
@message_verifiers = {}
+ Rails.application ||= self
+
add_lib_to_load_path!
ActiveSupport.run_load_hooks(:before_configuration, self)
initial_variable_values.each do |variable_name, value|
if INITIAL_VARIABLES.include?(variable_name)
@@ -328,9 +330,28 @@
self
end
def helpers_paths #:nodoc:
config.helpers_paths
+ end
+
+ console do
+ require "pp"
+ end
+
+ console do
+ unless ::Kernel.private_method_defined?(:y)
+ if RUBY_VERSION >= '2.0'
+ require "psych/y"
+ else
+ module ::Kernel
+ def y(*objects)
+ puts ::Psych.dump_stream(*objects)
+ end
+ private :y
+ end
+ end
+ end
end
protected
alias :build_middleware_stack :app