diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-31 10:03:35 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-31 10:03:35 -0700 |
commit | d848b7817fe5ce044709e09fa96464d0d6020c9d (patch) | |
tree | 1da4628fec848784c5c328503fabe53ca3e79348 | |
parent | 48068bc1a4bbb272def06139fab392cf964ddc8a (diff) | |
download | rails-d848b7817fe5ce044709e09fa96464d0d6020c9d.tar.gz rails-d848b7817fe5ce044709e09fa96464d0d6020c9d.tar.bz2 rails-d848b7817fe5ce044709e09fa96464d0d6020c9d.zip |
Encapsulate date/time core extensions and constant autoloads in active_support/core/time
-rw-r--r-- | activesupport/lib/active_support.rb | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/core.rb | 7 | ||||
-rw-r--r-- | activesupport/lib/active_support/core/all.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/core/time.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/core/time/autoload.rb | 4 | ||||
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 13 |
6 files changed, 25 insertions, 13 deletions
diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb index 7ebb3c48e0..d049740002 100644 --- a/activesupport/lib/active_support.rb +++ b/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 @@ module ActiveSupport 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' diff --git a/activesupport/lib/active_support/core.rb b/activesupport/lib/active_support/core.rb new file mode 100644 index 0000000000..ad8db94941 --- /dev/null +++ b/activesupport/lib/active_support/core.rb @@ -0,0 +1,7 @@ +module ActiveSupport + module Core + def self.load_all! + [TimeWithZone] + end + end +end diff --git a/activesupport/lib/active_support/core/all.rb b/activesupport/lib/active_support/core/all.rb new file mode 100644 index 0000000000..06440add20 --- /dev/null +++ b/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 diff --git a/activesupport/lib/active_support/core/time.rb b/activesupport/lib/active_support/core/time.rb new file mode 100644 index 0000000000..71565ac6c2 --- /dev/null +++ b/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' diff --git a/activesupport/lib/active_support/core/time/autoload.rb b/activesupport/lib/active_support/core/time/autoload.rb new file mode 100644 index 0000000000..6970c398c3 --- /dev/null +++ b/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 diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 531fdb9d31..bfec0711ad 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/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: # |