diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/console_app.rb | 3 | ||||
-rw-r--r-- | railties/lib/initializer.rb | 3 | ||||
-rw-r--r-- | railties/lib/rails_generator.rb | 13 | ||||
-rw-r--r-- | railties/lib/tasks/misc.rake | 4 |
4 files changed, 7 insertions, 16 deletions
diff --git a/railties/lib/console_app.rb b/railties/lib/console_app.rb index 42bf50e01e..75e6f11ea3 100644 --- a/railties/lib/console_app.rb +++ b/railties/lib/console_app.rb @@ -1,5 +1,4 @@ -require 'active_support' -require 'active_support/core/all' +require 'active_support/all' require 'active_support/test_case' require 'action_controller' diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 4c6de48a65..3c0d5940ea 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -263,9 +263,8 @@ module Rails # list. By default, all frameworks (Active Record, Active Support, # Action Pack, Action Mailer, and Active Resource) are loaded. def require_frameworks - require 'active_support' + require 'active_support/all' configuration.frameworks.each { |framework| require(framework.to_s) } - require 'active_support/core/all' rescue LoadError => e # Re-raise as RuntimeError because Mongrel would swallow LoadError. raise e.to_s diff --git a/railties/lib/rails_generator.rb b/railties/lib/rails_generator.rb index 201a9e0f91..85400932dd 100644 --- a/railties/lib/rails_generator.rb +++ b/railties/lib/rails_generator.rb @@ -21,16 +21,9 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -begin - require 'active_support' -rescue LoadError - activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" - if File.directory?(activesupport_path) - $:.unshift activesupport_path - require 'active_support' - end -end -require 'active_support/core/all' +activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib" +$:.unshift(activesupport_path) if File.directory?(activesupport_path) +require 'active_support/all' $:.unshift(File.dirname(__FILE__)) require 'rails_generator/base' diff --git a/railties/lib/tasks/misc.rake b/railties/lib/tasks/misc.rake index a2c338aa5b..fb2fc31dc1 100644 --- a/railties/lib/tasks/misc.rake +++ b/railties/lib/tasks/misc.rake @@ -31,7 +31,7 @@ namespace :time do desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time' task :local do require 'active_support' - require 'active_support/core/time' + require 'active_support/time' jan_offset = Time.now.beginning_of_year.utc_offset jul_offset = Time.now.beginning_of_year.change(:month => 7).utc_offset offset = jan_offset < jul_offset ? jan_offset : jul_offset @@ -41,7 +41,7 @@ namespace :time do # to find UTC -06:00 zones, OFFSET can be set to either -6, -6:00 or 21600 def build_time_zone_list(method, offset = ENV['OFFSET']) require 'active_support' - require 'active_support/core/time' + require 'active_support/time' if offset offset = if offset.to_s.match(/(\+|-)?(\d+):(\d+)/) sign = $1 == '-' ? -1 : 1 |