Permalink
Browse files

Removes the dependency that AMo has on tzinfo

[#4979 state:committed]
  • Loading branch information...
spastorino committed Jul 3, 2010
1 parent 201f373 commit f6d7a4d251cae3e425cb62898c50d3f070c69d4b
Showing with 6 additions and 6 deletions.
  1. +6 −6 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 @@ def self.seconds_to_utc_offset(seconds, colon = true)
# (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)

0 comments on commit f6d7a4d

Please sign in to comment.