aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-03-31 10:03:35 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-03-31 10:03:35 -0700
commitd848b7817fe5ce044709e09fa96464d0d6020c9d (patch)
tree1da4628fec848784c5c328503fabe53ca3e79348 /activesupport/lib/active_support
parent48068bc1a4bbb272def06139fab392cf964ddc8a (diff)
downloadrails-d848b7817fe5ce044709e09fa96464d0d6020c9d.tar.gz
rails-d848b7817fe5ce044709e09fa96464d0d6020c9d.tar.bz2
rails-d848b7817fe5ce044709e09fa96464d0d6020c9d.zip
Encapsulate date/time core extensions and constant autoloads in active_support/core/time
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core.rb7
-rw-r--r--activesupport/lib/active_support/core/all.rb4
-rw-r--r--activesupport/lib/active_support/core/time.rb4
-rw-r--r--activesupport/lib/active_support/core/time/autoload.rb4
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb13
5 files changed, 22 insertions, 10 deletions
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:
#