diff --git a/railties/lib/rails/command.rb b/railties/lib/rails/command.rb index 22eaf37bf7441..6065e78fd11dc 100644 --- a/railties/lib/rails/command.rb +++ b/railties/lib/rails/command.rb @@ -1,4 +1,5 @@ require "active_support" +require "active_support/dependencies/autoload" require "active_support/core_ext/enumerable" require "active_support/core_ext/object/blank" require "active_support/core_ext/hash/transform_values" @@ -7,8 +8,10 @@ module Rails module Command - autoload :Behavior, "rails/command/behavior" - autoload :Base, "rails/command/base" + extend ActiveSupport::Autoload + + autoload :Behavior + autoload :Base include Behavior @@ -17,7 +20,7 @@ def hidden_commands # :nodoc: @hidden_commands ||= [] end - def environment + def environment # :nodoc: ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" end diff --git a/railties/lib/rails/command/environment_argument.rb b/railties/lib/rails/command/environment_argument.rb index d4221d142b1f4..bff076adc9f19 100644 --- a/railties/lib/rails/command/environment_argument.rb +++ b/railties/lib/rails/command/environment_argument.rb @@ -20,7 +20,7 @@ def acceptable_environment(env = nil) if available_environments.include? env env else - %w(production development test).detect { |e| e =~ /^#{env}/ } || env + %w( production development test ).detect { |e| e =~ /^#{env}/ } || env end end diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index b45805bddde67..98605b05b2770 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -100,7 +100,6 @@ def default_options end private - def setup_dev_caching if options[:environment] == "development" Rails::DevCaching.enable_by_argument(options[:caching])