Removed most of deprecated stuff from Application and Engine

This commit is contained in:
Piotr Sarnacki 2010-07-19 14:53:15 +02:00
parent 7cccfed594
commit 939d4255e6
6 changed files with 0 additions and 123 deletions

@ -94,10 +94,5 @@ def version
def public_path
application && application.paths.public.to_a.first
end
def public_path=(path)
ActiveSupport::Deprecation.warn "Setting Rails.public_path= is deprecated. " <<
"Please set paths.public = in config/application.rb instead.", caller
end
end
end

@ -1,12 +1,9 @@
require 'active_support/deprecation'
require 'active_support/core_ext/string/encoding'
require 'rails/engine/configuration'
module Rails
class Application
class Configuration < ::Rails::Engine::Configuration
include ::Rails::Configuration::Deprecated
attr_accessor :allow_concurrency, :cache_classes, :cache_store,
:encoding, :consider_all_requests_local, :dependency_loading,
:filter_parameters, :log_level, :logger,
@ -53,12 +50,6 @@ def paths
paths.tmp "tmp"
paths.tmp.cache "tmp/cache"
if File.exists?("#{root}/test/mocks/#{Rails.env}")
ActiveSupport::Deprecation.warn "\"Rails.root/test/mocks/#{Rails.env}\" won't be added " <<
"automatically to load paths anymore in future releases"
paths.mocks_path "test/mocks", :autoload => true, :glob => Rails.env
end
paths
end
end

@ -71,86 +71,5 @@ def method_missing(method, *args)
end
end
end
module Deprecated
def frameworks(*args)
raise "config.frameworks in no longer supported. See the generated " \
"config/boot.rb for steps on how to limit the frameworks that " \
"will be loaded"
end
alias :frameworks= :frameworks
def view_path=(value)
ActiveSupport::Deprecation.warn "config.view_path= is deprecated, " <<
"please do paths.app.views= instead", caller
paths.app.views = value
end
def view_path
ActiveSupport::Deprecation.warn "config.view_path is deprecated, " <<
"please do paths.app.views instead", caller
paths.app.views.to_a.first
end
def routes_configuration_file=(value)
ActiveSupport::Deprecation.warn "config.routes_configuration_file= is deprecated, " <<
"please do paths.config.routes= instead", caller
paths.config.routes = value
end
def routes_configuration_file
ActiveSupport::Deprecation.warn "config.routes_configuration_file is deprecated, " <<
"please do paths.config.routes instead", caller
paths.config.routes.to_a.first
end
def database_configuration_file=(value)
ActiveSupport::Deprecation.warn "config.database_configuration_file= is deprecated, " <<
"please do paths.config.database= instead", caller
paths.config.database = value
end
def database_configuration_file
ActiveSupport::Deprecation.warn "config.database_configuration_file is deprecated, " <<
"please do paths.config.database instead", caller
paths.config.database.to_a.first
end
def log_path=(value)
ActiveSupport::Deprecation.warn "config.log_path= is deprecated, " <<
"please do paths.log= instead", caller
paths.config.log = value
end
def log_path
ActiveSupport::Deprecation.warn "config.log_path is deprecated, " <<
"please do paths.log instead", caller
paths.config.log.to_a.first
end
def controller_paths=(value)
ActiveSupport::Deprecation.warn "config.controller_paths= is deprecated, " <<
"please do paths.app.controllers= instead", caller
paths.app.controllers = value
end
def controller_paths
ActiveSupport::Deprecation.warn "config.controller_paths is deprecated, " <<
"please do paths.app.controllers instead", caller
paths.app.controllers.to_a.uniq
end
def cookie_secret=(value)
ActiveSupport::Deprecation.warn "config.cookie_secret= is deprecated, " <<
"please use config.secret_token= instead", caller
self.secret_token = value
end
def cookie_secret
ActiveSupport::Deprecation.warn "config.cookie_secret is deprecated, " <<
"please use config.secret_token instead", caller
self.secret_token
end
end
end
end

@ -94,9 +94,6 @@ class Engine < Railtie
class << self
attr_accessor :called_from
# TODO Remove this. It's deprecated.
alias :engine_name :railtie_name
def inherited(base)
unless base.abstract_railtie?
base.called_from = begin

@ -1,7 +1,6 @@
require 'rails/initializable'
require 'rails/configuration'
require 'active_support/inflector'
require 'active_support/deprecation'
module Rails
# Railtie is the core of the Rails Framework and provides several hooks to extend
@ -142,14 +141,6 @@ def inherited(base)
end
end
def railtie_name(*)
ActiveSupport::Deprecation.warn "railtie_name is deprecated and has no effect", caller
end
def log_subscriber(*)
ActiveSupport::Deprecation.warn "log_subscriber is deprecated and has no effect", caller
end
def rake_tasks(&blk)
@rake_tasks ||= []
@rake_tasks << blk if blk

@ -125,22 +125,6 @@ def teardown
assert !ActionController.autoload?(:RecordIdentifier)
end
test "runtime error is raised if config.frameworks= is used" do
add_to_config "config.frameworks = []"
assert_raises RuntimeError do
require "#{app_path}/config/environment"
end
end
test "runtime error is raised if config.frameworks is used" do
add_to_config "config.frameworks -= []"
assert_raises RuntimeError do
require "#{app_path}/config/environment"
end
end
test "filter_parameters should be able to set via config.filter_parameters" do
add_to_config <<-RUBY
config.filter_parameters += [ :foo, 'bar', lambda { |key, value|