aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-07-03 02:26:12 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-07-03 02:26:18 -0300
commitf6d7a4d251cae3e425cb62898c50d3f070c69d4b (patch)
treed453166efb62ac5976a0f7c4ec5c2a32bc37f4ad
parent201f373e7a183f33264ae31e7ca66768dddd3ebe (diff)
downloadrails-f6d7a4d251cae3e425cb62898c50d3f070c69d4b.tar.gz
rails-f6d7a4d251cae3e425cb62898c50d3f070c69d4b.tar.bz2
rails-f6d7a4d251cae3e425cb62898c50d3f070c69d4b.zip
Removes the dependency that AMo has on tzinfo
[#4979 state:committed]
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb12
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)