aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-04-10 17:22:52 -0400
committerwycats <wycats@gmail.com>2010-04-10 17:22:52 -0400
commit87f7093ee3306f417e1136d947eba200d40ff8e7 (patch)
treeba70dbdaf67e12fc067bb5d8343d7681932452ef /railties/lib/rails/application
parentee8e9d548472fb8cb8792a569e579c6513be77d6 (diff)
parent381f877bbbbf81d679f5be3b7ac7e961d41502bd (diff)
downloadrails-87f7093ee3306f417e1136d947eba200d40ff8e7.tar.gz
rails-87f7093ee3306f417e1136d947eba200d40ff8e7.tar.bz2
rails-87f7093ee3306f417e1136d947eba200d40ff8e7.zip
Merge branch 'master' into docrails_master
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r--railties/lib/rails/application/configuration.rb24
1 files changed, 16 insertions, 8 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index d3e4742e8a..7ce3494fa6 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -6,21 +6,29 @@ module Rails
include ::Rails::Configuration::Deprecated
attr_accessor :allow_concurrency, :cache_classes, :cache_store,
- :secret_token, :consider_all_requests_local, :dependency_loading,
+ :encoding, :consider_all_requests_local, :dependency_loading,
:filter_parameters, :log_level, :logger, :metals,
:plugins, :preload_frameworks, :reload_engines, :reload_plugins,
- :serve_static_assets, :time_zone, :whiny_nils
+ :secret_token, :serve_static_assets, :time_zone, :whiny_nils
def initialize(*)
super
- @allow_concurrency = false
- @filter_parameters = []
- @dependency_loading = true
+ @allow_concurrency = false
+ @consider_all_requests_local = false
+ @encoding = "utf-8"
+ @filter_parameters = []
+ @dependency_loading = true
@serve_static_assets = true
- @time_zone = "UTC"
- @consider_all_requests_local = true
@session_store = :cookie_store
@session_options = {}
+ @time_zone = "UTC"
+ end
+
+ def encoding=(value)
+ @encoding = value
+ if defined?(Encoding) && Encoding.respond_to?(:default_external=)
+ Encoding.default_external = value
+ end
end
def middleware
@@ -129,7 +137,7 @@ module Rails
def default_middleware_stack
ActionDispatch::MiddlewareStack.new.tap do |middleware|
- middleware.use('::ActionDispatch::Static', lambda { Rails.public_path }, :if => lambda { serve_static_assets })
+ middleware.use('::ActionDispatch::Static', lambda { paths.public.to_a.first }, :if => lambda { serve_static_assets })
middleware.use('::Rack::Lock', :if => lambda { !allow_concurrency })
middleware.use('::Rack::Runtime')
middleware.use('::Rails::Rack::Logger')