diff options
author | Carlhuda <carlhuda@Carlhudas-iMac.local> | 2009-11-30 15:58:38 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2009-12-02 11:35:47 -0800 |
commit | abfc4dad3ebb17eccd32d1f1eb8a3e9c0f6e6e4e (patch) | |
tree | d18e9cbdd059bab5379570b8c21d4c5e238fb929 /railties/lib | |
parent | 4dee277a9bc05083de6c831cf9aae0846849ecda (diff) | |
download | rails-abfc4dad3ebb17eccd32d1f1eb8a3e9c0f6e6e4e.tar.gz rails-abfc4dad3ebb17eccd32d1f1eb8a3e9c0f6e6e4e.tar.bz2 rails-abfc4dad3ebb17eccd32d1f1eb8a3e9c0f6e6e4e.zip |
Remove global Rails initializers
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails.rb | 17 | ||||
-rw-r--r-- | railties/lib/rails/application.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/initializable.rb | 22 | ||||
-rw-r--r-- | railties/lib/rails/initializer.rb | 2 |
4 files changed, 16 insertions, 29 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index c23b67e321..aeac85f4b3 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -10,4 +10,19 @@ require 'rails/core' require 'rails/configuration' require 'rails/deprecation' require 'rails/initializer' -require 'rails/plugin'
\ No newline at end of file +require 'rails/plugin' +require 'rails/ruby_version_check' + +# For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the +# multibyte safe operations. Plugin authors supporting other encodings +# should override this behaviour and set the relevant +default_charset+ +# on ActionController::Base. +# +# For Ruby 1.9, UTF-8 is the default internal and external encoding. +if RUBY_VERSION < '1.9' + $KCODE='u' +else + Encoding.default_external = Encoding::UTF_8 +end + +RAILS_ENV = (ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development").dup unless defined?(RAILS_ENV)
\ No newline at end of file diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 7ea79aa9c9..41ae3f9687 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -82,10 +82,6 @@ module Rails @app.call(env) end - initializer :initialize_rails do - Rails.run_initializers - end - # Set the <tt>$LOAD_PATH</tt> based on the value of # Configuration#load_paths. Duplicates are removed. initializer :set_load_path do diff --git a/railties/lib/rails/initializable.rb b/railties/lib/rails/initializable.rb index 3866b856b2..96234739cf 100644 --- a/railties/lib/rails/initializable.rb +++ b/railties/lib/rails/initializable.rb @@ -106,26 +106,4 @@ module Rails end end end - - include Initializable - - # Check for valid Ruby version (1.8.2 or 1.8.4 or higher). This is done in an - # external file, so we can use it from the `rails` program as well without duplication. - initializer :check_ruby_version, :global => true do - require 'rails/ruby_version_check' - end - - # For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the - # multibyte safe operations. Plugin authors supporting other encodings - # should override this behaviour and set the relevant +default_charset+ - # on ActionController::Base. - # - # For Ruby 1.9, UTF-8 is the default internal and external encoding. - initializer :initialize_encoding, :global => true do - if RUBY_VERSION < '1.9' - $KCODE='u' - else - Encoding.default_external = Encoding::UTF_8 - end - end end
\ No newline at end of file diff --git a/railties/lib/rails/initializer.rb b/railties/lib/rails/initializer.rb index 44101dcc94..95478428ec 100644 --- a/railties/lib/rails/initializer.rb +++ b/railties/lib/rails/initializer.rb @@ -1,7 +1,5 @@ require "rails" # In case people require this file directly -RAILS_ENV = (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development').dup unless defined?(RAILS_ENV) - module Rails class Initializer class Error < StandardError ; end |