Skip to content
Browse files

Encapsulate date/time core extensions and constant autoloads in activ…

…e_support/core/time
  • Loading branch information...
1 parent 48068bc commit d848b7817fe5ce044709e09fa96464d0d6020c9d @jeremy jeremy committed Mar 31, 2009
View
6 activesupport/lib/active_support.rb
@@ -23,7 +23,7 @@
module ActiveSupport
def self.load_all!
- [Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte, SecureRandom, TimeWithZone]
+ [Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte, SecureRandom] + Core.load_all!
end
autoload :BacktraceCleaner, 'active_support/backtrace_cleaner'
@@ -46,11 +46,11 @@ def self.load_all!
autoload :Rescuable, 'active_support/rescuable'
autoload :SecureRandom, 'active_support/secure_random'
autoload :StringInquirer, 'active_support/string_inquirer'
- autoload :TimeWithZone, 'active_support/time_with_zone'
- autoload :TimeZone, 'active_support/values/time_zone'
autoload :XmlMini, 'active_support/xml_mini'
end
+require 'active_support/core/all'
+
require 'active_support/vendor'
require 'active_support/core_ext'
require 'active_support/dependencies'
View
7 activesupport/lib/active_support/core.rb
@@ -0,0 +1,7 @@
+module ActiveSupport
+ module Core
+ def self.load_all!
+ [TimeWithZone]
+ end
+ end
+end
View
4 activesupport/lib/active_support/core/all.rb
@@ -0,0 +1,4 @@
+require 'active_support/core'
+Dir["#{File.dirname(__FILE__)}/core/*.rb"].sort.each do |path|
+ require "active_support/core/#{File.basename(path, '.rb')}"
+end
View
4 activesupport/lib/active_support/core/time.rb
@@ -0,0 +1,4 @@
+require 'active_support/core/time/autoload'
+require 'active_support/core_ext/time'
+require 'active_support/core_ext/date'
+require 'active_support/core_ext/datetime'
View
4 activesupport/lib/active_support/core/time/autoload.rb
@@ -0,0 +1,4 @@
+module ActiveSupport
+ autoload :TimeWithZone, 'active_support/time_with_zone'
+ autoload :TimeZone, 'active_support/values/time_zone'
+end
View
13 activesupport/lib/active_support/values/time_zone.rb
@@ -1,13 +1,6 @@
-require 'active_support/core_ext/time/publicize_conversion_methods'
-require 'active_support/core_ext/time/acts_like'
-require 'active_support/core_ext/time/calculations'
-require 'active_support/core_ext/time/zones'
-
-require 'active_support/core_ext/date/acts_like'
-
-require 'active_support/core_ext/date_time/acts_like'
-require 'active_support/core_ext/date_time/calculations'
-require 'active_support/core_ext/date_time/zones'
+require 'active_support/core_ext/time'
+require 'active_support/core_ext/date'
+require 'active_support/core_ext/date_time'
# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
#

0 comments on commit d848b78

Please sign in to comment.
Something went wrong with that request. Please try again.