diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-07-03 12:46:38 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-07-03 12:46:38 -0700 |
commit | 070c24232f74c75b60757ff2bd3cc00ea662d5a6 (patch) | |
tree | 7d5c5c3635571fcfd06144f2dff7057e470105b3 /activesupport/lib/active_support/values/time_zone.rb | |
parent | 54250a5bfe6992afaaca6357d3b414e6c49651ba (diff) | |
parent | 075f8b72418f2d2ce9c2038bd57139955f6e46ec (diff) | |
download | rails-070c24232f74c75b60757ff2bd3cc00ea662d5a6.tar.gz rails-070c24232f74c75b60757ff2bd3cc00ea662d5a6.tar.bz2 rails-070c24232f74c75b60757ff2bd3cc00ea662d5a6.zip |
Merge remote branch 'spastorino/master'
Diffstat (limited to 'activesupport/lib/active_support/values/time_zone.rb')
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 05b40298d3..49dd8a1b99 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -1,11 +1,5 @@ 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: # @@ -201,6 +195,12 @@ module ActiveSupport # (GMT). Seconds were chosen as the offset unit because that is the unit that # Ruby uses to represent time zone offsets (see Time#utc_offset). def initialize(name, utc_offset = nil, tzinfo = nil) + 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 @name = name @utc_offset = utc_offset @tzinfo = tzinfo || TimeZone.find_tzinfo(name) |