diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-01 16:39:05 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-01 16:39:05 -0500 |
commit | cae25199008bc26d215e7af5558cfcdfdc6ec264 (patch) | |
tree | 9b1cd9bf1a2a770af31406652362001460816e5b /activesupport/lib/active_support/values/time_zone.rb | |
parent | d57397c4b62b6474ff8eb55bfd763f5e6dcdcd40 (diff) | |
parent | a0bb1dda119a7488b8a4d61b354a64e619b0d1b3 (diff) | |
download | rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.tar.gz rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.tar.bz2 rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activesupport/lib/active_support/values/time_zone.rb')
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 2ac5134911..67b37785f5 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -1,5 +1,11 @@ require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/try' +begin + require 'tzinfo' +rescue LoadError => e + $stderr.puts "You don't have tzinfo installed in your application. Please add it to your Gemfile and run bundle install" + raise e +end # The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following: # @@ -313,7 +319,7 @@ module ActiveSupport # TODO: Preload instead of lazy load for thread safety def self.find_tzinfo(name) - require 'tzinfo' unless defined?(::TZInfo) + require 'active_support/tzinfo' unless defined?(::TZInfo) ::TZInfo::TimezoneProxy.new(MAPPING[name] || name) end |