From b825bef74cdde2a29ee050a5ddf4034633abcfe0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 28 Apr 2009 17:58:51 -0700 Subject: Fix missing core extension dependencies --- railties/lib/commands/server.rb | 1 - railties/lib/console_app.rb | 2 ++ railties/lib/rails/plugin.rb | 1 + railties/lib/tasks/misc.rake | 6 +++++- railties/test/abstract_unit.rb | 1 + railties/test/plugin_test_helper.rb | 1 + 6 files changed, 10 insertions(+), 2 deletions(-) (limited to 'railties') diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index ebe34a42cd..91ac7752ef 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -1,4 +1,3 @@ -require 'active_support' require 'action_controller' require 'fileutils' diff --git a/railties/lib/console_app.rb b/railties/lib/console_app.rb index d7d01d703f..5c8302634a 100644 --- a/railties/lib/console_app.rb +++ b/railties/lib/console_app.rb @@ -1,3 +1,5 @@ +require 'active_support' +require 'active_support/core/all' require 'active_support/test_case' require 'action_controller' diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 63864058ee..bc28bec57e 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -1,3 +1,4 @@ +require 'active_support' require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/symbol' require 'active_support/dependencies' diff --git a/railties/lib/tasks/misc.rake b/railties/lib/tasks/misc.rake index 9e6f96db5b..a2c338aa5b 100644 --- a/railties/lib/tasks/misc.rake +++ b/railties/lib/tasks/misc.rake @@ -12,10 +12,10 @@ end desc 'Generate a crytographically secure secret key. This is typically used to generate a secret for cookie sessions.' task :secret do + require 'active_support/secure_random' puts ActiveSupport::SecureRandom.hex(64) end -require 'active_support' namespace :time do namespace :zones do desc 'Displays names of all time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6' @@ -30,6 +30,8 @@ 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' 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 @@ -38,6 +40,8 @@ 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' if offset offset = if offset.to_s.match(/(\+|-)?(\d+):(\d+)/) sign = $1 == '-' ? -1 : 1 diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index 0addcb8bf3..ffd60ee662 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -13,6 +13,7 @@ gem 'mocha', '>= 0.9.5' require 'mocha' require 'active_support' +require 'active_support/core/all' require 'active_support/test_case' if defined?(RAILS_ROOT) diff --git a/railties/test/plugin_test_helper.rb b/railties/test/plugin_test_helper.rb index 55d1a1fa96..adb62de665 100644 --- a/railties/test/plugin_test_helper.rb +++ b/railties/test/plugin_test_helper.rb @@ -3,6 +3,7 @@ $:.unshift File.dirname(__FILE__) + "/../../activesupport/lib" require 'test/unit' require 'active_support' +require 'active_support/core/all' require 'initializer' require File.join(File.dirname(__FILE__), 'abstract_unit') -- cgit v1.2.3