Browse files

Lazy-require tzinfo for TimeZone

  • Loading branch information...
jeremy committed Nov 24, 2008
1 parent 0eca811 commit 1250faa858c825c7cb1e673dbc476b1629b154b2
@@ -1,4 +1,5 @@
require 'tzinfo'
module ActiveSupport
# A Time-like class that can represent a time in any time zone. Necessary because standard Ruby Time instances are
# limited to UTC and the system's <tt>ENV['TZ']</tt> zone.
@@ -288,6 +288,7 @@ def period_for_local(time, dst=true)
# TODO: Preload instead of lazy load for thread safety
def tzinfo
+ require 'tzinfo' unless defined?(TZInfo)
@tzinfo ||= TZInfo::Timezone.get(MAPPING[name])

0 comments on commit 1250faa

Please sign in to comment.